Jump to content

MS Paint Window Info


Recommended Posts

Hello everyone,

I wanted to automate Microsoft Paint a little bit in my program. But, the problem is, each time I open a new Paint window, the 'Class' and the 'ClassNN' attributes of the paintable area change. Is there any attribute which remains same each time and that control can be uniquely identified? I need to retrieve its position and size using 'ControlGetSize' etc...

Any ideas are welcome...thanks again! ;)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Link to comment
Share on other sites

Hey I tested this out and it worked every time.

WinXP

$handle = WinGetHandle("[CLASS:MSPaintApp]")
If @error Then
    MsgBox(4096, "Error", "Could not find the correct window")
Else
    ;Class of the "canvas" is CLASS:Afx:1000000:8
    ControlClick($handle, "", "[CLASS:Afx:1000000:8]")
EndIf
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...