Показать полную графическую версию : [решено] GUICtrlCreateContextMenu - вернуть состояние графы.
FlatX007
14-03-2010, 17:28
Как мне вернуть состояние графы контекстного меню (отмечена галкой или нет). GUICtrlGetState - что то не фунциклирует :(
GUICtrlGetState - что то не фунциклирует »
Оно для элементов GUI, а для меню используется GUICtrlRead:
#include <GUIConstantsEx.au3>
$hGUI = GUICreate (http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm)("Test Script", 300, 200)
$Menu = GUICtrlCreateContextMenu (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateContextMenu.htm)()
$Check_Item = GUICtrlCreateMenuItem (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateMenuItem.htm)("Check", $Menu)
GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)(@SW_SHOW (http://www.autoitscript.com/autoit3/docs/macros.htm#@SW_SHOW), $hGUI)
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) GUIGetMsg (http://www.autoitscript.com/autoit3/docs/functions/GUIGetMsg.htm)()
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $GUI_EVENT_CLOSE
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $Check_Item
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) BitAND (http://www.autoitscript.com/autoit3/docs/functions/BitAND.htm)(GUICtrlRead (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlRead.htm)($Check_Item), $GUI_CHECKED) = $GUI_CHECKED Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
GUICtrlSetState (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetState.htm)($Check_Item, $GUI_UNCHECKED)
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
GUICtrlSetState (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetState.htm)($Check_Item, $GUI_CHECKED)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.