Tankbuster Posted November 16, 2010 Share Posted November 16, 2010 (edited) As always: I searched the forum, read a lot of posts but somehow it looks I'm stuck....I will describe my issue, so you may post me a link to old stuff/posts or help me out right here. I wrote for my self pleasure a Window Arranger (a app that stores the location and size of certain windows and on try command it moves the windows to their stored position). Up to last version I stored the Name=Window Title and position in a INI. And now I thought it would be nice to add new Windows to the INI. (this is working no problem).So I extended the script with a AddFunction. This is also working, BUT currently I head for the TITLE of the active window. (WinGetPos("[TITLE:" & $titleAdd & "]"))But testing the issue, I thought of: What if I want to store the position of eg. firefox but the title is different (of course), than my TitelMatch won't work. As a additional aproach I want to head for the class of a window (so either Class or Title matches)In my scenario I want now either the TITLE OR the CLASS stored. But I cant' figure out how to get the CLASS of a active window.help file: WinGetTitle("[active]") returns the active window's titleso i there a function like:WinGetClass("[active]") returns the active window's class?I added the code of my function, just to show the search lines. But I think my question is clear (at least for myself....muhahaha ).I fear that the solution is just too obvious. Do I missed something in the helpfile?Autoit Used: 3.3.6.1Func AddWindow() Local $titleAdd = WinGetTitle("[active]") Local $result = MsgBox(32 + 4, "EMU Arranger:", "Add this title?" & @CRLF & $titleAdd) If $result = 6 Then Local $winsave_para = WinGetPos("[TITLE:" & $titleAdd & "]") IniWrite($IniFileName, $titleAdd, "WINDOW", "" & $winsave_para[0] & "," & $winsave_para[1] & "," & $winsave_para[2] & "," & $winsave_para[3] & "") EndIf HotKeySet("^!a") ReadWindowsPos() EndFunc ;==>AddWindow Edited November 16, 2010 by Tankbuster Link to comment Share on other sites More sharing options...
JohnOne Posted November 16, 2010 Share Posted November 16, 2010 (edited) I dont think there is a native function for that, and I havent seen a udf either. Have you thought of using the wintitlematchmode option? EDIT: WinGetClassList might help. Edited November 16, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
KaFu Posted November 16, 2010 Share Posted November 16, 2010 _WinAPI_EnumWindows() returns window class. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Tankbuster Posted November 16, 2010 Author Share Posted November 16, 2010 Thank you, of course it was to obvious. And to add to my own shame, if I had used the help file search function" window class name" (not the forum search) I would have found it with the first search......slap me for that, sorry to bother you with this post. But thank you (all) very much ! 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