AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Putting a gui in the taskbar
Goto page Previous  1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Phoenix



Joined: 23 Sep 2005
Posts: 55

PostPosted: Thu Oct 20, 2005 3:57 am    Post subject: Reply with quote

Code:


CustomColor = EEAA99
Gui, +AlwaysOnTop +LastFound -caption
Gui, Color, %CustomColor%
WinSet, TransColor, %CustomColor% 255
Gui, Font,  S8 CDefault, Verdana


SoundGet, Wave_mute, Wave, mute
if wave_mute = Off
{
Gui, Add, Picture, vPic x5 y5 w10 h15,c:\autopics\muteoff.png
}
else
{
Gui, Add, Picture, vPic x5 y5 w10 h15,c:\autopics\muteon.png
}
Gui, Add, Slider, vSlid gSlid x15 y5 w66 h16, 25
Gui, Show, x1200 y1175 h30 w100, genbar

Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2485

PostPosted: Thu Oct 20, 2005 5:13 am    Post subject: Reply with quote

There are hopefully a few other methods to keep the GUI on top of the taskbar but one method could be to use a timer to keep setting it AlwaysOnTop.

Code:
CustomColor = EEAA99
Gui, +AlwaysOnTop +LastFound -caption
Gui, Color, %CustomColor%
WinSet, TransColor, %CustomColor% 255
Gui, Font,  S8 CDefault, Verdana


SoundGet, Wave_mute, Wave, mute
if wave_mute = Off
{
Gui, Add, Picture, vPic x5 y5 w10 h15,c:\autopics\muteoff.png
}
else
{
Gui, Add, Picture, vPic x5 y5 w10 h15,c:\autopics\muteon.png
}
Gui, Add, Slider, vSlid gSlid x15 y5 w66 h16, 25
Gui, Show, x1200 y1175 h30 w100, genbar
SetTimer, aot
Return

aot:
Winset, AlwaysOnTop, On, genbar
Return
Back to top
View user's profile Send private message Visit poster's website
Phoenix



Joined: 23 Sep 2005
Posts: 55

PostPosted: Thu Oct 20, 2005 11:03 am    Post subject: Reply with quote

corrupt wrote:
There are hopefully a few other methods to keep the GUI on top of the taskbar but one method could be to use a timer to keep setting it AlwaysOnTop.


It ain't pretty but it works. Thank you very much Smile
Back to top
View user's profile Send private message
Phoenix



Joined: 23 Sep 2005
Posts: 55

PostPosted: Thu Oct 20, 2005 5:44 pm    Post subject: Reply with quote

But this method has it flaws like it put itself over fullscreen applications like movieplaying so an other method would be better.
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2485

PostPosted: Fri Oct 21, 2005 4:15 am    Post subject: Reply with quote

One method might be to check the currently active app. and remove AlwaysOnTop if the app is running fullscreen...
Back to top
View user's profile Send private message Visit poster's website
Phoenix



Joined: 23 Sep 2005
Posts: 55

PostPosted: Fri Oct 21, 2005 6:39 am    Post subject: Reply with quote

corrupt wrote:
One method might be to check the currently active app. and remove AlwaysOnTop if the app is running fullscreen...


Yeah I actually did just that yesterday and it works good.
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Oct 21, 2005 3:20 pm    Post subject: Reply with quote

The other way around might be better: check if the taskbar is visible, then put the slider on top.
Back to top
View user's profile Send private message
Phoenix



Joined: 23 Sep 2005
Posts: 55

PostPosted: Wed Nov 02, 2005 4:25 pm    Post subject: Reply with quote

Laszlo wrote:
The other way around might be better: check if the taskbar is visible, then put the slider on top.


How do i check for that?
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Wed Nov 02, 2005 5:21 pm    Post subject: Reply with quote

You could verify if the working area is the full monitor:
Code:
SysGet Monitor,  Monitor
SysGet WorkArea, MonitorWorkArea
Sides = Bottom,Left,Right,Top
TaskBar = 0
Loop Parse, Sides, `,
   If (Monitor%A_LoopField% <> WorkArea%A_LoopField%)
      TaskBar = 1
MsgBox Visible Taskbar = %TaskBar%
But it only detects if the taskbar is hidden by AutoHide, not a screensaver or full screen video playback.
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Tue Nov 08, 2005 8:14 am    Post subject: Reply with quote

The right solution is here.
Back to top
View user's profile Send private message
shimanov



Joined: 25 Sep 2005
Posts: 610

PostPosted: Tue Nov 08, 2005 11:54 am    Post subject: Reply with quote

Try the following:

(this method has actually been used before by Rajat, and myself for a different purpose)

note: tested with Windows XP SP2
note: F12 will exit

Code:
g_x := A_ScreenWidth-65

Gui, -Caption
Gui, Add, Button, gSayHello, Hello
Gui, Show, x%g_x% y10

Process, Exist
WinGet, hw_gui, ID, ahk_class AutoHotkeyGUI ahk_pid %ErrorLevel%

hw_tray := DllCall( "FindWindowEx", "uint", 0, "uint", 0, "str", "Shell_TrayWnd", "uint", 0 )

DllCall( "SetParent", "uint", hw_gui, "uint", hw_tray )
return

F12::
GuiClose:
ExitApp

SayHello:
   MsgBox, Hello, World!
return
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Tue Nov 08, 2005 2:42 pm    Post subject: Reply with quote

What should it do? It does not seem to do anything in my system.
Back to top
View user's profile Send private message
shimanov



Joined: 25 Sep 2005
Posts: 610

PostPosted: Tue Nov 08, 2005 9:18 pm    Post subject: Reply with quote

Laszlo wrote:
What should it do? It does not seem to do anything in my system.


It should place a button ("Hello") on the right side of the Taskbar.

Try this simplified code:

(it should place the button covering the Start button)

Code:
Gui, -Caption
Gui, Add, Button, gSayHello, Hello
Gui, Show, x0 y0

Process, Exist
WinGet, hw_gui, ID, ahk_class AutoHotkeyGUI ahk_pid %ErrorLevel%

hw_tray := DllCall( "FindWindowEx", "uint", 0, "uint", 0, "str", "Shell_TrayWnd", "uint", 0 )

DllCall( "SetParent", "uint", hw_gui, "uint", hw_tray )
return

F12::
GuiClose:
ExitApp

SayHello:
   MsgBox, Hello, World!
return
Back to top
View user's profile Send private message
evl



Joined: 24 Aug 2005
Posts: 1237

PostPosted: Tue Nov 08, 2005 10:20 pm    Post subject: Reply with quote

I needed to change the y10 bit to y-8 as it was displaying mostly off screen in the very bottom right corner.

shimanov wrote:

Gui, Show, x%g_x% y10


Code:

Gui, Show, x%g_x% y-8
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Tue Nov 08, 2005 11:07 pm    Post subject: Reply with quote

Shimanov rocks! This last script allows me to simplify a few of my scripts, which put all kind of stuff in the taskbar with the help of a timer constantly reactivating them. Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group