Tripolarbear

4k Resolution

Apr 19th, 2021
11,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #SingleInstance force
  2.  
  3. ; Exclude the desktop
  4. ; Note: Also excludes "My Computer" browsing windows.
  5. ; Better detection might be needed to differentiate the parent explorer "ahk_id" from child windows.
  6. ; Also seems to disregard accidental Metro interface clicks (Win 8+)
  7. #IfWinNotActive ahk_exe explorer.exe
  8.  
  9. ; Set your resolution (minus decorations like start bars if you wish to leave those on-screen.
  10. w = 3840
  11. h = 1600
  12. w_wasted = 6 ; width used by resize bars
  13. h_wasted = 29 ; width used by caption frame and resize bars
  14.  
  15. ; Window to fullscreen
  16. F10::
  17. SetTitleMatchMode, 2
  18. WinGet Style, Style, A
  19.  
  20. ; 0xC40000 = WS_BORDER (0x800000) + WS_DLGFRAME (0x400000) + WS_SIZEBOX aka WS_THICKFRAME (0x040000)
  21. if(Style & 0xC00000) { ; if has WS_CAPTION. Ignore sizebox value.
  22. WinGetPos, X, Y, Width, Height, A
  23. WinSet, Style, -0xC40000, A ; removes attributes, including sizebox...doesn't do a strict subtraction
  24. WinMove,A,,0,0,w,h
  25. } else {
  26. WinSet, Style, +0xC40000, A
  27. ; Note: will set WS_SIZEBOX even if not previously present
  28. if(Width > w - w_wasted) {
  29. Width := %w%-%w_wasted%
  30. }
  31. if(Height > h - h_wasted) {
  32. Height := %h%-%h_wasted%
  33. }
  34. WinMove,A,,%X%,%Y%,%Width%,%Height%
  35. }
  36. WinSet Redraw
  37. Return
Advertisement
Add Comment
Please, Sign In to add comment