 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jak
Joined: 28 Feb 2006 Posts: 116
|
Posted: Tue Aug 12, 2008 7:32 am Post subject: question on multiple gui's (how to destroy them selectively) |
|
|
my ahk script launches 2 gui's separately.
How do I destroy one of them without destroying the other?
I read the help file but I still have some questions as I couldnt find examples of usage.
so for instance,
^3::gui, show, volume
^4::gui, show, image
suppose both were activated (3, followed by 4) via their hotkeys and are on the screen.
Now, suppose I want ^5 to close 'image' but not 'volume'. Image was invoked second, volume was invoked first.
How do I specify that?
Do I say:
^5::gui +lastfound destroy
or "gui 2:destroy"?
or something else?
I also looked into giving each gui its own label....
help file says "for each gui other than the first, the window's number is used as a prefix for the label..." -- but what is the window's number? the order in which they were created? Is that always reliably knowable in a complex script with mulitple gui's? Is there a way to tell? Is it better to make a custom label? (and if so, again the help file wasnt very helpful, since it only mentions that the custom label becomes the new prefix for the special labels -- of which 'destroy' doesnt seem to be one).
Sorry for the nooby question, any help would be appreciated, thanks! |
|
| Back to top |
|
 |
Hezzu
Joined: 08 Aug 2008 Posts: 50 Location: Raahe, Finland
|
Posted: Tue Aug 12, 2008 7:50 am Post subject: |
|
|
As you make a script that uses 2 GUI:s
Example:
first gui
| Code: | Gui, add, button, x(number) y(number) w(number) h(number) gMYSUB, OK
Gui, Show, w(number) h(number), gui 1 name |
Second gui
| Code: | Gui 2:add, button, x(number) y(number) w(number) h(number) gMYSUB, OK
Gui 2:Show, w(number) h(number), gui 2 name |
You can destroy the second gui showing ok button by
And yes you can add a hotkey for that
I don't know if you quite asked for this but this is some sort of answer! _________________
If you want the baby but not the labour pain PM me (simple things only please) |
|
| Back to top |
|
 |
jak
Joined: 28 Feb 2006 Posts: 116
|
Posted: Tue Aug 12, 2008 8:21 am Post subject: |
|
|
hezzu - thanks, that helps a lot actually  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|