Computer info gui (Like BGINFO / RAINMETER) issue

Get help with using AutoHotkey and its commands and hotkeys
frodd
Posts: 2
Joined: 20 Feb 2017, 11:11

Computer info gui (Like BGINFO / RAINMETER) issue

20 Feb 2017, 11:27

Hello!

A long while back i tried to create this BGinfo style of macro with the help of these forums i got quite far but i got stuck on a very specific issue (small but needs to be fixed)
i got everything to work just fine but the issue is that if i "win + d" or press the "show desktop" button next to the clock it disappears. Believe me when i tell you this , i have tried to find a solution for this


I think i copied most of the code from another thread that i don't remember by now, its a mess i know.

Code: Select all

;#notrayicon 
#SingleInstance, Force

Coordmode,Mouse,Relative

;To autostart with windows (optional); RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion

\Run, Gadget IP, %A_ScriptFullPath%

CustomColor = AAAA99  ; Can be any RGB color (it will be made transparent below).
CustomColor2 = AAFF99  ; Second GUIs backgrund RGB color (it will be made semi transparent below).

Gui, 2: -Caption +ToolWindow
Gui, 2: Color, %CustomColor2%

Gui, 1: -Caption  +toolwindow ; "-caption" wont show the button bar
Gui, 1: Color, %CustomColor%
Gui, 1: +LastFound

Gui, 1: font, s11.5 cFFFFFF, Segoe UI
Gui, 1: Add, Text, x2 y0,  COMPUTER INFORMATION
Gui, 1: font, s8.5 cFFFFFF, Segoe UI

Gui, 1: Add, Text, x2 y26 gUSR,  IP Address:
Gui, 1: Add, Text, x100 y26 gLAN,  %A_IPAddress1%

Gui, 1: Add, Text, x2 y47 gUSR,  Nodename:
Gui, 1: Add, Text, x100 y47 gWAN,  %Computername%

Gui, 1: Add, Text, x2 y68 gUSR,  UserID:
Gui, 1: Add, Text, x100 y68 gUSR,  %A_UserName% 




hGadgetGui := WinExist()

WinSet, TransColor, %CustomColor% ; Make all pixels of this color transparent in the first GUI
Gui, 2: +LastFound
WinSet, Transparent, 150 ; makes all of the Second Gui semi transparent

SetTimer, UpdateOSD, 200
Gosub, UpdateOSD  ; Make the first update immediate rather than waiting for the timer.



Gui, 2: Show, % "x" A_ScreenWidth - 199 "y" A_Screenheight - 130 " w" 200 NoActivate  ; NoActivate avoids deactivating the 

currently active window.



Gui, 1: Show, % "x" A_ScreenWidth - 199 "y" A_Screenheight - 130 " w" 200 NoActivate, gadget window
Return
Gui, 1: +LastFound
WinGetClass, ahk_class, A
If (ahk_class == "WorkerW") and (LastClass != "WorkerW") ;and (LastClass != "AutoHotkeyGUI")
	WinActivate, % "ahk_id " . hGadgetGui
LastClass := ahk_class


UpdateOSD:
MouseGetPos, MouseX, MouseY
GuiControl,, MyText, X%MouseX%, Y%MouseY%
Gui, 1: +LastFound

return

 
GuiClose:
ExitApp

close:
ExitApp

Refresh:
Reload
Return

Call:
Reload
Return

WAN:
clipboard = %Computername%
Return

LAN:
clipboard = %A_IPAdress1% ; Clicking the ip will copy it.
Return

USR:
clipboard = %A_UserName%
Return

^!r::Reload
I have tried with "solutions" like this but instead of "Del" i have a SetTimer that checks if window is active

Code: Select all

Del::
MouseGetPos,,,win
WinGetClass, class, ahk_id %win%
If class in Progman,WorkerW
 MsgBox put your action here
else
 Send, {Del}
Return
The closest i got to accomplish my issue was this code

Code: Select all

UpdateOSD:
MouseGetPos, MouseX, MouseY, win
GuiControl,, MyText, X%MouseX%, Y%MouseY%
Gui, 1: +LastFound
WinGetClass, class, ahk_id %win%
If class in Progman,WorkerW
{
	If WinActive("ahk_class" . class)
 	GoTo Labeltest1
	else
	return
}
else
return
Where the "Labeltest1" goes back to gui, show. however even though this actually works there is one issue and not a small one either. i am not able to mouse click hold and mark several icons on the desktop or simply drag n drop any icon at all when i am at the desktop now ..

would be really greateful if someone knows any solution for this.
TravisQ
Posts: 15
Joined: 17 May 2015, 23:51

Re: Computer info gui (Like BGINFO / RAINMETER) issue

20 Feb 2017, 15:36

Code: Select all

...
Gui, 1: Color, %CustomColor%
Gui, 1: +LastFound +AlwaysOnTop       ;<-------
Gui, 1: font, s11.5 cFFFFFF, Segoe UI
...
frodd
Posts: 2
Joined: 20 Feb 2017, 11:11

Re: Computer info gui (Like BGINFO / RAINMETER) issue

21 Feb 2017, 03:38

Hi,

Thanks! but the thing is that i want it to be set to the bottom , i tried to add the always on top if desktop is active but it didn't work either.
TravisQ
Posts: 15
Joined: 17 May 2015, 23:51

Re: Computer info gui (Like BGINFO / RAINMETER) issue

21 Feb 2017, 10:34

Code: Select all

~#D::
SetTimer, DesktopIntegration,-50
return
DesktopIntegration:
WinGetClass, ahk_class, A
If (ahk_class == "WorkerW") and (LastClass != "WorkerW")
	WinActivate, % "ahk_id " . hGadgetGui
LastClass := ahk_class
return
Dont know about show desktop button, but this seemed to do something for winD

Return to “Ask For Help”

Who is online

Users browsing this forum: deten and 59 guests