Windown type pane
Hi,
How to get the title of window in language c++ , where type is pane?
Thanks
What operating system (or window manager if *nix)?
Edit: I see from the previous topic that it's Windows. You should say this in your OP.
If you have the handle (HWND), you can call something like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <windows.h>
#include <string>
// ...
std::string windowTitle(HWND hWnd)
{
int length = GetWindowTextLength(hWnd);
char* windowTitleBuffer = new char[length + 1] {};
GetWindowText(hWnd, windowTitleBuffer, length + 1);
std::string windowTitle(windowTitleBuffer);
delete[] windowTitleBuffer;
return windowTitle;
}
| |
Last edited on
Topic archived. No new replies allowed.