Jump to content

Making a GUI on the taskbar?


ludocus
 Share

Recommended Posts

Hi!

I'd like to know how to make a little window that sticks to the taskbar, like iTunes has.

I know how to do it with WinSetOnTop en then just position it on the taskbar.

But that's not really how I want it. I want it...well....just like iTunes has ;).

Thnx in advance :)

Link to comment
Share on other sites

Good luck! I asked this some time ago and got a response pointing to someone who had asked the same thing, can't find it right now, but the conclusion is that it's not easy.

I'd try _WinApi_SetParent().

#include<WinApi.au3>
#include<WindowsConstants.au3>

Global $hTaskbar = WinGetHandle("[CLASS:Shell_TrayWnd]")
Global $aTaskbarSize = WinGetPos("[CLASS:Shell_TrayWnd]")
Global $hNotifyTray = ControlGetHandle($hTaskbar, "", "[CLASS:TrayNotifyWnd; INSTANCE:1]")
Global $aNotifyTraySize = ControlGetPos($hTaskbar, "", $hNotifyTray)

Local $nMyWidth = 100

$hGUI = GUICreate("test", 100, $aTaskbarSize[3] - 4, $aTaskbarSize[2] - $aNotifyTraySize[2] - $nMyWidth - 20, 2, $WS_POPUP, $WS_EX_TOOLWINDOW)

$hBtn = GUICtrlCreateButton("X", $nMyWidth - 24, 2, 20, 20)

GUISetState()

_WinAPI_SetParent($hGUI, $hTaskbar)

While 1
    Switch GUIGetMsg()
        Case -3, $hBtn
            ExitLoop
    EndSwitch
WEnd
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...