PieMan Posted June 16, 2009 Share Posted June 16, 2009 Does anyone know how i can restric users from changing windows when my GUI is running? Thanks. Link to comment Share on other sites More sharing options...
martin Posted June 16, 2009 Share Posted June 16, 2009 (edited) Does anyone know how i can restric users from changing windows when my GUI is running? Thanks. You could create a gui but don't show it. Then get a list of all the windows you don't want anyone to use and set them to have the hidden gui as their parent. They will disappear of the face of the earth. You just have to make sure you set them back to their original parents before your script closes or they will all die when your script ends. There is an example here, and probably a few others could be found. Another way you could do it is to take a screen shot of the whole screen, and use that for the background image of a popup window that is also the size of the sccreen, disable the popup window maybe. Then run your gui and set that to be on top. Then the user can click on the other "windows" all he likes but it won't do anything. #include <ScreenCapture.au3> #include <guiconstantsEx.au3> #include <windowsconstants.au3> ; Capture full screen ;but don't capture mouse _ScreenCapture_Capture ("screen1.jpg", 0, 0, @DesktopWidth, @DesktopHeight, False) $fake = GUICreate("fake", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) $Img = GUICtrlCreatePic("screen1.jpg", 0, 0, @DesktopWidth, @DesktopHeight) ;show but without flickering WinSetTrans($fake, "", 0) GUISetState() WinSetTrans($fake, "", 255) ;now the gui which is in sole control $gui = GUICreate("real") GUISetState() WinSetOnTop($gui, "", 1) While GUIGetMsg() <> -3 If Not WinActive($gui) Then WinActivate($gui);Line A WEnd But this means the other windows won't be showing their correct states if these should change after your script starts, and maybe LineA is all you need. Edited June 16, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
PieMan Posted June 17, 2009 Author Share Posted June 17, 2009 Cheers for the Code Martin. Worked like a charm!!! 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