mIRC Home    About    Download    Register    News    Help

Print Thread
taskbar size #159880 21/09/06 12:58 AM
Joined: Feb 2003
Posts: 143
N
naki Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Feb 2003
Posts: 143
is there a way you can get the size of the windows taskbar in pixels using mirc script?


We don't just write the scripts, we put them to the test! (ScriptBusters)
Re: taskbar size #159881 21/09/06 04:48 PM
Joined: Oct 2003
Posts: 214
S
Sephiroth_ Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
Only if mIRC is maximized (or use a transparent @window that pops up just for calculating)

$window(-1).h returns the screen height

lets start calculating wink

mIRC is maximized and $window(-2).h returns mIRCs height
$calc($window(-1).h - $window(-2).h) = your taskbar size blush

if your mIRC isn't maximized use something like this:
Code:
alias calctaskbarsize {
  if ($appstate == maximized) { return $calc($window(-1).h - $window(-2).h) }
  else {
    window -dnh @calctaskbarsize
    if ($istok(2K3 2K XP,$os,32)) { setlayer 0 @calctaskbarsize }
    window -x @calctaskbarsize
    var %s = $calc($window(-1).h - $window(@calctaskbarsize).h) 
    window -c @calctaskbarsize
    return %s
  }
}


one step closer to world domination
Re: taskbar size #159882 21/09/06 07:15 PM
Joined: Sep 2003
Posts: 261
S
Scorpwanna Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
I guess that's a no naki frown.

There is a flaw there, a typical start menu is 28 pixels high.
My screen resolution is 1024x768.

When I use $window(-1).h it returns 768
if I use $window(-2).h it returns 748
You say that that shows the height of mirc's window.

How could mirc be 748 if the taskbar is 28 itself and my screen height is 768?
768 - 748 = 20
Taskbar = 28

748 + 28 = 776

Taking a snapshot of the screen and using a good ole adobe program tells me that the true height of mirc window maximized is 740

Does that mean mirc is hiding 8 pixels height somewhere behind something?

Re: taskbar size #159883 21/09/06 07:53 PM
Joined: Sep 2003
Posts: 261
S
Scorpwanna Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
Look what I DID!

//echo -ag Taskbar starts from the top of the screen until the $taskbarstarts pixel.
Code:
alias taskbarstarts {
  window -Bdhk0 +dL @taskbarcalc $window(-1).w $window(-1).h 1 1
  window -o @taskbarcalc
  var %taskbarstarts = $calc($window(@taskbarcalc).y +1)
  window -c @taskbarcalc
  return %taskbarstarts 
}


Thanks Sephiroth_ smile

Re: taskbar size #159884 21/09/06 07:58 PM
Joined: Oct 2003
Posts: 214
S
Sephiroth_ Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
It depends also on the theme and so on... also if your taskbar is fixed or not (under XP)


one step closer to world domination
Re: taskbar size #159885 21/09/06 08:40 PM
Joined: Sep 2003
Posts: 261
S
Scorpwanna Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
Yeah, though ive tested what I made off of your example and it seems flawless smile. Thanks again. You pointed me in the right direction. mIRC can even be minimized or any shape and it works.