mIRC Home    About    Download    Register    News    Help

Topic Options
#139081 - 11/01/06 01:15 AM $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
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 =)

Top
#139082 - 11/01/06 01:18 AM Re: $wid
Jigsy Offline
Hoopy frood

Registered: 18/11/04
Posts: 798
Loc: I live inside your computer. S...
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*


Edited by Jigsy (11/01/06 01:21 AM)
_________________________
This signature is currently out of order. We apologize for the inconvenience.

Top
#139083 - 11/01/06 01:40 AM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
Posts: 230
Unfortunately that doesn't work since it is basically the same as $window($active).wid frown

Top
#139084 - 11/01/06 02:28 AM Re: $wid
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
What does it matter if the windows have the same name or not? $active returns the active window, irrelevant as to the window name

Top
#139085 - 11/01/06 02:35 AM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
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...

Top
#139086 - 11/01/06 02:42 AM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
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.

Top
#139087 - 11/01/06 02:48 AM Re: $wid
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#139088 - 11/01/06 02:49 AM Re: $wid
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
$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.

Top
#139089 - 11/01/06 02:50 AM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
Posts: 230
Yeah... it's really a pity.

Top
#139090 - 11/01/06 02:57 AM Re: $wid
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#139091 - 11/01/06 03:10 AM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
Posts: 230
The RSS reader is working great smile

Top
#139092 - 11/01/06 08:04 AM Re: $wid
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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.

Top
#139093 - 11/01/06 12:55 PM Re: $wid
Jigsy Offline
Hoopy frood

Registered: 18/11/04
Posts: 798
Loc: I live inside your computer. S...
How about $chan(#).wid ?
_________________________
This signature is currently out of order. We apologize for the inconvenience.

Top
#139094 - 11/01/06 03:46 PM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
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...

Top
#139095 - 11/01/06 03:46 PM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
Posts: 230
Quote:
How about $chan(#).wid ?

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

Top
#139096 - 11/01/06 04:28 PM Re: $wid
Jigsy Offline
Hoopy frood

Registered: 18/11/04
Posts: 798
Loc: I live inside your computer. S...
$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


Edited by Jigsy (11/01/06 04:31 PM)
_________________________
This signature is currently out of order. We apologize for the inconvenience.

Top
#139097 - 11/01/06 05:11 PM Re: $wid
greeny Offline
Fjord artisan

Registered: 09/12/02
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.

Top
#139098 - 18/02/06 07:14 PM Re: $wid
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
This isn't mentioned in versions.txt or the help file but $wid now works from remote.

Top
#139099 - 18/02/06 07:25 PM Re: $wid
Jigsy Offline
Hoopy frood

Registered: 18/11/04
Posts: 798
Loc: I live inside your computer. S...
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
_________________________
This signature is currently out of order. We apologize for the inconvenience.

Top
#139100 - 18/02/06 07:32 PM Re: $wid
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
I didn't try it in an event but it works from the menubar..

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

Top