mIRC Home    About    Download    Register    News    Help

Print Thread
#90847 17/07/04 10:11 PM
Joined: Jun 2003
Posts: 9
T
Theorem Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2003
Posts: 9
Hello there.

I have an on active event, and I need the handle/window id for the window that becomes active.
I've tried using $wid, but it seems that it always returns the ID for the Status Window.
I've also tried $window($active).wid, but then, there is the same old problem: what if there are two windows named the same?
Is there anyway of getting the wid/hwnd without having this problem?

Thanks.

#90848 18/07/04 09:20 AM
Joined: Jun 2004
Posts: 14
B
Pikka bird
Offline
Pikka bird
B
Joined: Jun 2004
Posts: 14
$window($active).hwnd will return the unique handle identifying that window regardless of other windows with the same name.

#90849 18/07/04 10:24 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I'm afraid there's no way around it.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#90850 18/07/04 10:47 AM
Joined: Jun 2003
Posts: 9
T
Theorem Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2003
Posts: 9
Yeah, but if you have two windows with the same name, you can't get the second's handle with that. it will always return the first one's.

#90851 18/07/04 11:09 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Actually in this case, you can get all handles by looping through $window(<name>,N).hwnd, but in the case of on ACTIVE, you can't tell which of the instances returned by $window($active,N) is the one that was activated.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#90852 18/07/04 04:17 PM
Joined: Jun 2003
Posts: 9
T
Theorem Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2003
Posts: 9
Yeah, my mistake.
Since there is no way around, I will probably subclass every single window, and use the WM_SETFOCUS event instead of the on active.


Link Copied to Clipboard