LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;
static HDESK hNow = hCurrent;
switch (message)
{
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps) ;
EndPaint (hwnd, &ps) ;
return 0 ;
case WM_DESTROY:
//在关闭虚拟桌面前要切换回当前桌面
SwitchDesktop(hCurrent);
PostQuitMessage (0) ;
return 0 ;
case WM_HOTKEY:
if(0x0001 == wParam)
{
if(hNow == hCurrent)
{
SwitchDesktop(hVirtualDesk);
hNow = hVirtualDesk;
}
else
{
SwitchDesktop(hCurrent);
hNow = hCurrent;
}
}
if(0x0002 == wParam)
{
//用TerminateProcess终止explorer进程的时候,如果传递第二个参数为1
//那么操作系统不会在终止后自动唤醒explorer,如果为0,会重新启动
//explorer
TerminateProcess(piExplor.hProcess,1);
//关闭虚拟桌面
CloseDesktop(hVirtualDesk);
SendMessage(hwnd,WM_CLOSE,0,0);
}
return 0;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
2009年上半年全国计算机等级考试参考答案请进入计算机考试论坛
2009年全国计算机等级考试报名信息汇总
2009年NCRE考试有新变化
2009年全国计算机等级考试大纲
2009年上半年全国计算机二级考试试题及答案
2009年上半年全国计算机等级考试试题答案汇总