Jump to content
WoodGrain

Can't move HW Monitor but can move other programs using WinMove()

Recommended Posts

WoodGrain

Hi guys,

I'm trying to move and resize a program call CPUID HWMonitor (http://www.cpuid.com/softwares/hwmonitor.html) but WinMove() doesn't work. Can someone tell me how to get this to work for this program? I've successfully moved other programs using WinMove(), and I've used WinGetTitle ("[ACTIVE]") to confirm the title is correct. WinActivate("CPUID HWMonitor") does work.

If I run the following code nothing happens, doesn't move or resize, but AutoIt doesn't complain about the code either:

WinMove("CPUID HWMonitor", 0, 0, 475, 715)

The class changes every time the program opens (and I've nevery had a lot of success with classes tbh, bit hit and miss for me).

Thanks all!

Edited by WoodGrain
additional information

Share this post


Link to post
Share on other sites
WoodGrain

If I hover my mouse over the title bar this is the information the info windows gives me:

>>>> Window <<<<
Title:  CPUID HWMonitor
Class:  Afx:0000000140000000:b:0000000000010003:0000000000000006:00000000007D069B
Position:   104, 104
Size:   650, 800
Style:  0x14CF4000
ExStyle:    0x00000100
Handle: 0x00000000000605A2

>>>> Control <<<<
Class:  
Instance:   
ClassnameNN:    
Name:   
Advanced (Class):   
ID: 
Text:   
Position:   
Size:   
ControlClick Coords:    
Style:  
ExStyle:    
Handle: 

>>>> Mouse <<<<
Position:   595, 126
Cursor ID:  13
Color:  0x91B3D9

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Ready


>>>> Hidden Text <<<<

If I hover my mouse over the column headers this is the information the info windows gives me:

>>>> Window <<<<
Title:  CPUID HWMonitor
Class:  Afx:0000000140000000:b:0000000000010003:0000000000000006:00000000007D069B
Position:   104, 104
Size:   650, 800
Style:  0x14CF4000
ExStyle:    0x00000100
Handle: 0x00000000000605A2

>>>> Control <<<<
Class:  SysHeader32
Instance:   1
ClassnameNN:    SysHeader321
Name:   
Advanced (Class):   [CLASS:SysHeader32; INSTANCE:1]
ID: 1
Text:   
Position:   2, 2
Size:   630, 19
ControlClick Coords:    510, 11
Style:  0x50000080
ExStyle:    0x00000000
Handle: 0x00000000000C05E4

>>>> Mouse <<<<
Position:   624, 168
Cursor ID:  2
Color:  0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Ready


>>>> Hidden Text <<<<

If I hover my mouse over the tree list area this is the information the info windows gives me:

>>>> Window <<<<
Title:  CPUID HWMonitor
Class:  Afx:0000000140000000:b:0000000000010003:0000000000000006:00000000007D069B
Position:   104, 104
Size:   650, 800
Style:  0x14CF4000
ExStyle:    0x00000100
Handle: 0x00000000000605A2

>>>> Control <<<<
Class:  SysTreeView32
Instance:   1
ClassnameNN:    SysTreeView321
Name:   
Advanced (Class):   [CLASS:SysTreeView32; INSTANCE:1]
ID: 2
Text:   
Position:   2, 21
Size:   630, 699
ControlClick Coords:    522, 25
Style:  0x50209097
ExStyle:    0x00000000
Handle: 0x00000000000C058C

>>>> Mouse <<<<
Position:   636, 201
Cursor ID:  13
Color:  0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Ready


>>>> Hidden Text <<<<

 

Share this post


Link to post
Share on other sites
WoodGrain

#RequireAdmin didn't work either

Share this post


Link to post
Share on other sites
LarsJ
WoodGrain

Interesting, unfortunately that didn't work either :(

Share this post


Link to post
Share on other sites
VIP

Your code is Wrong!:

On 29/6/2017 at 8:28 PM, WoodGrain said:

 

WinMove("CPUID HWMonitor", 0, 0, 475, 715)

 

True code:

; WinMove ( "title", "text", x, y [, width [, height [, speed]]] ) 
WinMove("CPUID HWMonitor", "", 0, 0, 475, 715)

Try it !

or:

#RequireAdmin
Local $aList = WinList().
For $i = 1 To $aList[0][0]
    If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
        If StringInStr($aList[$i][0], "CPUID Hardware Monitor PRO") Or StringInStr($aList[$i][0], "CPUID Hardware Monitor") Or StringInStr($aList[$i][0], "CPUID HWMonitor") Or StringInStr($aList[$i][0], "Hardware Monitor") Or StringInStr($aList[$i][0], "HWMonitor") Then
            WinMove($aList[$i][0], "", 0, 0, 475, 715)
            ConsoleWrite("Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1] & @CRLF)
        EndIf
    EndIf
Next

 


Regards,
 

Share this post


Link to post
Share on other sites
WoodGrain

Well spotted, unfort it still doesn't work.

That being said, ur 2nd code did work.. examining code..

Share this post


Link to post
Share on other sites
VIP

I tested the actual code and software on my computer! Windows7 x64, Windows 10x64, Windows Server 2016 x64 with Autoit 32bit and x64
It works. That is all!


Regards,
 

Share this post


Link to post
Share on other sites
WoodGrain

Why does your second code work, but your 1st code and LarsJ's code not work..?

From what I can see your 2nd code just looks up the WinList() array for any of the matching strings, retrieves the handle of the program and then applies the move to the handle. How is that different to what LarsJ posted?

Share this post


Link to post
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

  • Similar Content

    • Viszna
      By Viszna
      Hey
      Why does Windows 10 "AutoIt Window Info" give the wrong window position?
      WinMove() moves the window to a different point than parameters? -look script

      The test script moves the notepad.exe window to 0, 0, the real window coordinates are 8, 0
      Modified script add WinGetPos() and MouseMove() and MouseGetPos()
      #include <ScreenCapture.au3> Local $iPID = Run("notepad.exe", "") WinWait("[CLASS:Notepad]", "", 10); Wait 10 seconds for the Notepad window to appear. WinMove ("[CLASS:Notepad]", "", 0, 0, 600, 400) WinActivate("[CLASS:Notepad]") Send("WinMove ('[CLASS:Notepad]', "", 0, 0, 600, 400){ENTER}") Send("@DesktopWidth: " & @DesktopWidth & "{ENTER}") Send("@DesktopHeight: " & @DesktopHeight & "{ENTER}") Send("@DesktopDepth: " & @DesktopDepth & "{ENTER}") Send("@OSArch: " & @OSArch & "{ENTER}") Send("@OSBuild: " & @OSBuild & "{ENTER}") Send("@OSServicePack: " & @OSServicePack & "{ENTER}") Send("@OSType: " & @OSType & "{ENTER}") Send("@OSVersion: " & @OSVersion & "{ENTER}") Send(WinGetPos("[CLASS:Notepad]") & "{ENTER}") Send("X: " & WinGetPos("[CLASS:Notepad]")[0] & "{ENTER}") Send("Y: " & WinGetPos("[CLASS:Notepad]")[1] & "{ENTER}") Send("Width: " & WinGetPos("[CLASS:Notepad]")[2] & "{ENTER}") Send("Height: " & WinGetPos("[CLASS:Notepad]")[3] & "{ENTER}") MouseMove(0,400) Send("MouseMove(0,400){ENTER}") Send("MouseGetPos() X: " & MouseGetPos()[0] & "Y: " & MouseGetPos()[1]) Sleep(100) _ScreenCapture_Capture('C:\temp\screen.bmp',0,0,800,600) MsgBox(0,"Info","Save screen to C:\temp\screen.bmp" & @CRLF & "Click OK to view the bitmap") Run("explorer.exe C:\temp\screen.bmp") Is ALWAYS such a difference 8px (in every Windows 7, 8, Server)?
    • bbProg
      By bbProg
      Hi,
       
      how can I wait activate for windows with information as in the photos attached?
      Class is not being recognized by the script.
       
      thanks in advanced.



    • Gowrisankar
      By Gowrisankar
      Dear members, 
      I am working on a project where, emails from outlook are to be read and moved to various folders within the mailbox, based on the content of the emails.
      I used the below code for moving mails. It works fine when I run it against individual mail ids. But when I run it on Shared mailbox, the mails are not moved to respective folders.
      _OL_ItemMove($oOutlook, $sEntryId, Default, $sDestinationFolder) The value of $sEntryId is saved in an excel report initially. The current process reads the $sEntryId from the excel and passes it to "_OL_ItemMove" statement.
      Requesting the guidance of the forum members in this issue.
    • nacerbaaziz
      By nacerbaaziz
      Hi dears
      I've got a question in creating tabs in autoit
      Usually in other programs you can move between tabs by pressing ctrl + tab or ctrl + shift + tab
      I tried to create a window  which have a multy  tab but when i press one of the shortcuts
      it does not move between the tabs
      Is there an option to enable or disable this
      Greetings
      this is the example i tryed

      #include <GUIConstants.au3> #include <MsgBoxConstants.au3> #include <TabConstants.au3> #include <ComboConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> effectsSettings() func effectsSettings() local $echoCombo[6], $reverbCombo[5],  $CHORUSCombo[8], $flangerCombo[8], $paramEQCombo[4], $distortionCombo[6], $gargleCombo[3] $EffWindow = GUICreate("efects settings", 400, 400, -1, -1, $WS_TABSTOP) local $BtOK = GUICtrlCreateButton("ok", 5, 360, 50, 30, 0x01) GUIStartGroup("") local $BTCancel = GUICtrlCreateButton("cancel", 340, 360, 50, 30) GUIStartGroup("") local $effectTabs =     GUICtrlCreateTab(10, 10, 380, 70) GUICtrlSetState(-1, $GUI_focus)     GUICtrlCreateTabItem("echo") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $echoCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 180, 100, 100, 60) $echoCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fLeftDelay", 290, 100, 100, 60) $echoCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fRightDelay", 50, 180, 100, 60) $echoCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lPanDelay", 180, 180, 100, 60) $echoCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40)     GUICtrlCreateTabItem("reverb") GUICtrlCreateLabel("fInGain", 50, 100, 100, 60) $ReverbCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fReverbMix", 180, 100, 100, 60) $ReverbCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fReverbTime", 290, 100, 100, 60) $ReverbCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fHighFreqRTRatio", 50, 180, 100, 60) $ReverbCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40)     GUICtrlCreateTabItem("chorus") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $ChorusCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fDepth", 180, 100, 100, 60) $ChorusCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 290, 100, 100, 60) $ChorusCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $ChorusCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lWaveform", 180, 180, 100, 60) $ChorusCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateLabel("fDelay", 290, 180, 100, 60) $ChorusCombo[6] = GUICtrlCreateCombo("", 300, 190, 80, 40) GUICtrlCreateLabel("lPhase", 50, 260, 100, 60) $ChorusCombo[7] = GUICtrlCreateCombo("", 60, 270, 80, 40)     GUICtrlCreateTabItem("flanger") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $FlangerCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fDepth", 180, 100, 100, 60) $FlangerCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 290, 100, 100, 60) $FlangerCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $FlangerCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lWaveform", 180, 180, 100, 60) $FlangerCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateLabel("fDelay", 290, 180, 100, 60) $FlangerCombo[6] = GUICtrlCreateCombo("", 300, 190, 80, 40) GUICtrlCreateLabel("lPhase", 50, 260, 100, 60) $FlangerCombo[7] = GUICtrlCreateCombo("", 60, 270, 80, 40)     GUICtrlCreateTabItem("paramatric eq") GUICtrlCreateLabel("fCenter", 50, 100, 100, 60) $parameqCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fBandwidth", 180, 100, 100, 60) $ParamEqCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fGain", 290, 100, 100, 60) $parameqCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40)     GUICtrlCreateTabItem("distortion") GUICtrlCreateLabel("fGain", 50, 100, 100, 60) $distortionCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fEdge", 180, 100, 100, 60) $distortionCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fPostEQCenterFrequency", 290, 100, 100, 60) $distortionCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $distortionCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("fPostEQBandwidth", 180, 180, 100, 60) $distortionCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40)     GUICtrlCreateTabItem("gargle") GUICtrlCreateLabel("dwRateHz", 50, 100, 100, 60) $gargleCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("dwWaveShape", 180, 100, 100, 60) $gargleCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUISetState(@sw_show, $EffWindow) While 1 Switch GUIGetMSG() case $GUI_Event_close, $BTCancel exit EndSwitch Wend return "" endFunc
    • rcmaehl
      By rcmaehl
      A UDF with Extended Functions for Window Management
       
      Notes:
      Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
       
      Potential Uses:
      Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
       
      Functions:
      _WinGetClassList
      _WinGetClassNNList
      _WindowGetHandleList
      _WindowGetHandleListFromPos
       
      Download: 
      WindowEx.zip  (v0.4)
       
      Changelog:
      10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x][1] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
      None reported To Do:
      To Be Decided. Opinions welcome! Upcoming Changes:
      To Be Decided.
×