Jump to content

[Solved] Specifying a ControlID Using a Partial String


 Share

Recommended Posts

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 by Zohar
Link to comment
Share on other sites

@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 by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

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

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 :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

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...