TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Patrick Haller
date: 1996-11-19 06:44:12
subject: sticky dialog

Hi Paul!

[..]
 PE> int main( void)
 PE> {
 PE>     HAB hab ;
 PE>     CHAR szClassName[] = "fred" ;
 PE>     ULONG createFlags = FCF_SYSMENU | FCF_TITLEBAR |
 PE>                         FCF_SIZEBORDER | FCF_SHELLPOSITION ;
 PE>     HMQ hmq ;
 PE>     HWND hwndClient;
 PE>     QMSG qmsg ;
 PE>     HACCEL haccel ;

 PE>     hab = WinInitialize( 0) ;
 PE>     hmq = WinCreateMsgQueue( hab, 0L) ;

[..]
Insert the WinLoadDlg here. Be sure to apply the correct PFN to your 
dialog procedure ! And care about the dialog procedure being slightly
different from a regular window procedure.
 PE>             hwndFrame = WinLoadDlg( HWND_DESKTOP, hwnd,
 PE>                                     NULL,
 PE>                                     NULLHANDLE, ID_DIALOG,
 PE>                                     NULL) ;

[..]
You won't need a separete window class, nor a standard window.
 PE>     WinRegisterClass(   hab, szClassName,
 PE>                         ClientWndProc,
 PE>                         CS_SIZEREDRAW, 0L) ; 
 PE>     WinCreateStdWindow(HWND_DESKTOP,
 PE>                        WS_VISIBLE,
 PE>                        &createFlags,
 PE>                        szClassName,
 PE>                        (PSZ)"fred program",
 PE>                        (ULONG)0,
 PE>                        NULLHANDLE,
 PE>                        (ULONG)0,
 PE>                        &hwndClient);
So remove this code.

 PE>     while( WinGetMsg( hab, &qmsg, NULLHANDLE, 0L, 0L))
 PE>         WinDispatchMsg( hab, &qmsg) ;

[..]
 PE>     WinDestroyWindow( hwndClient) ;
And this shall be removed as well.

 PE>     WinDestroyMsgQueue( hmq) ;
 PE>     WinTerminate( hab) ;

 PE>     return 0L ;
 PE> }

     __
     |_)
cu/2 |atrick
[Team  OS/2]

--- FleetStreet 1.18+
* Origin: OS/2 Bodensee ! (2:246/2315.18)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 246/2315 2300 2340 10 240/5202 5010 2433/225 270/101 712/515 711/808
@PATH: 711/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™.