| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Toggling Titlebar |
-=> Quoting Gary Chambers to All <=-
GC> How can I toggle the Titlebar window with a double-click of the mouse?
GC> I have tried getting the Titlebar and/or SysMenu id's, then using
GC> WinShowWindow(hwnd, FALSE). I suppose it's safe to assume that
GC> there's more to this than meets my eyes.
There's an example of this in pfaq34.zip. Mike Bilow has it available for
freq, or you may be able to find it locally.
Here's a snippet...
-------------------------------------------------------------------------------
How can I toggle my titlebar on and off?
Basically, move frame window controls from being children of the frame
to being children of the background HWND_OBJECT. You can then reverse
the process to bring them back into view. Following function implements
this code.
/* --------------------------------------------------------------
-- Function: ToggleFrame
--
-- Description: Toggles frame control visible/invisible
--
-- Notes: Code stolen from someone who stole it from an MS sample
----------------------------------------------------------------- */
void ToggleFrame(HWND hwndFrame) {
if (! Hidden) { /* hide contorls */
hwndTitle = WinWindowFromID( hwndFrame, FID_TITLEBAR );
hwndSys = WinWindowFromID( hwndFrame, FID_SYSMENU );
. . . repeat for FID_MINMAX, etc . . .
WinSetParent(hwndTitle, HWND_OBJECT, FALSE );
WinSetParent(hwndSys, HWND_OBJECT, FALSE );
. . . repeat for FID_MINMAX, etc . . .
}
else { /* restore controls */
WinSetParent( hwndTitle, hwndFrame, FALSE );
WinSetParent( hwndSys, hwndFrame, FALSE );
. . . basically reverse of above . . .
}
WinSendMsg( hwndFrame, WM_UPDATEFRAME,
(MPARAM)(FCF_TITLEBAR | FCF_SYSMENU | . . . ), NULL);
SizeTheWindow( hwndFrame );
Hidden = ! Hidden;
return;
}
Phil
Fido: 1:124/8014.1 | Internet: phil.crown{at}bluecafe.com
--- Blue Wave/Max v2.22b
* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 214-250-4479 * (1:124/1208)SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955 SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809 @PATH: 124/1208 1 396/1 270/101 712/515 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
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™.