YellowLab Posted November 18, 2008 Posted November 18, 2008 (edited) Doing a search I found this OLD (2006) topic:http://www.autoitscript.com/forum/index.php?showtopic=35748This is exactly what I am seeing - using version 3.2.12 and this code:$hMain=GuiCreate("Main",100,100,100,100) $hButton = GUICtrlCreateButton("Open",0,0,50,20) $hSecond=GUICreate("Second",50,50,125,125) $hSButton=GUICtrlCreateButton("Close",0,0,50,20) GUISetState(@SW_SHOW,$hMain) While 1 $nMSG = GUIGetMsg() Switch $nMSG Case -3 Exit Case $hButton GUISetState(@SW_DISABLE,$hMain) GUISetState(@SW_SHOW,$hSecond) Case $hSButton GUISetState(@SW_HIDE,$hSecond) GUISetState(@SW_ENABLE,$hMain) EndSwitch WEndmodifying it toCase $hSButton GUISetState(@SW_HIDE,$hSecond) GUISetState(@SW_ENABLE,$hMain) GUISetState(@SW_RESTORE,$hMain)causes the GUI to flicker - not so bad in this small example, but very noticeable in larger GUI's. Any ideas on how to fix it?Thanks,Bob Edited November 18, 2008 by YellowLab You can't see a rainbow without first experiencing the rain.
Zedna Posted November 19, 2008 Posted November 19, 2008 Look here at concept (unfortunatelly not working for me):#include <GUIConstants.au3> ;~ Const $SC_CLOSE = 0xF060 Const $MF_BYCOMMAND = 0x0 ;~ Const $MF_GRAYED = 0x1 ;~ Const $WM_SYSCOMMAND = 0x0112 $gui = GuiCreate("Catch the Minimize Click", 300, 100) GUISetState() GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND") $hMenu = DllCall("user32.dll", "hwnd", "GetSystemMenu", "hwnd", $gui, "int", 0) ;~ DllCall("user32.dll","hwnd","DeleteMenu", "hwnd", $hMenu[0], "int",$SC_MINIMIZE, "int", $MF_BYCOMMAND) DllCall("user32.dll","hwnd","EnableMenuItem", "hwnd", $hMenu[0], "int",$SC_MINIMIZE, "int", BitOr($MF_BYCOMMAND,$MF_GRAYED)) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd ; to disable minimize hotkeys Func On_WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) If BitAND($wParam, 0xFFF0) = $SC_MINIMIZE Then Return EndFuncoriginal post about "X button disable":http://www.autoitscript.com/forum/index.ph...st&p=423242 Resources UDF ResourcesEx UDF AutoIt Forum Search
rasim Posted November 19, 2008 Posted November 19, 2008 ellowLabStrange... I don't see any flickering
YellowLab Posted December 2, 2008 Author Posted December 2, 2008 Okay, so I figured it out - not so difficult really: $hMain=GuiCreate("Main",100,100,100,100) $hButton = GUICtrlCreateButton("Open",0,0,50,20) $hSecond=GUICreate("Second",50,50,125,125) $hSButton=GUICtrlCreateButton("Close",0,0,50,20) GUISetState(@SW_SHOW,$hMain) While 1 $nMSG = GUIGetMsg() Switch $nMSG Case -3 Exit Case $hButton GUISetState(@SW_DISABLE,$hMain) GUISetState(@SW_SHOW,$hSecond) Case $hSButton GUISetState(@SW_ENABLE,$hMain) GUISetState(@SW_HIDE,$hSecond) EndSwitch WEnd The first window must be enabled before the second window is hidden. Doing it this way makes everything good. Bob You can't see a rainbow without first experiencing the rain.
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