mIRC Homepage
Posted By: greeny $wid - 11/01/06 01:15 AM
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 =)
Posted By: Jigsy Re: $wid - 11/01/06 01:18 AM
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*
Posted By: greeny Re: $wid - 11/01/06 01:40 AM
Unfortunately that doesn't work since it is basically the same as $window($active).wid frown
Posted By: RusselB Re: $wid - 11/01/06 02:28 AM
What does it matter if the windows have the same name or not? $active returns the active window, irrelevant as to the window name
Posted By: greeny Re: $wid - 11/01/06 02:35 AM
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...
Posted By: greeny Re: $wid - 11/01/06 02:42 AM
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.
Posted By: FiberOPtics Re: $wid - 11/01/06 02:48 AM
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.
Posted By: FiberOPtics Re: $wid - 11/01/06 02:49 AM
$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.
Posted By: greeny Re: $wid - 11/01/06 02:50 AM
Yeah... it's really a pity.
Posted By: FiberOPtics Re: $wid - 11/01/06 02:57 AM
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?
Posted By: greeny Re: $wid - 11/01/06 03:10 AM
The RSS reader is working great smile
Posted By: DaveC Re: $wid - 11/01/06 08:04 AM
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.
Posted By: Jigsy Re: $wid - 11/01/06 12:55 PM
How about $chan(#).wid ?
Posted By: greeny Re: $wid - 11/01/06 03:46 PM
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...
Posted By: greeny Re: $wid - 11/01/06 03:46 PM
Quote:
How about $chan(#).wid ?

Channels are not the problem, it's mainly about DCCs.
Posted By: Jigsy Re: $wid - 11/01/06 04:28 PM
$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
Posted By: greeny Re: $wid - 11/01/06 05:11 PM
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.
Posted By: hixxy Re: $wid - 18/02/06 07:14 PM
This isn't mentioned in versions.txt or the help file but $wid now works from remote.
Posted By: Jigsy Re: $wid - 18/02/06 07:25 PM
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
Posted By: hixxy Re: $wid - 18/02/06 07:32 PM
I didn't try it in an event but it works from the menubar..

Code:
menu menubar {
  Wid: echo -a $wid
}
© mIRC Discussion Forums