home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
MQSRC.LZH
/
MQ.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-05-05
|
2KB
|
77 lines
#define INCL_WIN
#include <os2.h>
#include "mq.h"
MRESULT EXPENTRY MainWinProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
{
HPS hps;
RECTL rcl;
switch(msg){
case WM_PAINT:
hps = WinBeginPaint(hwnd, NULL, &rcl);
WinFillRect(hps, &rcl, CLR_WHITE);
WinEndPaint(hps);
break;
case WM_ERASEBACKGROUND:
return((MRESULT)TRUE);
case WM_COMMAND:
switch( SHORT1FROMMP(mp1)){
case IDM_NEW:
OpenNewMleWin(hwnd);
break;
}
break;
default:
return(WinDefWindowProc(hwnd, msg, mp1, mp2));
}
return(0);
}
int cdecl main(void)
{
ULONG flstyle;
HMQ hmq;
QMSG qmsg;
HAB hab;
char *szClass = "foo";
HWND hwndFrame, hwndClient;
hab = WinInitialize(0);
hmq = WinCreateMsgQueue(hab, 0); /*DEFAULT_QUEUE_SIZE);*/
if(!WinRegisterClass(hab, szClass, MainWinProc, 0L, 0))
return(1);
if(!WinRegisterClass(hab, "MyMLE", MleWinProc, CS_SIZEREDRAW, sizeof(PVOID)))
return(1);
flstyle = FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER | FCF_MINMAX |
FCF_TASKLIST | FCF_SHELLPOSITION | FCF_MENU;
hwndFrame = WinCreateStdWindow(HWND_DESKTOP,
0L, /* frame-window style */
&flstyle, /* window style */
szClass, /* class name */
NULL, /* window title */
0L, /* default client style */
0, /* resource in executable file */
ID_MAIN , /* resource id */
&hwndClient); /* receives client window handle */
if(!hwndFrame)
return(1);
WinShowWindow(hwndFrame, TRUE);
while (WinGetMsg(hab, &qmsg, NULL, 0, 0))
WinDispatchMsg(hab, &qmsg);
WinDestroyMsgQueue(hmq);
WinTerminate(hab);
}