Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 01, 2015, 03:01:08 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: tool to fullscreen (not just maximize) any application?  (Read 12957 times)

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
tool to fullscreen (not just maximize) any application?
« on: May 15, 2007, 11:27:05 AM »
Hello,

I would love to find out if any of you readers knows of a tool which can fullscreen any arbitrary application.  By that I mean that it maximizes an app to the point where only the window's client area is visible, with the window's caption/title/border and the Windows taskbar being hidden or off-screen.  My main desire for this is to turn a number of my favourite apps into distraction free tools, especially my favourite editor (Vim), much like the recently reviewed Dark Room and Writer tools.  BTW, I'm running on WindowsXP.  I know there are some nice solutions under Linux (a number of window managers support this directly) and probably Mac too...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,967
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #1 on: May 15, 2007, 12:21:21 PM »
i think this is a great idea.. i wonder if it can be done..  any ahk peeps want to try?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #2 on: May 15, 2007, 08:22:52 PM »
 :) Try Fullscreen at http://www.fanix.com/fullscreen.html. Shareware, sluggish on Vista, but unlike anything else.

Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #3 on: May 15, 2007, 09:19:25 PM »
:) Try Fullscreen at http://www.fanix.com/fullscreen.html. Shareware, sluggish on Vista, but unlike anything else.

Skrommel
Not bad (good find! my Googling did not turn it up), but a bit pricy for such a simple function.  The project looks totally "doable" in AutoHotKey... that's probably the way I'll go, although I am currently a complete AHK noob (well, an AHK keyboard remap for a single game doesn't really count).  Can any AHK pros here offer any suggestions on how to go about it? (BTW, I love GridMove!  For the first time it made me realized the full power of AHK...)  I fielded a similar question on the AHK forums, but if the local experts can offer anything beyond that, by all means, I need all the help I can get!  ;)

Here's the AHK forum thread:
  http://www.autohotke...28e2504acfe9bedf78a2

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #4 on: May 15, 2007, 11:04:40 PM »
Neat, AHK rules!  :Thmbsup:  Tossed this little thing up, based on input from AHK forum:

Code: [Select]
fs_engaged := 0 ; is "fullscreen" engaged for some window?
padding := 2 ; additional padding width to remove, in pixels

#f::
if (fs_engaged = 0) {
    ID:=WinActive("A")
    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

    fs_engaged:=1
} else {
    ;; reverse all the operations performed above
    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
    fs_engaged:=0
}
return

This works perfectly for my purposes.  Fullscreens currently active app on Win-F keypress, unless one has already been fullscreened earlier, in which case it restores the old window dimensions.  Any AHK stylistic/efficiency remarks quite welcome though... it's my first nontrivial script...

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #5 on: May 16, 2007, 01:43:28 AM »
 :tellme: Oh no, Fullscreen is not simple! Try starting Outlook Express and Alt-LeftClick in the message window. Now the message window fills the screen, but if you move the mouse to any screen edge, that hidden part is automatically revealed! It's just amazing!

But your script is very useful, and very impressive for an AHK noob!

Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #6 on: May 16, 2007, 03:22:53 AM »
Hey great script: comments with a dual monitor setup:
  • fullcreen app always goes to screen 1: feature or bug? you decide
  • I see a pixel or two on screen 2 (right border) edit: ahh one of the two variables (padding to 0 solves it  :Thmbsup:
  • add WinSet, Redraw,,%ID% before end of subroutine to prevent screen redrawing options on vista!

refreshfix sourcecode
Code: [Select]
fs_engaged := 0 ; is "fullscreen" engaged for some window?
padding := 0 ; additional padding width to remove, in pixels

#f::
if (fs_engaged = 0) {
    ID:=WinActive("A")
    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

    fs_engaged:=1
} else {
    ;; reverse all the operations performed above
    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
    fs_engaged:=0
}
WinSet, Redraw,,%ID%
return

« Last Edit: May 16, 2007, 03:29:03 AM by justice »

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #7 on: May 16, 2007, 09:03:44 AM »
:tellme: Oh no, Fullscreen is not simple! Try starting Outlook Express and Alt-LeftClick in the message window. Now the message window fills the screen, but if you move the mouse to any screen edge, that hidden part is automatically revealed! It's just amazing!

Sorry, that came out wrong: I meant that the functionality of it that I needed (i.e., just a simple fullscreen) is what was simple.  Clearly the Fullscreen app you mentioned can do tons more.  In my case I am fairly sure I wouldn't end up using the rest of the features in the long term... (I am finding I am most productive with my tools when I K.I.S.S. [Keep It Simple, Stupid].)

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #8 on: May 16, 2007, 09:16:31 AM »
  • fullcreen app always goes to screen 1: feature or bug? you decide
  • I see a pixel or two on screen 2 (right border) edit: ahh one of the two variables (padding to 0 solves it  :Thmbsup:
  • add WinSet, Redraw,,%ID% before end of subroutine to prevent screen redrawing options on vista!

Yes, I totally ignored multi-monitor setup in that script, mostly because I don't use one most of the time.  It also made the script simple; with a multi-monitor setup where you potentially can have a fullscreened app on each monitor, you're going to have to get more fancy: not only do you have to memorize which app is fullscreened on which screen, but you also have to work out what an un-fullscreen keystroke is to do (i.e., there are a number of "logical" ways to interpret such a keystroke then).

Interesting about "padding".  I used it to eliminate some extra "glare" around the screen border... if I set padding=0 and fullscreen a dark background window, then the around the edge of the screen I'll get a bright outline 1- or 2-pixels wide.  Hence "padding=2", which actually I meant to call "anti-padding".  But if you say that this causes the window to stick out onto the next screen, then... I see, I guess just stripping the window border and titlebar leaves the window's client area still in some sort of container window which shows through by 1- or 2-pixels around the client area.  I wonder what a clean way of getting rid of that would be.  That extra border is annoying, especially considering that the whole point of fullscreening the app, at least for me, is to eliminate any visually distracting elements...

I'll have to look up that Redraw bit you mentioned.  I'm running on WinXP SP2, hence haven't run into the issue.  Actually, speaking of redraws, I wish there was a way to tell AHK/Windows to "freeze" the window display untill all the operations (stripping of window parts, moving, resizing) are done, to avoid the "repainting"/flashing effect that such a quick succession of operations produces...

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #9 on: May 16, 2007, 01:31:33 PM »
 :) 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
Code: [Select]
hwnd:=WinExist("A")
DllCall("SetWindowRedraw",UInt,hwnd,UInt,1)
Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
« Last Edit: May 16, 2007, 02:07:09 PM by skrommel »

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #10 on: May 16, 2007, 03:24:40 PM »
:) 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
Code: [Select]
hwnd:=WinExist("A")
DllCall("SetWindowRedraw",UInt,hwnd,UInt,1)
Skrommel

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

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #11 on: May 16, 2007, 03:51:18 PM »
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.microso...ibrary/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:
Spoiler
fs_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

« Last Edit: May 17, 2007, 12:00:09 PM by mackal »

Ace_NoOne

  • Participant
  • Joined in 2005
  • *
  • gravatar avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #12 on: May 26, 2007, 01:22:05 AM »
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

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,967
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #13 on: May 26, 2007, 10:25:36 AM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #14 on: May 26, 2007, 11:29:50 AM »
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 :)

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #15 on: May 27, 2007, 07:16:07 PM »
 :) You can easily add a loop to find the children of the maximized window, and putting them on top, too.

