Jump to content
WoodGrain

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

Recommended Posts

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

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

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

 

Share this post


Link to post
Share on other sites

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

    • By nacerbaaziz
      hello sirs, please i created a tool witch get the focused control in a window and play a audio file linked with this controls
      e.g buttons, checkBoxes, radios, comboboxes, and others
      i know that their is a function that give us the control focus but it return the classNN
      i want to get the class name to use it with a switch and
      because their are more than class e.g button tbutton timagebutton tnewButton...
      please can any one help me to get the class name not the classnn
      thanks in advance
    • By ThePoro
      Hi everyone.
      I want to ask about this : 
      I want it runs from 1 to 100 and It opens 10 firefox profiles then access youtube. After I close a firefox window, the loop runs and wait for another window close until loop ends
      I have a loop like this.
      Func launch() Local $from = Int(GUICtrlRead($input1)) Local $to = Int(GUICtrlRead($input2)) If $to <> "" Then While $from <= $to Local $profile = $to _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com") $to=$to+1 WEnd Else Local $profile = $to _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com") EndIf EndFunc Is there any solution?
      Thank you!
    • By Rhidlor
      I was wondering if there was a library or something which provides the capability to Send() to inactive windows, and I know what you're thinking, I could just use ControlSend(); the reason I can't use that in this situation is because I need to hold down keys for specific prolonged periods of time. Also activating the window, Send()ing then de-activating the window isn't really an option here, I need the target window to always be in the background. I've looked around the forums for an adequate amount of time and didn't find anything useful, perhaps because the threads were all 10 years old, nevertheless, if anyone has any suggestions they would be greatly appreciated.
      Thanks!
    • 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)?
    • 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.



×
×
  • Create New...