Jump to content

Gui, Gadget, Docking question


 Share

Recommended Posts

The main tasks to dock your GUI as a gadget is to use SystemParametersInfo with SPI_SETWORKAREA so maximizing another window won't be big as the entire screen hiding your gadget (or the taskbar for that matter). The rest is docking your window and disable it's default dragging support, title bar, etc..

Edit: Example:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global Const $SPI_SETWORKAREA = 47
Global Const $SPI_GETWORKAREA = 48

Local $tRcWA = DllStructCreate($tagRECT)
_WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tRcWA))

Local $iWidth = DllStructGetData($tRcWA, "Right")-DllStructGetData($tRcWA, "Left")
Local $iHeight = DllStructGetData($tRcWA, "Bottom")-DllStructGetData($tRcWA, "Top")
Local $hGUI = GUICreate("", 120, $iHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x101050)
WinSetTrans($hGUI, 0, 170)

Local $tRcNewWA = DllStructCreate($tagRECT)
DllStructSetData($tRcNewWA, 1, 120)
For $i = 2 To 4
    DllStructSetData($tRcNewWA, $i, DllStructGetData($tRcWA, $i))
Next
_WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($tRcNewWA), 2) ; SPIF_SENDCHANGE

GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

GUIDelete()
Exit


Func OnAutoItExit()
    _WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($tRcWA), 2) ; SPIF_SENDCHANGE
EndFunc
Edited by Authenticity
Link to comment
Share on other sites

Been there. Thats a whole new Windows docking system. Im just trying to write a add-on.

If you want a "sidebar" then I recommend the Appbar UDF (that's the method used in Franks Gadget), but if you want to build a gadget for Windows Sidebar you need to learn HTML, Javascript and shit. Guide here. Edited by AdmiralAlkex
Link to comment
Share on other sites

  • 1 month later...

The main tasks to dock your GUI as a gadget is to use SystemParametersInfo with SPI_SETWORKAREA so maximizing another window won't be big as the entire screen hiding your gadget (or the taskbar for that matter). The rest is docking your window and disable it's default dragging support, title bar, etc..

Edit: Example:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global Const $SPI_SETWORKAREA = 47
Global Const $SPI_GETWORKAREA = 48

Local $tRcWA = DllStructCreate($tagRECT)
_WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tRcWA))

Local $iWidth = DllStructGetData($tRcWA, "Right")-DllStructGetData($tRcWA, "Left")
Local $iHeight = DllStructGetData($tRcWA, "Bottom")-DllStructGetData($tRcWA, "Top")
Local $hGUI = GUICreate("", 120, $iHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x101050)
WinSetTrans($hGUI, 0, 170)

Local $tRcNewWA = DllStructCreate($tagRECT)
DllStructSetData($tRcNewWA, 1, 120)
For $i = 2 To 4
    DllStructSetData($tRcNewWA, $i, DllStructGetData($tRcWA, $i))
Next
_WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($tRcNewWA), 2) ; SPIF_SENDCHANGE

GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

GUIDelete()
Exit


Func OnAutoItExit()
    _WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($tRcWA), 2) ; SPIF_SENDCHANGE
EndFunc

Bravo, nice bit of example code there. Quick question, how does one get back the part of the desktop that the dock reserves. I had to force close it as it killed itself on my win7, and now that side of my desktop (left side) is kinda well empty, looks cool lol, but um, i'd like that space back :D

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

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...