Jump to content

Any suggestions how to use GUIRegisterMsg to register on more then one wm_command within a script


Recommended Posts

Hi, I am new to autoit. The forum is an awesome place to get help but unfortunately, I can not find the answer to his one. If there is anyone out there that can point me in the right direction, I will very appreciate your help.

Problem: I am using 1 tab control and I have 3 tabsheets that consists of 3 scripts. Each script uses the wm_command. I have 1 separate wm_command for each script to function properly. When I try to use the GUIRegisterMsg function to register the 3 wm_command, only 1 wm_command will register and work?

I tried to combine all 3 scripts to use one wm_command but it won't work becuase I need a handle from each object from each different tabsheet. I can't get it to work.

I thought of using the tab focus option but again, that I will need a wm_command to detect that and register that wm_command.

GUIRegisterMsg($WM_COMMAND, "TAB_WM_NOTIFY") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_COMMAND, "PING_WM_COMMAND")   ;-----------------Shortcut------------------- _Startup() ;------------------Pingtoolkit--------------- _Load_Store() ;_AutoLoad() ;-------------------------------------------- ;While 1 ;Sleep(25) ;If $DoubleClicked Then _ListDoubleClick() ;WEnd
Link to comment
Share on other sites

You can't register 3 different functions to the same GUI window/object. You can however call 2 more functions within the registered function determined by your algorithm. My personal opinion says it's not a good approach, either combine your 3 scripts to 1 compound script with named variable for each tab with each one's own control named as well... or use on event mode if more appropriate.

Edited by Authenticity
Link to comment
Share on other sites

Hi, thank you for the response. Can you please give me a link or a sample of what you suggested or similar. "combine your 3 scripts to 1 compound script with named variable for each tab with each one's own control named as well... or use on event mode if more appropriate."

Assuming you didn't mention about unregistering a function, i guess u can't do that either. Again thank you..

Link to comment
Share on other sites

I have no link, you can search your self if you want. Merging the scripts should not be complex task if all scripts just create their tab content on the main window, if I understand right. Look at the GUICtrlCreateTab() or GUICtrlCreateTabItem() functions' script example. It shouldn't be harder then that.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...