home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
siqftst.zip
/
siqtst.c
< prev
next >
Wrap
Text File
|
1996-02-12
|
2KB
|
110 lines
#define INCL_PM
#define INCL_DOS
#define MYAPP "MyApp"
#define ID_MYWINDOW 42
#define ID_BUTTON 51
/* Includes */
#include <os2.h>
/* Prototypes */
MRESULT EXPENTRY MyWinProc (HWND, ULONG, MPARAM, MPARAM);
/* Global Variables */
HAB hab;
HWND hwndClient,
hwndFrame,
hwndButton;
/* main function */
void main (void)
{
HMQ hmq;
QMSG qmsg;
ULONG flCreate;
hab = WinInitialize (0);
if (!hab)
return;
hmq = WinCreateMsgQueue (hab, 0);
WinRegisterClass(
hab,
MYAPP,
(PFNWP) MyWinProc,
CS_SIZEREDRAW,
0);
flCreate = FCF_TITLEBAR | FCF_SYSMENU |
FCF_SIZEBORDER |
FCF_TASKLIST | FCF_SHELLPOSITION ;
hwndFrame = WinCreateStdWindow(
HWND_DESKTOP,
WS_VISIBLE,
&flCreate,
MYAPP,
"SIQ fix test",
0L,
NULLHANDLE,
ID_MYWINDOW,
&hwndClient);
hwndButton = WinCreateWindow(hwndClient,
WC_BUTTON,
"Lock PM queue",
WS_VISIBLE | BS_PUSHBUTTON,
10,10,
200,50,
hwndClient,
HWND_TOP,
ID_BUTTON,
NULL,
NULL);
while (WinGetMsg (hab,&qmsg,(HWND)NULL,0,0))
WinDispatchMsg (hab,&qmsg);
WinDestroyWindow(hwndFrame);
WinDestroyMsgQueue(hmq);
WinTerminate(hab);
}
/* our window procedure */
MRESULT EXPENTRY MyWinProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
switch (msg)
{
case WM_ERASEBACKGROUND:
return (MRESULT) TRUE;
break;
case WM_COMMAND:
switch (SHORT1FROMMP(mp1))
{
case ID_BUTTON:
WinSetWindowText(hwndButton,"PM queue Locked");
DosBeep(1000,250);
DosSleep(30000);
DosBeep(1000,1000);
WinSetWindowText(hwndButton,"Lock PM queue");
return 0;
}
default:
return WinDefWindowProc (hwnd, msg, mp1, mp2);
}
return FALSE;
}