beautypg.com

Casio PA-2400W User Manual

Page 32

background image

32

wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = hInstance;
wc.hIcon = NULL;
wc.hCursor = NULL;
wc.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = ClassName;

return (RegisterClass(&wc));

}

// ****************************************************************************************//
// InitInstance //
// ****************************************************************************************//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{

HWND hWnd;
hInst = hInstance;

// Store instance handle in our global variable

hWnd = CreateWindow(ClassName, ClassName,

( WS_VISIBLE | WS_OVERLAPPED | WS_SYSMENU),
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

if (hWnd == 0) // Check whether values returned by CreateWindow() are valid.

return (FALSE);

if (IsWindow(hWnd) != TRUE)

return (FALSE);

ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd);

return(TRUE);

// Window handle hWnd is valid.

}

int WINAPI WinMain(

HINSTANCE hInstance,

HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)

{

MSG msg;

if (hPrevInstance == 0) {

if (InitApplication(hInstance) == FALSE) {

NKDbgPrintfW( TEXT("CallSip : InitApp failed!\n"));
return(FALSE);

}

}
if (InitInstance(hInstance, nCmdShow) == FALSE) {

NKDbgPrintfW( TEXT("CallSip : InitInst failed!\n"));
return(FALSE);

}
while (GetMessage(&msg, NULL, 0, 0) == TRUE) {

TranslateMessage(&msg);
DispatchMessage(&msg);

}
return(msg.wParam);

}