https://www.intel.com/content/www/us/en/developer/articles/tool/power-gadget.html
I have created the following script to Start/Minimize/Stop the app, but cannot make it to "minimize", or "disable AlwaysOnTop".
Code: Select all
; ------------------------------------------------------------------------------
#SingleInstance, Force ; Directly load without prompt of previous instance.
; ------------------------------------------------------------------------------
Gui, Main: Destroy
Gui, Main: +AlwaysOnTop
Gui, Main: Add, Text, x10, Test
Gui, Main: Show, x1000 y200
Return
GuiClose:
ExitApp
ESC::ExitApp
; ------------------------------------------------------------------------------
; App : Start / Show
1::
IfWinExist, ahk_exe IntelPowerGadget.exe
{
WinActivate, ahk_exe IntelPowerGadget.exe
WinGet, o_hWnd, ID, ahk_exe IntelPowerGadget.exe
; o_hWnd := WinExist("Trade-Ideas Pro AI")
; MsgBox, 48, , hWnd: %o_hWnd%, 1
WinSet, AlwaysOnTop, Off, ahk_id %o_hWnd%
WinSet, AlwaysOnTop, Off, ahk_exe IntelPowerGadget.exe
}
else
{
; Process do not exist, Start the App
RunWait, C:\Program Files\Intel\Power Gadget 3.6\IntelPowerGadget.exe
WinActivate, ahk_exe IntelPowerGadget.exe
WinGet, o_hWnd, ID, ahk_exe IntelPowerGadget.exe
WinSet, AlwaysOnTop, Off, ahk_id %o_hWnd%
WinSet, AlwaysOnTop, Off, ahk_exe IntelPowerGadget.exe
}
return
; ------------------------------------------------------------------------------
; App : Hide
2::
IfWinExist, ahk_exe IntelPowerGadget.exe
{
WinActivate, ahk_exe IntelPowerGadget.exe
WinSet, AlwaysOnTop, Off, ahk_id %o_hWnd%
WinMinimize, ahk_id %o_hWnd%
WinMinimize, ahk_exe IntelPowerGadget.exe
}
else
{
; Process do not exist, do nothing.
}
return
; ------------------------------------------------------------------------------
; App : End
3::
IfWinExist, ahk_exe IntelPowerGadget.exe
{
Process, Close, IntelPowerGadget.exe
}
else
{
; Process do not exist, do nothing.
}
return
; ------------------------------------------------------------------------------