Guest User

Untitled

a guest
Feb 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. void switch_view()
  2. {
  3. RECT rc;
  4. SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, NULL);
  5. DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
  6. if(style & WS_CAPTION)
  7. {
  8. SetWindowLongPtr(hwnd, GWL_STYLE, WS_OVERLAPPED);
  9. SetWindowLongPtr(hwnd, GWL_EXSTYLE, 0);
  10. SetWindowPos(hwnd, NULL, 0, 0, rc.right, rc.bottom,
  11. SWP_SHOWWINDOW | SWP_FRAMECHANGED);
  12. }
  13. else
  14. {
  15. SetWindowLongPtr(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
  16. SetWindowPos(hwnd, NULL, 0, 0, 0, 0,
  17. SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
  18. }
  19. }
Add Comment
Please, Sign In to add comment