Burgaud Posted August 11, 2021 Share Posted August 11, 2021 I have: GUICtrlCreateEdit GUICtrlCreateInput GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateListView None are overlapped... When I click on any of the above Controls, I want Autoit to call a function and perform tasks based on where the user clicked. Currently, I am using GUIRegisterMsg($WM_COMMAND, "_LostFocus") func _LostFocus($hWnd, $Msg, $wParam, $lParam) local $nNotifyCode = BitShift($wParam, 16) local $nID = BitAND($wParam, 0x0000FFFF) .....if $nNotifyCode is 256, then $nID is the ControlID that has focus (or click) endfunc But it is not working properly when I clicked on tabs: $nID is not updated, and $nNotifyCode is 512... I could use $nNotifyCode = 512 to mean user clicked on tabs but I still need to know which tab help Link to comment Share on other sites More sharing options...
Developers Jos Posted August 11, 2021 Developers Share Posted August 11, 2021 Did you try using the GUIOnEventMode ? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Zedna Posted August 11, 2021 Share Posted August 11, 2021 In helpfile for GUICtrlCreateTabItem() is example for catching change of "active Tab": expandcollapse popup#include <GUIConstantsEx.au3> Example() Func Example() GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) Local $idTab = GUICtrlCreateTab(10, 10, 200, 100) GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon"); default Jon GUICtrlCreateButton("OK1", 80, 50, 50, 20) GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW); will be display first GUICtrlCreateLabel("label2", 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem(""); end tabitem definition GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20) GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop If $idMsg = $idTab Then ; display the clicked tab WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($idTab)) EndIf WEnd EndFunc ;==>Example Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Burgaud Posted August 13, 2021 Author Share Posted August 13, 2021 GUIOnEventMode 1 was more trouble. GUIRegisterMsg($WM_COMMAND, "_LostFocus") wont work. So I use default, comment it out. @Zedna's works though.... thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted August 14, 2021 Developers Share Posted August 14, 2021 10 hours ago, Burgaud said: GUIOnEventMode 1 was more trouble. Sounds like a "driver issue". sudeepjd 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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