AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Specify hwndVariableName in Gui, Show

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
bmcclure



Joined: 24 Nov 2007
Posts: 446

PostPosted: Sat Dec 22, 2007 9:29 pm    Post subject: Specify hwndVariableName in Gui, Show Reply with quote

It would be a real time- and code-saver if we could specify "hwndVariableName" in the Gui, Show options kind of like in the Gui, Add options. Only this time it would store the hwnd of the GUI window rather than the control being added. Is this a possibility?
_________________
-Ben

SteamLab
SteamLab Wiki

[Broken] - My industrial music [on GarageBand]
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Thu Dec 27, 2007 1:36 pm    Post subject: Reply with quote

I was thinking the same, but more like:

Code:
Gui, HWNDhGui


This way I don't need to show gui to be able to get its handle in single line.
This also comes good, compared to similar option for controls.
_________________
Back to top
View user's profile Send private message MSN Messenger
bmcclure



Joined: 24 Nov 2007
Posts: 446

PostPosted: Thu Dec 27, 2007 6:31 pm    Post subject: Reply with quote

I'd be perfectly happy with that as well Smile
_________________
-Ben

SteamLab
SteamLab Wiki

[Broken] - My industrial music [on GarageBand]
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Thu Dec 27, 2007 7:05 pm    Post subject: Reply with quote

As long as it does not conflict with the Hide option, it can still be made part of Gui, Show

Code:

Gui, Show, Hide HWNDVar

_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Fri Dec 28, 2007 2:19 am    Post subject: Re: Specify hwndVariableName in Gui, Show Reply with quote

Following not having to show the Gui...I suggested this a long time ago...(even before the hwnd option was in Gui, Add)...
...my syntax at that time was...

Code:
Gui, New[, Options]
Gui, New, vhwndmain
Gui, Add, Text, , This is my main window, boring ain't it?

Gui, New, vhwndoptions
Gui, Add, Text, , This is a window that would be spawned from main...it's the options window.

...using Gui, New, v as the option & hwndmain as the variable name...that's one thing I don't like about the current hwnd option I need to use it like...

Code:
Gui, Add, Text, hwndhwndtext, Text

...with the "hwnd" doubled cuz it's the option's name & part of the var name...I can't currently think of a solution to this...since hwnd is the only obvious option name & I like having hwnd as part of the var name...but in my Gui, New syntax I used v to assign a variable to the Gui, the same as assigning a variable to a control (& as I said hwnd didn't exist as an option anywhere yet)...

I'd also like to suggest some way to specify the outerwidth & outerheight...Gui, Show, w319 h119 does not give you a 319x119 window...so I always Gui, Show, Hide, then WinMove to set my Gui's size...but I'd like both...

Code:
Gui, Show, ow319 oh119 ;//o meaning outer

Gui, New, ow319 oh119 ;//o meaning outer

...or maybe...

Code:
Gui, Show, w319 h119 ;//default to outer
Gui, Show, cw319 ch119 ;//specify client coords

Gui, New, w319 h119 ;//default to outer
Gui, New, cw319 ch119 ;//specify client coords
Back to top
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Fri Dec 28, 2007 11:33 am    Post subject: Reply with quote

Quote:
As long as it does not conflict with the Hide option, it can still be made part of Gui, Show

NO!

That is not good, as it implies that gui must be shown to get its handle, which is usless.
_________________
Back to top
View user's profile Send private message MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5048
Location: imaginationland

PostPosted: Fri Dec 28, 2007 12:17 pm    Post subject: Reply with quote

How about Gui, +HwndMyVar
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Lexikos



Joined: 17 Oct 2006
Posts: 2540
Location: Australia, Qld

PostPosted: Fri Dec 28, 2007 2:33 pm    Post subject: Reply with quote

majkinetor wrote:
Quote:
As long as it does not conflict with the Hide option, it can still be made part of Gui, Show

NO!

That is not good, as it implies that gui must be shown to get its handle, which is usless.

It seems to me that engunneer was suggesting both could be implemented. It isn't always necessary to get the hwnd before showing the GUI.

Personally, I'm indifferent as to whether I must use
Code:
Gui, +LastFound
MyVar := WinExist()
or
Code:
Gui, +HwndMyVar
In some cases, +LastFound is better since the variable can be avoided altogether.

Speaking of time- and code-savers, the + is superfluous...
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Fri Dec 28, 2007 5:16 pm    Post subject: Reply with quote

I agree that this wish should be very low on priority list Smile
_________________
Back to top
View user's profile Send private message MSN Messenger
bmcclure



Joined: 24 Nov 2007
Posts: 446

PostPosted: Sat Dec 29, 2007 2:03 am    Post subject: Reply with quote

I think it should be a generic option that can either be used in Gui, Show's options, or as a Gui option itself on a separate command.

Like lexikos mentioned, it doesn't make a big difference from using the old method, except
1. If used with Gui, Show it would save two lines instead of one
2. It would be consistent with the functionality of GUI controls' hwnd option

Other than that, yeah, I think there should be much higher things on a priority scale.
_________________
-Ben

SteamLab
SteamLab Wiki

[Broken] - My industrial music [on GarageBand]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group