jftuga Posted April 29, 2005 Share Posted April 29, 2005 My script is borderless by default. When I right click on it, I want the Style and StyleEx to change back to default -- that is, have a blue border and the minimize, maximize, and close buttons in the upper-right corner. In the OnToggleStyles function, GUICtrlSetStyle returns failure. I have tried the most recent stable version and the v3.1.1.18 beta. What am I doing wrong in my code? Thanks, -John #include <GUICONSTANTS.au3> #notrayicon Opt ("GUIOnEventMode", 1) Opt ("RunErrorsFatal", 0) $GUIStyle = $WS_POPUP $GUIStyleEx = BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST) $TopWin_Y = 615 $TopWin_Width=300 $TopWin = GUICreate("Bug", $TopWin_Width, 20, $TopWin_Y, 20, $GUIStyle, $GUIStyleEx) GUISetOnEvent( $GUI_EVENT_SECONDARYUP, "OnToggleStyles") GUISetOnEvent( $GUI_EVENT_PRIMARYUP, "OnExit") WinSetTrans($TopWin, "", 200) GUISetState() while 1 sleep(1000) wend Func OnToggleStyles() $rc = GUICtrlSetStyle( $TopWin, -1, -1 ) GUISetState() MsgBox(0,"Debug", "Toggle Style : " & $rc) endfunc Func OnExit() exit endfunc Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile Link to comment Share on other sites More sharing options...
jpm Posted April 29, 2005 Share Posted April 29, 2005 if you want to change the GUI window style you cannot use GUICtrlSetStyle which relates to a specific control. There is no specific GUI functions to change the GUI window style. Perhaps with some DLLcall. I don't remember if somebody did it already. Good search Link to comment Share on other sites More sharing options...
quaizywabbit Posted April 29, 2005 Share Posted April 29, 2005 if you want to change the GUI window style you cannot use GUICtrlSetStyle which relates to a specific control.There is no specific GUI functions to change the GUI window style.Perhaps with some DLLcall. I don't remember if somebody did it already.Good search <{POST_SNAPBACK}>I added _TargetSetStyle a couple days ago to "ANYGUI.au3" .(Scripts and Scraps)You'll need to use _GuiTarget first to 'Target' the window in question.......It will allow you to change both the Style and the ExStyle of the Targeted Window/Control....... [u]Do more with pre-existing apps![/u]ANYGUIv2.8 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