erezlevi Posted May 1, 2008 Share Posted May 1, 2008 how can I lock a window so the user can't move it or close it? Link to comment Share on other sites More sharing options...
flip209 Posted May 1, 2008 Share Posted May 1, 2008 Look at WinSetState " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
erezlevi Posted May 1, 2008 Author Share Posted May 1, 2008 Look at WinSetStatehi,you can't lock a window with it only hiding it. Link to comment Share on other sites More sharing options...
flip209 Posted May 1, 2008 Share Posted May 1, 2008 (edited) winsetstate(Title,Text,@SW_DISABLE) Try that Edited May 1, 2008 by flip209 " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
erezlevi Posted May 1, 2008 Author Share Posted May 1, 2008 winsetstate(Title,Text,@SW_DISABLE)Try thatit does not lock the window in the screen it locks it from tuching it. Link to comment Share on other sites More sharing options...
FreeFry Posted May 2, 2008 Share Posted May 2, 2008 If the gui is owned by autoit, you can do this to lock it in place: #include <WinAPI.au3> #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 633, 447, 193, 125) Dim $origWindowPos = WinGetPos($Form1) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_WINDOWPOSCHANGING, "_WM_WINDOWPOSCHANGING") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_WINDOWPOSCHANGING($hWndGUI, $MsgID, $WParam, $LParam) Local $wPosStruct = DllStructCreate("hwnd hwnd;hwnd InsertAfter;int x;int y;int cx;int cy;uint flags", $LParam) DllStructSetData($wPosStruct, "x", $origWindowPos[0]) DllStructSetData($wPosStruct, "y", $origWindowPos[1]) DllStructSetData($wPosStruct, "cx", $origWindowPos[2]) DllStructSetData($wPosStruct, "cy", $origWindowPos[3]) EndFunc 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