HWND hDesk;
RECT rc;
if (stat == 0)
{
// 全屏
hDesk = GetDesktopWindow();
GetWindowRect( hDesk, &rc);
SetWindowLong( hwnd, GWL_STYLE, WS_BORDER);
SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, rc.right, rc.bottom, SWP_SHOWWINDOW);
stat = 1;
}
else
{
// 窗口化
SetWindowLong( hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW);
MoveWindow(hwnd, left, top, width,height, TRUE);
InvalidateRect(0,NULL,0); //桌面重绘
stat = 0;
}
return 0;