Windows NT ( 2)



         

RCLOCK - 2


wc.lpszMenuName = MAKEINTRESOURCE(IDR_APPMENU);

wc.lpszClassName = szAppName;

if(!RegisterClassEx(&wc))

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

return FALSE;

//

hWnd = CreateWindow(szAppName, szAppTitle,

WS_POPUPWINDOW | WS_THICKFRAME,

100, 100, 100, 100,

NULL, NULL, hInst, NULL);

if(!hWnd) return(FALSE);

//

GetWindowRect(GetDesktopWindow(), &rc);

MoveWindow(hWnd,

rc.right - cxChar * 25,

rc.bottom - cyChar * 3,

cxChar * 10, cyChar * 2, TRUE);

//

//

ShowWindow(hWnd, nCmdShow);

UpdateWindow(hWnd);

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

{

TranslateMessage(&msg);

DispatchMessage(&msg);

}

return msg.wParam;

}

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

// WndProc

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

LRESULT WINAPI

WndProc(HWND hWnd, UINT msg, WPARAM wParam,

LPARAM lParam)

{

switch(msg)

{

// STIME

case WM_COPYDATA:

{

// , STIME,

//

strcpy(szBuf, ((PCOPYDATASTRUCT)lParam)->lpData);

// ,

//

InvalidateRect(hWnd, NULL, TRUE);

break;

}

HANDLE_MSG(hWnd, WM_CREATE, WndProc_OnCreate);

HANDLE_MSG(hWnd, WM_DESTROY, WndProc_OnDestroy);

HANDLE_MSG(hWnd, WM_PAINT, WndProc_OnPaint);

default:

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

}

}

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

// WndProc_OnCreate

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

BOOL WndProc_OnCreate(HWND hWnd,

LPCREATESTRUCT lpCreateStruct)