if (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) {
// window is a child window
} else {
// window is a top-level window
}
Win32 api - how to check if a specified handle is a window? (and isn't a control inside a window)
Domanda
My aim is to get the handle of a window I click. I'm using a global mouse hook and then GetCursorPos
and WindowFromPoint
). When I click on a button (or other controls) I get the button's handle. Using GetParent
I can find the parent window, so I need to check if the handle I have is a window or not.
I have tried GetClassName
but it's not what I'm looking for.
Any ideas appreciated (also using other approaches).
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow