Hi, I have my main PP bar set to auto hide, show on screen bump, and 
I wanted my SystemMeter to do the same thing.  SystemMeter is on the 
same screen edge as the PP bar.  At first I thought it would be 
easy.  First I changed from *Bar Show TheMainBar to a script that had 
Bar.Show("TheMainBar") in the first line and SystemMeter.showhide in 
the second.  Everything works like I want, except for SystemMeter 
disappearing when I move my mouse off the bar.  So I wrote this 
script and set it to run from the Monitor list:

local barVisible
local meterVisible

barVisible = win.visible("TheMainBar")
meterVisible = win.visible("PowerPro SystemMeter Plugin")

if (barVisible == 0 && meterVisible == 1) do
        SystemMeter.showhide
endif

It works perfectly, except...  Normally I use TweakUI "Focus Follows 
Mouse" (W2K SP4), and unless I move my mouse after the PP bar appears 
(thus giving focus to the bar), when the script runs, the mouse 
cursor moves back to the last app that had focus, thus causing the 
bar (and SystemMeter) to disappear.  So I turned of "Focus Follows 
Mouse".  Now, when I switch virtual desktops, if I don't click on a 
window on the new desktop before the script runs again, focus goes 
back to the last app that had it, thus switching my current virtual 
desktop back to the previous one.  It seems like it is doing 
something like this: Before a script is going to be run, determine 
which window has focus and remember it.  Then run the script and give 
it focus in some hidden window.  Then when the script is done, give 
focus back to the window that had it before.  I thought that maybe 
the win.visible was what was causing the focus switching problem, so 
I tried passing it a window handle instead, in hopes that with a 
window handle for visible (instead of a caption list) the script 
wouldn't take focus.  I did it like this:  

local barHandle
local meterHandle
local barVisible
local meterVisible

barHandle = win.handle("TheMainBar")
meterHandle = win.handle("PowerPro SystemMeter Plugin")

barVisible = win.visible(barHandle)
meterVisible = win.visible(meterHandle)

if (barVisible == 0 && meterVisible == 1) do
        SystemMeter.showhide
endif

It didn't change behavior at all.  I looked into using 
HookWindowEvents, hoping to hook the bar disappearing, but the bar 
disappearing isn't destroying a window.  All that shows up to the 
hook is the activation of the bar.  Does anyone have any other ideas 
I could try?  

As an aside, everything in SystemMeter works, except the CPU meter, 
it always shows 0.  Does anyone have any ideas on why this would be?  
Thank you very much!  

Brian Cunningham



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to