mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2004
Posts: 5
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: May 2004
Posts: 5
What would be the most effective/efficent way to get the Windows taskbar's (not mIRC's internal switchbar) size & position? confused

Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Code:
toffset {
  window -dhn +L @toffset $window(-1).w $window(-1).h 0 0
  var %y = $calc($window(-1).w - $window(@toffset).x) $calc($window(-1).h - $window(@toffset).y)
  close -@ @toffset
  return %y
}

$toffset returns the x/y offset you need when you want to place a window in the lower right corner of your screen, but above/beside the taskbar.
I'm using this alias for my custom balloon tips. Works fine.
I guess it can easily be extended for other screen corners.
Hope this helps.
smile

Edit: I might add this is the only way I know of to get the taskbar position/offset... if you know of another, better way let me know smile

Last edited by greeny; 12/05/04 03:35 PM.
Joined: May 2004
Posts: 5
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: May 2004
Posts: 5
I had tried something very similar to this, but my way was extremely messy & largely ineffective. This worked great tho! grin

Thanks a mill!!

Slimmed the code down a little, seems to work just as good w/o the variable lines. Thanks again, greeny!
Code:
alias toffset {
  window -dhn @toffset $window(-1).w $window(-1).h 0 0
  .timer -m 1 1 close -@ @toffset
  return $calc($window(-1).w - $window(@toffset).x) $calc($window(-1).h - $window(@toffset).y)
}

Last edited by metalkool; 12/05/04 04:44 PM.
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Use "timer 1 0" - then it'll execute when the script has finished, instead of you having to specify a time.
smile

Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
No problem!
Your right, your smaller code works just as well, my personal preference is to avoid timers though, so forgive me wink


Link Copied to Clipboard