Jump to content
Sign in to follow this  
sosimple

ControlCommand. Help me using it to an aplication. Newbee question.

Recommended Posts

sosimple

I am trying using it, but a cant understand how it works. I have read alot on the site. Can you show me posts with examples that works? I have the program PROGDVB to watch satellite channels on the pc. The program have some buttons for tha satellites :30.0°W 19.2°E 39.0°E By pressing a button, it shows the list of the channel of this satellite. How can I use ControlCommand to sellect one button. For example The button 13.0°E is selected, and i want to use a script to select the button 19.2°E . How can I do this? The autoit window info shows this:

CODE
>>>> Window <<<<

Title: DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)

Class: Tfmain

Position: 100, 38

Size: 1129, 530

Style: 0x16CF0000

ExStyle: 0x00010100

>>>> Control <<<<

Class: TPageControl

Instance: 1

ClassnameNN: TPageControl1

ID: 262332

Text:

Position: 0, 405

Size: 522, 20

ControlClick Coords: 197, 3

Style: 0x56010108

ExStyle: 0x00000000

>>>> Mouse <<<<

Position: 301, 488

Cursor ID: 2

Color: 0xD4D0C8

>>>> StatusBar <<<<

>>>> Visible Text <<<<

CPU: 15%

13.0°E

Favorites

ActiveMovie Window

ToolBar1

>>>> Hidden Text <<<<

30.0°W

19.2°E

39.0°E

All

ToolBar3

General

PGlow

Channel Name

Scrambled

Type

I tried just to have ControlCommand returned if the "13.0°E" button is selected or not by this:

CODE
MsgBox(0, 'Returned Value Of Command', ControlCommand("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "13.0°E", "262332", "IsChecked", ""))

but nothing seems to happened . I select manually "13.0°E" , then select "19.2°E" It always return 0 . What I am doing wrong?

Thanks ,

Edited by sosimple

Share this post


Link to post
Share on other sites
Bowmore

I am trying using it, but a cant understand how it works. I have read alot on the site. Can you show me posts with examples that works? I have the program PROGDVB to watch satellite channels on the pc. The program have some buttons for tha satellites :30.0°W 19.2°E 39.0°E By pressing a button, it shows the list of the channel of this satellite. How can I use ControlCommand to sellect one button. For example The button 13.0°E is selected, and i want to use a script to select the button 19.2°E . How can I do this? The autoit window info shows this:

CODE

>>>> Window <<<<

Title: DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)

Class: Tfmain

Position: 100, 38

Size: 1129, 530

Style: 0x16CF0000

ExStyle: 0x00010100

>>>> Control <<<<

Class: TPageControl

Instance: 1

ClassnameNN: TPageControl1

ID: 262332

Text:

Position: 0, 405

Size: 522, 20

ControlClick Coords: 197, 3

Style: 0x56010108

ExStyle: 0x00000000

>>>> Mouse <<<<

Position: 301, 488

Cursor ID: 2

Color: 0xD4D0C8

>>>> StatusBar <<<<

>>>> Visible Text <<<<

CPU: 15%

13.0°E

Favorites

ActiveMovie Window

ToolBar1

>>>> Hidden Text <<<<

30.0°W

19.2°E

39.0°E

All

ToolBar3

General

PGlow

Channel Name

Scrambled

Type

I tried just to have ControlCommand returned if the "13.0°E" button is selected or not by this:

CODE

MsgBox(0, 'Returned Value Of Command', ControlCommand("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "13.0°E", "262332", "IsChecked", ""))

but nothing seems to happened . I select manually "13.0°E" , then select "19.2°E" It always return 0 . What I am doing wrong?

Thanks ,

CODE
MsgBox(0, 'Returned Value Of Command', ControlCommand("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "13.0°E", 262332, "IsChecked", ""))

The control ID is a number not a string i.e. 262332 not "262332"

You probably don't need the "13.0°E" as this is usually only required when the window tile is not unique. You could leave this a an empty string ""

This should work.

MsgBox(0, 'Returned Value Of Command', ControlCommand("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "", 262332, "IsChecked", ""))

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
sosimple

Thanks, but it also doesnt work .Any other idea anyone?

The "13.0°E" I thing is required because this button is which i try to see if is checked .

I also tried use the ClassnameNN: TPageControl1 . This:

CODE
Winwaitactive ("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)")

MsgBox(0, 'Returned Value Of Command', ControlCommand("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "13.0°E", "TPageControl1", "IsChecked", ""))

But the same . Is there something i dont know? Perhaps i need an #include<....au3> before use ControlCommand ?

Edited by sosimple

Share this post


Link to post
Share on other sites
Bowmore

Thanks, but it also doesnt work .Any other idea anyone?

The "13.0°E" I thing is required because this button is which i try to see if is checked .

I also tried use the ClassnameNN: TPageControl1 . This:

CODE
Winwaitactive ("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)")

MsgBox(0, 'Returned Value Of Command', ControlCommand("DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "13.0°E", "TPageControl1", "IsChecked", ""))

But the same . Is there something i dont know? Perhaps i need an #include<....au3> before use ControlCommand ?

Could you possibly post a image of the window with the control you are trying to conform is checked?


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
sosimple

Posted Image

At the bottom you see 13.0°E 19.2°E etc. Those are the button I am talking about. I know its not a very big foto but i think you get the idea...

*** edit , the programms name is dvbdream , not progdvb as i am writing on the first post..

Edited by sosimple

Share this post


Link to post
Share on other sites
Bowmore

Posted Image

At the bottom you see 13.0°E 19.2°E etc. Those are the button I am talking about. I know its not a very big foto but i think you get the idea...

*** edit , the programms name is dvbdream , not progdvb as i am writing on the first post..

Having had a closer look at this application I now see that you will not be able to access the individual buttons boxes on this control directly with AutoIt. You will have to use coords.

If the color of a checkbox / buttion or the text on it changes when it is active you can use PixelGetColor() to check what state it is in. The Magnify option in Au3Info can help you select a pixel that changes color.

You can then use ControlClick() to click on the desired button.

The code below should give you an idea of how to do this

opt("PixelCoordMode",2)

Dim $CheckedPixelColor = 0xFFFFFF  ; Use Au3Info.exe to get the correct color value
Dim $CheckBox_X = 197  ; Use Au3Info.exe to get the correct coords of checkbox - Mke sure the coords are cliet coords Options->Coord Mode->Client in Au3Info
Dim $CheckBox_Y = 3

If PixelGetColor($CheckBox_X, $CheckBox_Y) <> $CheckedPixelColor Then
    ; The color of the pixel is not what it is when the box is checked so
        ; so the box is not checked and we need to click on control to toggle the state
    ControlClick ( "DVB Dream v1.4d - B2C2 Direct - on driver v4.4.1 (DVB-S)", "", 262332, "left" , 1, $CheckBox_X, $CheckBox_Y)
Else
    ; box is already checked so do nothing
Endif

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
sosimple

Thanks very ,very much . I will try your script tomorrow to see if i can accomplishe anything ...

Share this post


Link to post
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
Sign in to follow this  

×