How to make a GUI act like Rainmeter skin?

Get help with using AutoHotkey and its commands and hotkeys
capeably
Posts: 31
Joined: 10 Jul 2014, 14:38

How to make a GUI act like Rainmeter skin?

05 Feb 2015, 11:16

I'm wondering, is it possible to make an AutoHotkey GUI act like a Rainmeter skin, or a desktop widget?

Specifically:
1) always stays on bottom of all other windows
2) doesn't hide when you show desktop (Win+d)
3) doesn't show in taskbar
expert_vision
Posts: 21
Joined: 13 Jan 2014, 10:47

Re: How to make a GUI act like Rainmeter skin?

05 Feb 2015, 12:23

This complies with 2) and 3):

Code: Select all

Gui, Gadget:+ToolWindow
Gui, Gadget:Add, Text, , Gadget
Gui, Gadget:Show, w150 h50, Gadget window
Gui, Gadget:+LastFound
hGadgetGui := WinExist()
SetTimer, DesktopIntegration
return

DesktopIntegration:
WinGetClass, ahk_class, A
If (ahk_class == "WorkerW") and (LastClass != "WorkerW") ;and (LastClass != "AutoHotkeyGUI")
	WinActivate, % "ahk_id " . hGadgetGui
LastClass := ahk_class
return

GadgetGuiClose:
ExitApp
capeably
Posts: 31
Joined: 10 Jul 2014, 14:38

Re: How to make a GUI act like Rainmeter skin?

05 Feb 2015, 15:16

Thanks so much for the response!

My apologies, can you possibly explain a little bit about what the code is doing? I'm an AutoHotkey noob, so trying to learn about how the code works.

Particularly, what does the "Gadget:" part of the GUI code do? Is that window title?

My goal is to figure out how to adapt the following template to behave that way.

Thanks again!
Spoiler
Highlighting by Highlite
expert_vision
Posts: 21
Joined: 13 Jan 2014, 10:47

Re: How to make a GUI act like Rainmeter skin?

05 Feb 2015, 15:46

Gui, Gadget:+ToolWindow get's rid of the taskbar icon and gives a narrower title bar. Read GUI options.
DesktopIntegration: label activates the gadget window (brings it to the front) whenever the current active window class is "WorkerW" (desktop when you press Win+D)
Gadget: is the name I chose for the window label (not title). You don't have to use it if you have only one GUI. It's useful when you have multiple GUI windows. Then if you want to change a control in a particular window you use:
GuiControl, [window label]:[command], [control variable name], [param3]
capeably
Posts: 31
Joined: 10 Jul 2014, 14:38

Re: How to make a GUI act like Rainmeter skin?

05 Feb 2015, 15:57

Oh I see. Thanks so much for that explanation. Very cool!
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How to make a GUI act like Rainmeter skin?

06 Feb 2015, 03:24

Try to change the first line of the script
from

Code: Select all

Gui, Gadget:+ToolWindow
to

Code: Select all

Gui, Gadget:+ToolWindow AlwaysOnTop
Greetings.
Everything is possible!
just me
Posts: 7022
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: How to make a GUI act like Rainmeter skin?

06 Feb 2015, 04:32

Code: Select all

#NoEnv
#NoTrayIcon ; <<<<< if you want
SetTitleMatchMode, 2

; GUI style template coded by just me - http://www.autohotkey.com/board/topic/90723-achieve-rainmeter-style-gui-via-gdip-library/?p=573445
; posted to gui exaples by kon - http://ahkscript.org/boards/viewtopic.php?f=6&t=3851#p12351
HACTIVE := WinExist("A") ; <<<<< added
HOWNER := DllCall("GetShellWindow", "Ptr") ; <<<<< added
Width := 210
Gui, +LastFound +Owner%HOWNER% ; <<<<< changed
WinSet, Transparent, 220
Gui, Color, 808080
Gui, Margin, 0, 0
Gui, Font,, Verdana
Gui, Font, s12 cFFFFFF Bold
Gui, Add, Progress, % "x-1 y-1 w" (Width+2) " h31 Background8CC73E Disabled hwndHPROG"
Control, ExStyle, -0x20000, , ahk_id %HPROG% ; propably only needed on Win XP
Gui, Add, Text, % "x0 y0 w" Width " h30 BackgroundTrans Center 0x200 gGuiMove vCaption", Evernote Search Box
Gui, Font, s9 c808080
Gui, add, edit, % "x7 y+10 w" (Width-14) "r1 +0x4000 vTX1" varSearch
Gui, Font, s9 cFFFFFF Bold
Gui, Add, Text, % "x7 y+10 w" (Width-14) "r1 +0x4000 vTX2 gAllTitle", &1 Search Title: All Notebooks
Gui, Add, Text, % "x7 y+10 w" (Width-14) "r1 +0x4000 vTX3 gTagSearch", &2 All Notes Tagged...
Gui, Add, Text, % "x7 y+10 w" (Width-14) "r1 +0x4000 vTX4 gRecent", &3 Recent Notes (2d)
Gui, Add, Text, % "x7 y+10 w" (Width-14) "r1 +0x4000 vTX5 gRecent2", &4 Recent Notes (7d)
Gui, Add, Text, % "x7 y+13 w" (Width-14) "r1 +0x4000 vTX6 gClose", CLOSE
Gui, Add, Text, % "x7 y+10 w" (Width-14) "h5 vP"
GuiControlGet, P, Pos
H := PY + PH
Gui, -Caption
WinSet, Region, 0-0 w%Width% h%H% r6-6
Gui, Show, x0 y0, Evernote Search Box ; Position at top left of screen, Name Window Title ; <<<<< changed
WinActivate, ahk_id %HACTIVE% ; <<<<< added
; ...
; ...
; ...
Maybe?
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How to make a GUI act like Rainmeter skin?

06 Feb 2015, 04:58

@just me, very nice!
Everything is possible!

Return to “Ask For Help”

Who is online

Users browsing this forum: Auothokeysnoob, Bing [Bot], brotherS, calipsoive, Google [Bot], KiddoV, Rohwedder, Taurus, tobsto occupied, Yakshongas, ystin and 156 guests