home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
editor
/
pmedit5
/
pmedit1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-31
|
2KB
|
107 lines
#include <OS2.H>
MRESULT EXPENTRY WndProc (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
void main()
{
HAB HAncBlk;
HMQ HMesQue;
HWND HFrame, HClient;
QMSG QueMess;
ULONG CtlData =
FCF_MINMAX |
FCF_SHELLPOSITION |
FCF_SIZEBORDER |
FCF_SYSMENU |
FCF_TASKLIST |
FCF_TITLEBAR;
HAncBlk = WinInitialize
(0);
HMesQue = WinCreateMsgQueue
(HAncBlk,
0);
WinRegisterClass
(HAncBlk,
"MAIN",
WndProc,
0L,
0);
HFrame = WinCreateStdWindow
(HWND_DESKTOP,
WS_VISIBLE,
&CtlData,
"MAIN",
": PM Text Editor",
0L,
0,
0,
&HClient);
while (WinGetMsg
(HAncBlk,
&QueMess,
0,
0,
0))
WinDispatchMsg (HAncBlk, &QueMess);
WinDestroyWindow (HFrame);
WinDestroyMsgQueue (HMesQue);
WinTerminate (HAncBlk);
}
MRESULT EXPENTRY Paint (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
MRESULT EXPENTRY WndProc
(HWND hwnd,
USHORT msg,
MPARAM mp1,
MPARAM mp2)
{
switch (msg)
{
case WM_PAINT:
return Paint (hwnd, msg, mp1, mp2);
default:
return WinDefWindowProc (hwnd,msg,mp1,mp2);
}
}
MRESULT EXPENTRY Paint (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
{
HPS HPresSpace;
RECTL Rect;
static char Message [] =
"This line is display by the window procedure.";
HPresSpace = WinBeginPaint
(hwnd,
0,
0);
WinFillRect
(HPresSpace,
&Rect,
CLR_WHITE);
WinDrawText
(HPresSpace,
0xffff,
Message,
&Rect,
CLR_BLACK,
CLR_WHITE,
DT_LEFT |
DT_TOP);
WinEndPaint (HPresSpace);
return FALSE;
}