home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
sampl254.zip
/
gcc2
/
samples
/
sample3
/
stdmain.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-11
|
4KB
|
85 lines
//**************************************************************************
#include <stdlib.h>
#include "sample3.h"
#include "process.h"
//**************************************************************************
extern "C"
{
MRESULT ClientWndProc (HWND, USHORT, MPARAM, MPARAM);
}
// ********* Global Variables *********************************************
Process Proc;
// *************************************************************************
int main (int argc,
char * argv[])
{// Variable Declarations
static ULONG flFrameFlags = FCF_TITLEBAR |
FCF_SYSMENU |
FCF_SIZEBORDER |
FCF_MINMAX |
FCF_SHELLPOSITION |
FCF_TASKLIST |
FCF_VERTSCROLL |
FCF_HORZSCROLL |
FCF_MENU |
FCF_ICON;
HWND hwndClient;
HWND hwndFrame;
static CHAR szTitleBarText[] = "Standard Program Label";
QMSG QueMsg;
static CHAR szPrvtWinClass[] = "Private Class";
// Register a private window class for this application.
WinRegisterClass (Proc.AnchorBlock(), // Anchor Block handle
(PSZ) szPrvtWinClass, // Name of window class
(PFNWP) ClientWndProc, // Window procedure for class
CS_SIZEREDRAW, // Set redraw on window resize
0); // Extra bytes to reserve
// Create a standard window frame.
hwndFrame = WinCreateStdWindow (HWND_DESKTOP, // Create a parent window
WS_VISIBLE | // Make the window visible
FS_ACCELTABLE | // Use accelerator table
FS_ICON, // Use Icon
&flFrameFlags, // Creation flags
(PSZ) szPrvtWinClass, // window class name
(PSZ) szTitleBarText, // Title bar text
0L, // Style of client window
(HMODULE) NULL, // Resource is in application module
ID_RESOURCE, // ID of resources for this frame window
&hwndClient); // Returned client window handle
// Standard message processing loop. WinGetMsg returns FALSE if the
// returned message is WM_QUIT. Returns TRUE for all other messages
while (WinGetMsg (Proc.AnchorBlock(), // Anchor block handle
&QueMsg, // Pointer to queue message structure
0, // No window message filter
0, // Retrieve all messages
0)) // Retrieve all messages
{WinDispatchMsg(Proc.AnchorBlock(), // Anchor block handle
&QueMsg); // structure holding message
}
// The WM_QUIT message has been received. Destroy window. Destroy
// message queue. Let go of anchor block.
WinDestroyWindow(hwndFrame);
// Terminate program.
return 0;
}