TIP: Click on subject to list as thread! ANSI
echo: delphi
to: JOAQUIM HOMRIGHAUSEN
from: HENRIK WAHLBERG
date: 1997-10-26 16:40:00
subject: Removing a window`s title bar (Delphi 1.16:40:0010/26/97

Hello Joaquim
 > PROCEDURE TMainForm.FormDblClick(Sender: TObject);
 > VAR
 >   LongVal :LONGINT;
 > BEGIN
 >   LongVal:=GetWindowLong(Handle, GWL_STYLE);
 >   LongVal:=Longval XOR ws_Caption;
 >   SetWindowLong(Handle, GWL_STYLE, LongVal);
 >   Refresh;
 > END;
 > What am I doing wrong.. ?
AFAIK The refresh will invalidate the client window. What You nead to do is 
to invalidate the entire window, including the NC_ parts (NonClient)
It's costomary (?) for toplevel windows to have a border/caption. Under which 
circumstances or why do yoy want to change that?
SetWindowText(handle,Caption) does work when not fiddeling with style, it 
might invalidate the nonlcient parts.
Second method might be the SetWindowPos(....), the SWP_x flags gives a lot of 
options.
Otherwise you might consider the WM_NCx messages. There might be one that 
will do the trick.
But again, what are you trying to accompilsh. The right approch might be 
simpler!
MVH -hw-
---
---------------
* Origin: Henrik's OS/2 point. DKEGHHW0@IBMMAIL.COM FidoNet: (2:238/64.15)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.