Hi everybody
For some time I have been working on an UI testing application. The application under test was developed in C#, and my application has been developed in C# as well. I do not have a source code of the application under test, so I use Win API messages and methods. I faced the following problem:
The application under test contains a check box:
Class: WindowsForms10. BUTTON
Text: "Some text"
Style: "Some styles"
After I get a handle to the check box ( I am sure I have the correct handle ) I use SendMessage to retrieve the check box state:
My problem is that both SendMessage methods from above always return 0, even if a check box is checked.
Can anybody tell me what is wrong with the code above?
Thanks in advance.
For some time I have been working on an UI testing application. The application under test was developed in C#, and my application has been developed in C# as well. I do not have a source code of the application under test, so I use Win API messages and methods. I faced the following problem:
The application under test contains a check box:
Class: WindowsForms10. BUTTON
Text: "Some text"
Style: "Some styles"
After I get a handle to the check box ( I am sure I have the correct handle ) I use SendMessage to retrieve the check box state:
Code:
private const int BM_GETSTATE = 0x00F2; private const int BM_GETCHECK = 0x00F0; private const int BST_UNCHECKED = 0x0000; private const int BST_CHECKED = 0x0001; int result; result = SendMessage(correctHandle, BM_GETSTATE, 0, 0); or result = SendMessage(correctHandle, BM_GETCHECK, 0, 0);
Can anybody tell me what is wrong with the code above?
Thanks in advance.
Comment