Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case WM_TIMER:
- {
- if (wp == timerIdWindowUpdate)
- {
- WINDOWPLACEMENT windowPlacement = { sizeof(WINDOWPLACEMENT), };
- if (::GetWindowPlacement(cmdHanlde, &windowPlacement))
- {
- if (windowPlacement.showCmd == SW_SHOWMINIMIZED
- || !IsWindowVisible(cmdHanlde))
- {
- ShowWindow(hwnd,SW_HIDE);
- }
- else
- {
- RECT rect = {};
- ::GetWindowRect(cmdHanlde, &rect);
- MONITORINFO monInfo;
- monInfo.cbSize = sizeof(MONITORINFO);
- GetMonitorInfoW(MonitorFromWindow(cmdHanlde, MONITOR_DEFAULTTONEAREST), &monInfo);
- if (cmdHanlde != NULL && ::IsZoomed(cmdHanlde))
- {
- rect.left = monInfo.rcWork.left;
- rect.top = monInfo.rcWork.top;
- rect.bottom = monInfo.rcWork.bottom > rect.bottom ? rect.bottom : monInfo.rcWork.bottom;
- rect.right = monInfo.rcWork.right > rect.right ? rect.right : monInfo.rcWork.right;
- }
- ::SetWindowPos(hwnd, cmdHanlde, rect.left-4, rect.top-4, rect.right + 8 - rect.left, rect.bottom + 8 - rect.top,
- SWP_SHOWWINDOW );
- }
- }
- }
- else if (wp == timerIdFrameColor)
- {
- tick = !tick;
- ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement