ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

tool to fullscreen (not just maximize) any application?

<< < (3/5) > >>

mackal:
:) To prevent windows repainting, have a look at these API functions:


SendMessage(hwnd, WM_SETREDRAW, FALSE, 0)
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0)

or

SetWindowRedraw(hwnd, FALSE)
SetWindowRedraw(hwnd, TRUE)

Try something like

--- ---hwnd:=WinExist("A")
DllCall("SetWindowRedraw",UInt,hwnd,UInt,1)Skrommel
-skrommel (May 16, 2007, 01:31 PM)
--- End quote ---

If I understand this correctly, it prevents repaints to the window's client area, right?  I misworded my intention: I was wondering about getting Window's to freeze display of the WHOLE window.  Currently, I can see the window lose its border, then caption, then move and resize, all steps seperate but in quick succession; instead I would like to have the window go directly from its initial configuration to its final look DIRECTLY.  Not sure how doable it is with just AHK though...

mackal:
Actually, it turns out that the SetWindowRedraw() approach wasn't working at all (DllCall() resulted in an ErrorLevel of -4, i.e., function not found), hence why I was so quick to dismiss your suggestion...  I've since found that DllCall("LockWindowUpdate", ...) works instead:

  http://msdn2.microsoft.com/en-us/library/ms534869.aspx

Perhaps a difference of OSes? I am using WinXP... I think this does the same thing.  Even though it freezes the client area only, it actually makes a huge difference!  Thanks for pointing me down this road, skrommel!  :up:

Updated code, for those interested:
Spoilerfs_engaged := 0      ; is "fullscreen" engaged for some window?
padding := 2      ; additional padding width to remove, in pixels

#Enter::
if (fs_engaged = 0) {
    ID:=WinActive("A")
    hwnd:=WinExist("A")
    DllCall("LockWindowUpdate",UInt,hwnd)
    WinGetPos, oldX, oldY, oldW, oldH   ; save old dimensions
    WinSet, Style, -0xC00000, ahk_id %ID% ; remove titlebar/WS_CAPTION
    WinSet, Style, -0x40000 , ahk_id %ID% ; remove borders/WS_SIZEBOX
    WinSet, AlwaysOnTop , On, ahk_id %ID%

    ;; work out current desktop resolution
    SysGet, m, Monitor
    desk_width := mRight - mLeft
    desk_height := mBottom - mTop

    WinMove, ahk_id %ID%,, -padding,-padding
       ,desk_width+2*padding, desk_height+2*padding

    DllCall("LockWindowUpdate",UInt,0)
    fs_engaged:=1
} else {
    ;; reverse all the operations performed above
    DllCall("LockWindowUpdate",UInt,hwnd)
    WinSet, AlwaysOnTop , Off, ahk_id %ID%
    WinSet, Style, +0xC00000, ahk_id %ID%
    WinSet, Style, +0x40000 , ahk_id %ID%
    WinMove, ahk_id %ID%,, oldX,oldY, oldW,oldH
    DllCall("LockWindowUpdate",UInt,0)
    fs_engaged:=0
}
WinSet, Redraw,,%ID%   ; optimization for Vista
         ; (not sure how this interacts with the new
         ; LockWindowUpdate calls...)

return

Ace_NoOne:
This is brilliant - I've long wanted something like this!
You should definitely submit this to Lifehacker.org, and of course cross-post the code at the AHK forums.

Thanks!

mouser:
ace and mackal,
so what's the verdict? does the ahk script work well yet?
when it's ready perhaps we can convince you to make a little .ahk/precompiled-exe zip file for easy download?

justice:
I would like to see an option for Always On Top, for example when I full screen my text editor and then bring up a search/replace window, that window spawns underneath the editor which is a pain :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version