home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 32 Periodic
/
32-Periodic.zip
/
rvue1b.zip
/
EXEMPLE1.ZIP
/
TEST1.CPP
< prev
next >
Wrap
Text File
|
1993-11-28
|
1KB
|
63 lines
#define INCL_PM
#include <os2.h>
MRESULT EXPENTRY WinPrincipal( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
MRESULT EXPENTRY WinPrincipal( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
switch( msg )
{
case WM_CREATE:
break;
case WM_CLOSE:
if(WinMessageBox(HWND_DESKTOP, hwnd,
"Voulez-vous vraiment quitter cette application?",
"Juste pour être certain...", 0,
MB_YESNO | MB_QUERY)
== MBID_YES) WinPostMsg(hwnd,WM_QUIT,MPVOID,MPVOID);
break;
case WM_ERASEBACKGROUND:
return(MRESULT)(TRUE);
default:
return WinDefWindowProc( hwnd, msg, mp1, mp2 );
}
return (0);
}
int main(void)
{
HAB hab;
HMQ hmq;
HWND hwndFrame;
QMSG qmsg;
ULONG flCreate;
char titre1[] = "Calcul";
hab = WinInitialize(0);
if (!hab) return 1;
hmq = WinCreateMsgQueue(hab, 0);
if (!hmq) return 1;
WinRegisterClass(hab, (PSZ)"Principale", WinPrincipal, CS_SIZEREDRAW, 0);
flCreate = FCF_SIZEBORDER | FCF_SYSMENU |
FCF_MINMAX | FCF_SHELLPOSITION | FCF_TITLEBAR;
hwndFrame = WinCreateStdWindow(HWND_DESKTOP, WS_VISIBLE,
&flCreate, "Principale", titre1, 0L, NULLHANDLE, 0, NULL);
while( WinGetMsg( hab, &qmsg, 0L, 0, 0 ) )
WinDispatchMsg( hab, &qmsg );
WinDestroyWindow(hwndFrame);
WinDestroyMsgQueue( hmq );
WinTerminate( hab );
return 0;
}