ning Posted December 19, 2005 Share Posted December 19, 2005 I've created a window with the $WS_POPUP style. Later on in the script, I want to change it to a normal window with a title and a resizable border. Can I do this programmatically or do I have to destroy the window and create it again? cheers ben Link to comment Share on other sites More sharing options...
BigDod Posted December 19, 2005 Share Posted December 19, 2005 (edited) I've created a window with the $WS_POPUP style. Later on in the script, I want to change it to a normal window with a title and a resizable border. Can I do this programmatically or do I have to destroy the window and create it again?cheersbenI could be talking crap as I have not tried anything but what about GUICtrlSetStyleEditI have searched the forums and come up with This topic for you. Edited December 19, 2005 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
ning Posted December 20, 2005 Author Share Posted December 20, 2005 That's brilliant - thanks for doing that search for me. I made the naive mistake of thinking it was a unique problem that nobody had tried to tackle before. oops.So I've had a look at AnyGUI, and used it to produce this simple fullscreen toggler script, attached below.#include "ANYGUIv2.6.au3" #include <Array.au3> $hwnd = GUICreate ("Window", 200, 200, -1, -1, BitOR ($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)) GUISetState (@SW_SHOW) $fullscreen = False $coords = WinGetPos ($hwnd) HotKeySet ("f", "SetPopupStyle") Do $msg = GUIGetMsg () Until $msg = $GUI_EVENT_CLOSE Func SetPopupStyle () ConsoleWrite ("changing" & @LF) _TargetStyle ("toggle", 1, BitOR ($WS_CAPTION, $WS_SIZEBOX), -1, $hwnd) $fullscreen = Not $fullscreen If $fullscreen Then $coords = WinGetPos ($hwnd) WinMove ($hwnd, "", 0, 0, @DesktopWidth, @DesktopHeight) Else WinMove ($hwnd, "", $coords[0], $coords[1], $coords[2], $coords[3]) EndIf EndFuncPress 'f' to toggle fullscreen on/off. It remembers the position too. Thanks BigDod & Quaizywabbit!ben Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now