sonicriders Posted April 14, 2015 Share Posted April 14, 2015 I came over a pretty weird problem today while using AutoIt... I'm trying to use WinMove to move a window to (0, 0) every time it opens, because for some reason, the program doesn't save its position when it's closed and re-opened again. The program is called Todoist. Since WinMove requires a Class name, I found it, copied it, and pasted it into the script. I restarted the program and ran the script, but the window didn't move. I carefully examined the code, finding nothing wrong with it. I tried it with Notepad and it worked fine. So I decided to check out the Class name again... ...sure enough, the name had completely changed on me. After restarting the program a few more times, I discovered that the name changes every time the program is closed and re-opened. This means that in order to move an open window of the program to (0, 0), I need to find a way to have AutoIt check for the program's Class name every time the app starts (or every time I start the script) and use that as the Class name to successfully run the script. Is there any way to do this? Can anyone think of a workaround if what I'm suggesting isn't possible to achieve? I'm not too advanced at this yet either, so the more code you can actually write out for me, the better. Thanks! Link to comment Share on other sites More sharing options...
MikahS Posted April 14, 2015 Share Posted April 14, 2015 (edited) You can use the title of the window like you have used the class name. Have you tried that? Edited April 14, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted April 14, 2015 Share Posted April 14, 2015 Since @MikahS already brought up my idea, I can only propose an alternative, have you tried to get it PID? with WinGetProcess (If the title doesn't work) Link to comment Share on other sites More sharing options...
sonicriders Posted April 14, 2015 Author Share Posted April 14, 2015 Much thanks to both of you: titles were a feature that I had completely overlooked. Thanks for putting up with my naivety! Link to comment Share on other sites More sharing options...
MikahS Posted April 15, 2015 Share Posted April 15, 2015 (edited) We are here to help. My pleasure. Edited April 15, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now