1. 今天上午开会邓师傅大概把设计文档讲解了一遍。
2. 中午写了第一篇会议纪要。
3. 下午配合邓师傅写完了获得全局参数的接口。
4. 写了一个小的隐藏窗口函数。


#include <windows.h>

HINSTANCE hInst;

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

ATOM MyRegisterClass(HINSTANCE hInstance)


{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance,IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = L"FspService";
wcex.hIconSm = NULL;

return RegisterClassEx(&wcex);
}

BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)


{
HWND hWnd;

hInst = hInstance; // Store instance handle in our global variable

hWnd = CreateWindow(L"FspService",L"FspService",NULL,
0, 0, 0, 0, NULL, NULL, hInstance, NULL);

if (!hWnd)

{
return FALSE;
}

ShowWindow(hWnd, SW_HIDE);
UpdateWindow(hWnd);

return TRUE;
}


LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)


{

switch (message)

{
case WM_QUERYENDSESSION:

if(0x80000000==lParam)
{
MessageBox(hWnd,L"Log Off!",L"SHOW",MB_OK);
return 0;}

else
{
MessageBox(hWnd,L"Shut Down!",L"SHOW",MB_OK);
return 0;}
case WM_ENDSESSION:
MessageBox(hWnd,L"Shut Down!",L"SHOW",MB_OK);
return 0;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}


int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,

PSTR szCmdLine, int iCmdShow)



{
MSG msg;

MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance,iCmdShow))

{
return FALSE;
}

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))

{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
}

5.接到原师傅分配的想2.1深层次异常的任务。
posted on 2009-09-24 18:15
Mitnick 阅读(136)
评论(0) 编辑 收藏 引用 所属分类:
工作日志