what this ClassName Means?

Myeong Ji Go 21 Reputation points
2020-07-22T19:04:46.51+00:00

Hi, I'm trying to build GUIA program using python 3 without using pywinauto and autoit

The target program is composed by many Edits, RadioButtons, Buttons etc
ClassName of Edit is returned as "WindowsForms10.EDIT.app.0.13965fa_r9_ad1"
It goes well when I want to do "SetText" by "SendMessage" to Edit control. Like "Edit" in notepad,
win32con.WM_SETTEXT is suitable for Msg in SendMessage()
But RadioButton(in fact RadioGroup) and Buttons have strange ClassName
"WindowsForms10.Window.8.app.0.13965fa_r9_ad1"
And problem is here.
I'm trying to click specific Button so do SendMessage(button_hwnd, Msg, 0,0)
At first, Msg is BM_CLICK, NM_CLICK. But it dosen't work.
Afterwards I did iteration.
for i in range(-5000, 5000):
SendMessage(button_hwnd, i, 0,0)
but doesn't work.
It is same when did PostMessage
Please let me know when it returns a ClassName like this and how I get to click the Button.



Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rita Han - MSFT 2,161 Reputation points
    2020-07-23T02:09:18.31+00:00

    Class name "WindowsForms10.Window.8.***" seems not a standard control's class name and it is undocumented. You may want to consult the developer or supplier of the target program for how to access this control.

    UI automation seems a possible solution for you (If this control supports). For how to invoke a button through UI automation you can refer to "Invoke a Control Using UI Automation". Hope this document will guide you find a solution in Python.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Myeong Ji Go 21 Reputation points
    2020-07-22T19:47:06.157+00:00

    I dont find what the classname means, but how to operate button!
    WM_LBUTTONDOWN AND
    WM_LBUTTONUP

    I realize that except special windows like treeview, WM is well work!

    0 comments No comments

  2. Castorix31 81,636 Reputation points
    2020-07-23T09:03:35.247+00:00

    Class names like "WindowsForms10.EDIT.app.0.13965fa_r9_ad1" are generated by .NET in Winforms (C#, VB.NET)
    But to simulate actions, it is better with UI Automation (use Inspect tool from Windows SDK to check and identify controls)

    0 comments No comments