Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to get a label Handle to get the label text?

I am trying to get text from a label in a specific window.
For this I'm using the FindwindowsEx API function, I don't know if this is the correct way:

LPSTR lpFilename;
HWND han = GetActiveWindow();
GetWindowText(han, lpFilename, _MAX_PATH) ;
HWND hanlabel= FindWindowEx(han,NULL,"Static",lpFilename);
GetWindowText(hanlabel, lpFilename, _MAX_PATH) ;

Comments