Jump to content

Recommended Posts

Posted

Hello folks,

Wondering if anyone had worked on anything to dock a Auto it Gui as a Windows Sidebar Gadget? Searched Gadget, Widget and docking onsite nothing that really matches up to nice anyone have any theories?

[Cheeky]Comment[/Cheeky]
Posted (edited)

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
Posted (edited)

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
  • 1 month later...
Posted

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ë ë§§ëñ§ë øƒ !ïƒë.

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
×
×
  • Create New...