Try
Code: [Select]
WinGet,list,List,ahk_id hwnd and
Code: [Select]
DllCall("GetParent",UInt,hwnd)
Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

mackal

  • Member
  • Joined in 2007
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #16 on: May 27, 2007, 10:16:37 PM »
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?

Well, it works well enough for me, although I've encountered the same problem as Justice, and was wondering how to implement options; but skrommel's solution sounds pretty good, I will try it out.  Other than that, I don't think I'll be babying/tweaking this script further, since it meets > 95% of my requirements.  I can put out an .ahk, but not sure how to convert to .exe...

Ace_NoOne

  • Participant
  • Joined in 2005
  • *
  • gravatar avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #17 on: May 28, 2007, 01:22:43 AM »
Well, it works well enough for me
Same here - at least so far...

was wondering how to implement options
IniRead is very simple to implement. (I guess a proper options dialog would be overkill here; directly editing the INI file should be easy enough.)

I can put out an .ahk, but not sure how to convert to .exe...
Use ...\AutoHotkey\Compiler\Ahk2Exe.exe; you can even set a custom icon there...

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #18 on: May 29, 2007, 02:45:46 AM »
sometimes i use this utility called FreeSnap to do exactly that.. :)

ws-freesnap-1.png

P.S. also mentioned here


justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #19 on: May 29, 2007, 02:48:20 AM »
Ah thanks lanux128! That's a good tool in the arsenal of a webdeveloper!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #20 on: May 29, 2007, 02:53:05 AM »
you're welcome, justice.. just sharing one of my collection of tools.. :)

@thehop

  • Participant
  • Joined in 2005
  • *
  • Posts: 17
    • View Profile
    • Donate to Member
Re: tool to fullscreen (not just maximize) any application?
« Reply #21 on: August 13, 2007, 09:38:02 AM »
Hello all,

I made a similar request for bordeless Application Windows in following Thread
http://www.donationc...p?topic=9399.new#new

A german User named "Icfu" in another Forum compiled a AHK Script to a Fullscreen.exe

Quote
Ich habe das Script ein wenig erweitert.
1. Es wird zusätzlich nun auch die Menüleiste entfernt.
2. Der Menü- und Maximierungsstatus aller Fenster wird in einer temporären Datei (Scriptname.ahk.tmp im Arbeitsverzeichnis) gesichert und nach dem Verlassen der Vollansicht wiederhergestellt.
3. Strg+F11 als Shortcut: keine Kollision mit programmeigener Vollschirmfunktion und gut zu merken.

Kompilierte Exe+Source:
http://icfu.totalcmd...s/AHK_FullScreen.zip


BTW: I'm looking for a Tool that makes Borderless, rimless, menueless Application-Windows (to show only the Window-Content)