TIP: Click on subject to list as thread! ANSI
echo: delphi
to: JOAQUIM HOMRIGHAUSEN
from: BART BROERSMA
date: 1997-10-26 00:02:00
subject: Removing a window`s title bar (Delphi 1.00:02:4610/26/97

Quoting a message from Joaquim Homrighausen to All 
JH>MSGID: 2:201/330.3 1d084e04
JH>Is there a way (in Delphi) to remove a window's title bar?
JH>By using a Windows API call, I can actually enable/disable the title ba
JH>but I can't figure out why Delphi (or Windows) doesn't want to update t
JH>form's frame (and thus show/hide the title bar). If I go to resize the 
JH>frame (window) of the form, the title bar is updated properly to what I
JH>would expect it to be.
JH>I've tried Invalidate, Repaint, Update, and Refresh - none of these see
JH>to want to do anything with it. The Windows code I'm using is:
JH>PROCEDURE TMainForm.FormDblClick(Sender: TObject);
JH>VAR
JH>  LongVal :LONGINT;
JH>BEGIN
JH>  LongVal:=GetWindowLong(Handle, GWL_STYLE);
JH>  LongVal:=Longval XOR ws_Caption;
JH>  SetWindowLong(Handle, GWL_STYLE, LongVal);
JH>  Refresh;
JH>END;
JH>What am I doing wrong.. ?
Here's what I use, works fine for me.
  SetWindowLong(Handle,GWL_STYLE,
    GetWindowLong(Handle,GWL_STYLE) AND NOT
    WS_CAPTION);
  ClientHeight := Height;
  ^^^^^^^^^ Does the trick !
C.U.
Bart
--------------------------------------
Bart Broersma
broersma@knmg.nl
 * Wave Rider 1.20 [NR] *
... UNREGISTERED EVALUATION COPY
--- Wave Rider v1.20
---------------
* Origin: Aargh! BBS Amsterdam (2:280/606)

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™.