Hi All,
I am wondering if it is possible to use a second script to modify a GUI thats generated in the first script. I have had no luck so far but just wondering if, generally, this is possible.
Thanks.
Using Second Script to Modify GUI in First Script
-
- Posts: 343
- Joined: 08 Jun 2019, 17:36
Re: Using Second Script to Modify GUI in First Script
You should be able to modify GUI elements on a second script but you won't be able to use the variable names made in script 1's gui when trying to modify them in script 2.
Instead you will have to use windows spy to get ClassNN/Control texts and use ControlGet and Control to manipulate them.
https://www.autohotkey.com/docs/commands/ControlGet.htm
https://www.autohotkey.com/docs/commands/Control.htm
Instead you will have to use windows spy to get ClassNN/Control texts and use ControlGet and Control to manipulate them.
https://www.autohotkey.com/docs/commands/ControlGet.htm
https://www.autohotkey.com/docs/commands/Control.htm
Re: Using Second Script to Modify GUI in First Script
Thank you for your suggestion!doubledave22 wrote: ↑21 Jun 2021, 15:41You should be able to modify GUI elements on a second script but you won't be able to use the variable names made in script 1's gui when trying to modify them in script 2.
Instead you will have to use windows spy to get ClassNN/Control texts and use ControlGet and Control to manipulate them.
https://www.autohotkey.com/docs/commands/ControlGet.htm
https://www.autohotkey.com/docs/commands/Control.htm
I am trying to use the imagebutton class to change the color of the gui generated in the first script. I am able to get HWND using ControlGet but I can't use the imagebutton class to change the color.
-
- Posts: 343
- Joined: 08 Jun 2019, 17:36
Re: Using Second Script to Modify GUI in First Script
If you want to call functions in script 1 from script 2 the best approach is probably ObjRegisterActive:
https://www.autohotkey.com/boards/viewtopic.php?t=6148
I only scratched the surface when using it. The example Lexikos posted should get you started.
Is there any reason you can't change this value from script 1? Maybe there's a simpler solution.
https://www.autohotkey.com/boards/viewtopic.php?t=6148
I only scratched the surface when using it. The example Lexikos posted should get you started.
Is there any reason you can't change this value from script 1? Maybe there's a simpler solution.
Re: Using Second Script to Modify GUI in First Script
doubledave22 wrote: ↑21 Jun 2021, 16:58If you want to call functions in script 1 from script 2 the best approach is probably ObjRegisterActive:
https://www.autohotkey.com/boards/viewtopic.php?t=6148
I only scratched the surface when using it. The example Lexikos posted should get you started.
Is there any reason you can't change this value from script 1? Maybe there's a simpler solution.
Sure, I am using a setimer routine to check whether a value in a sqlserver db has changed. Ive noticed using a settimer in my main script seems to cause me problems.
-
- Posts: 343
- Joined: 08 Jun 2019, 17:36
Re: Using Second Script to Modify GUI in First Script
I would suggest trying to narrow down the relevant code in your sqlserver timer thats causing problems and try to get help on that. I'm not sure I'll be of help but others may know more if you can post a trimmed down version and describe your problem.
always best to solve the core issue rather than find some elaborate workaround (unless it's truly your only choice)
always best to solve the core issue rather than find some elaborate workaround (unless it's truly your only choice)
Who is online
Users browsing this forum: ulysim and 312 guests