mIRC Home    About    Download    Register    News    Help

Print Thread
#139081 11/01/06 01:15 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Is it possible to get the window id of the currently active window? $wid only works when entering a command into the editbox.
I don't want to use $window($active).wid, as there can be multiple windows with the same name.

If you have any idea, please tell me =)

#139082 11/01/06 01:18 AM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
You might need to set a variable %wid as the active wid then perform a loop ...

Code:
  var %wid = $window($scid($activecid).active).wid


*shrugs*

Last edited by Jigsy; 11/01/06 01:21 AM.

What do you do at the end of the world? Are you busy? Will you save us?
#139083 11/01/06 01:40 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Unfortunately that doesn't work since it is basically the same as $window($active).wid frown

#139084 11/01/06 02:28 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What does it matter if the windows have the same name or not? $active returns the active window, irrelevant as to the window name

#139085 11/01/06 02:35 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Granted you have 2 windows called =greeny, and the second one of those is active.

If now you call $window($active).wid, it will only return the window ID for the first =greeny window, even though the second one is active.

I need it to return the correct window ID of the active window, which isn't possible it seems to me...

#139086 11/01/06 02:42 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Oh yeah, there's not even a possibility to activate the second dcc chat window it seems... as /window -a only works on the first window too.

#139087 11/01/06 02:48 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I don't think it's possible, and I think it is a design mistake that we can't know exactly which hwnd or wid the current window has.

There should be an $activewid or something.


Gone.
#139088 11/01/06 02:49 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
$active returns the name of the active window, and when you have multiple windows with the same name then you are basically screwed.

When you have 3 dcc chat windows with the same person, then all of them return =<nick> for $active, so when doing $window($active).wid, it transforms to $window(=<nick>), which will always return the first of those 3 windows, even though the actually active one may be the third.


Gone.
#139089 11/01/06 02:50 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Yeah... it's really a pity.

#139090 11/01/06 02:57 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I guess the only thing you could do is rename the dcc windows when one is initiated, putting an index in the name of the window, using a character in between the nick and the number that can't be part of a nick. You can use $window(=<nick><char>*,0) to distinguish between how many there are already with that nickname that you indexed to find the right number to add.

I know it's (very) crappy, but that's all I can think of. Besides coding a DLL perhaps.

I guess we could start by making it a feature suggestion, who knows, it might even be implemented in the next version.

EDIT: How's the RSS thing working out?


Gone.
#139091 11/01/06 03:10 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
The RSS reader is working great smile

#139092 11/01/06 08:04 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
This is really a real bad cludge, but assuming your script isnt overly concerned about anything else (lol)

in your script end it with...
editbox -an //getwid $!wid $1-

alias getwid {
var %wid = $1
tokenize 32 $2-
..carry on your code here..
}

There are other things to look ouit for of course like, now you have lost $nick & $active etc etc, but you got the $wid, well you could sort out all the other bits you need by passing them to the script as i passed $1-, but assign them to vars instead.

OK OK its a crappy solution, but it is a solution.

#139093 11/01/06 12:55 PM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
How about $chan(#).wid ?


What do you do at the end of the world? Are you busy? Will you save us?
#139094 11/01/06 03:46 PM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Quote:
This is really a real bad cludge, but assuming your script isnt overly concerned about anything else (lol)

in your script end it with...
editbox -an //getwid $!wid $1-

alias getwid {
var %wid = $1
tokenize 32 $2-
..carry on your code here..
}

There are other things to look ouit for of course like, now you have lost $nick & $active etc etc, but you got the $wid, well you could sort out all the other bits you need by passing them to the script as i passed $1-, but assign them to vars instead.

OK OK its a crappy solution, but it is a solution.


Hehe, I already had that Idea, but I was hoping there was a better solution...

#139095 11/01/06 03:46 PM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Quote:
How about $chan(#).wid ?

Channels are not the problem, it's mainly about DCCs.

#139096 11/01/06 04:28 PM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
$send(N/nick[,N]).wid & $chat(N/nick[,N]).wid

Little test I did:

$chat($me,0) -> 4
$chat($me,1).wid -> 20
$chat($me,2).wid -> 21
$chat($me,3).wid -> 22
$chat($me,4).wid -> 24

Last edited by Jigsy; 11/01/06 04:31 PM.

What do you do at the end of the world? Are you busy? Will you save us?
#139097 11/01/06 05:11 PM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
I know. That doesn't help me though, since I want to get the wid of the active window, not a list of wids or something.

#139098 18/02/06 07:14 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
This isn't mentioned in versions.txt or the help file but $wid now works from remote.

#139099 18/02/06 07:25 PM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Doesn't work for me ...

on *:open:=:{ echo -at $wid } just returns the connection id ...

Quote:

DCC Chat session
-
Client: JigsWithoutWoodstock (****)
Time: Sat Feb 18 19:24:39 2006
-
Acknowledging chat request...
[19:24:39] 2
DCC Chat connection established
-
[19:24:39] 2


What do you do at the end of the world? Are you busy? Will you save us?
#139100 18/02/06 07:32 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I didn't try it in an event but it works from the menubar..

Code:
menu menubar {
  Wid: echo -a $wid
}


Link Copied to Clipboard