Zohar Posted March 17, 2019 Share Posted March 17, 2019 (edited) Hi I need to use ControlGetPos() on VLC's Video Output control. This control's class is named differently each run of VLC: On one run it may be "VLC video output 02E20328" and on the second "VLC video output 02D56114" So the only known part is the beginning: "VLC video output ". Is it possible somehow to reference a Control with a partial Class name? Thank you Edited March 17, 2019 by Zohar Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 17, 2019 Share Posted March 17, 2019 4 hours ago, Zohar said: Is it possible somehow to reference a Control with a partial Class name? Use REGEXPCLASS: ControlGetPos("Title", "", "[REGEXPCLASS:(?i)VLC Video Output.*]") Zohar 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zohar Posted March 17, 2019 Author Share Posted March 17, 2019 Hi FrancescoDiMuro Thank you very much. I am curious to ask: What does the "(?i)" before the string mean? And also, why in the end there's a "." before the *? Thank you Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 17, 2019 Share Posted March 17, 2019 (edited) @Zohar The "i" at the start of the string is called a modifier, and it tells to the RegEx engine: "Don't care about capitalization; threat VLC and vlc (and all the other possible combinations) in the same manner. The ".*" at the end of the string, instead, is a metacharacter (the dot), and a quantifier (the asterisk), and they tell to the RegEx: "After matching VLC Video Output, there could be 0 to N character (every character) after that string", so you don't need to worry about what does follow the string, but just be secure that VLC Video Output is in the string Edited March 17, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zohar Posted March 17, 2019 Author Share Posted March 17, 2019 Terrific, thank you so much. I am using it, and it works. I am also curious to ask, If I ever want to get the Control's Name as string, and hold it in a variable, Is there a way to List the controls that are on a Window (specified by a Window Handle)? Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 17, 2019 Share Posted March 17, 2019 5 minutes ago, Zohar said: Is there a way to List the controls that are on a Window (specified by a Window Handle)? You can use WindowGetClassList(), which returns a list of all the classes related to a Window. Here it is an example Zohar 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zohar Posted March 17, 2019 Author Share Posted March 17, 2019 Thank you so much FrancescoDiMuro 🌺 You helped me a lot Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 17, 2019 Share Posted March 17, 2019 @Zohar Happy to have helped Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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