Windows NT ( 2)



         

SETLOCAL - 2


MAKEINTRESOURCE(IDI_APPICONSM),

IMAGE_ICON, 16, 16, 0);

wc.style = 0;

wc.lpfnWndProc = (WNDPROC)WndProc;

wc.cbClsExtra = 0;

wc.cbWndExtra = 0;

wc.hInstance = hInst;

wc.hIcon = LoadImage(hInst,

MAKEINTRESOURCE(IDI_APPICON),

IMAGE_ICON, 32, 32, 0);

wc.hCursor = LoadCursor(NULL, IDC_ARROW);

wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);

wc.lpszMenuName = MAKEINTRESOURCE(IDR_APPMENU);

wc.lpszClassName = szAppName;

if(!RegisterClassEx(&wc))

if(!RegisterClass((LPWNDCLASS)&wc.style))

return FALSE;

//

hWnd = CreateWindow(szAppName, szAppTitle,

WS_OVERLAPPEDWINDOW,

CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,

NULL, NULL, hInst, NULL);

if(!hWnd) return(FALSE);

//

//

ShowWindow(hWnd, nCmdShow);

UpdateWindow(hWnd);

while(GetMessage(&msg, NULL, 0, 0))

{

TranslateMessage(&msg);

DispatchMessage(&msg);

}

//

// ,

//

free(lpList);

return msg.wParam;

}

// -----------------------------------------------------

// WndProc

// -----------------------------------------------------

LRESULT WINAPI

WndProc(HWND hWnd, UINT msg, WPARAM wParam,

LPARAM lParam)

{

switch(msg)

{

HANDLE_MSG(hWnd, WM_COMMAND, WndProc_OnCommand);

HANDLE_MSG(hWnd, WM_DESTROY, WndProc_OnDestroy);

default:

return(DefWindowProc(hWnd, msg, wParam, lParam));

}

}

// -----------------------------------------------------

// WndProc_OnDestroy

// -----------------------------------------------------

#pragma warning(disable: 4098)

void WndProc_OnDestroy(HWND hWnd)

{

PostQuitMessage(0);

return 0L;

}

// -----------------------------------------------------