Judking
Judking

Reputation: 6381

how to get text from a window with specific HWND?

I'm new to win32 programming and haven't worked around with cpp for a long time. What I intend to do is to get a window's HWND via spy++, and get the text of this window. The problem is that I don't know how to create a HWND object, could anyone give me some idea? Thanks a lot!

Upvotes: 0

Views: 961

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283823

If you have the numeric value of the HWND, you can cast it to the right type. Start with an integer of the right size, e.g.:

uintptr_t numeric_hwnd = 0x987654;
HWND hwnd = reinterpret_cast<HWND>(numeric_hwnd);

Upvotes: 3

Related Questions