Jump to content
Sign in to follow this  
gigi1

Force another application in windowed fullscreen mode.

Recommended Posts

gigi1

Hi,

i'm trying to make an application to transform existing windows into "windowed fullscreen".

For example, i want to achieve with other applications what can be done in autoit with this code:

GUICreate("asd", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetState()
Sleep(3000)

So far i've searched the forums and found the _WinApi_SetWindowLong() function, but if i do this:

$hwnd = WinGetHandle("[Class:Notepad]")
WinMove($hwnd, "", 0, 0, @DesktopWidth, @DesktopHeight)
_WinAPI_SetWindowLong($hwnd, $GWL_STYLE, $WS_POPUP)

then weird things will happen: Notepad will go in windowed fullscreen mode, but the taskbar will still be there, and the whole notepad window will be inactive. Moreover if you click somewhere in the notepad window the click will go below it (ex.: it will launch desktop applications if you happen to click where their icon is).

Any ideas on how to do it?

Thanks

Share this post


Link to post
Share on other sites
FireFox

@gigi1

You need to remove some styles which won't affect the program itself and update the window, see

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
gigi1

okay so i tested it and came up with this:

(assuming notepad is running)

#include <Constants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

$width = @DesktopWidth
$height = @DesktopHeight
$hWnd = WinGetHandle("[CLASS:Notepad]")
If @error Then MsgBox(0, "error", "error")
$iStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
$iStyle = BitOR($iStyle, $WS_POPUP)
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iStyle)
_WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, $width, $height, $SWP_FRAMECHANGED)

However, this doesn't change the window style at all.

Moreover, it will not place the window on top of the taskbar like the $WS_POPUP does for native autoit GUIs. (i know i could do it using the flag $HWND_TOPMOST instead of HWND_TOP, but then it's not possible to alt-tab to other applications).

edit: change from code to autoit code, didn't see it in the first place. code highlighting is nice :)

Edited by gigi1

Share this post


Link to post
Share on other sites
FireFox

#include <Constants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Local Const $hWnd = WinGetHandle("[CLASS:Notepad]")
If @error Then MsgBox(0, "error", "error")

Local $iStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)

$iStyle = BitOR(BitXOR($iStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_CAPTION, $WS_BORDER, $WS_SIZEBOX), $WS_POPUP)

_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iStyle)
_WinAPI_SetWindowPos($hWnd, $HWND_TOPMOST, 0, 0, @DesktopWidth, @DesktopHeight, $SWP_FRAMECHANGED)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
gigi1

thanks again, so simple, i feel so nab >_<

but... its not working for many applications, too, (example: windows media player) :(

I wanted to make my own window manager, but it seems that i won't be able to fullscreen a lot of applications, and many others just glitch on forced styles.

Edited by gigi1

Share this post


Link to post
Share on other sites
FireFox

it seems that i won't be able to fullscreen a lot of applications, and many others just glitch on forced styles.

You can, make a list of "non-wanted" styles and remove them only if they are present.

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.