Is there a way to detect with WinAPI if window has non-standard scrollbars (for example, window can draw scrollbars itself instead of u开发者_如何学Gosing standard ones)?
I'm not quite sure if this will work, but it is just an idea. Scroll bars belong to the window which has to be created with this style enabled. So, you can check if your window contains WS_VSCROLL style and if so - this is standard scrollbar. In counterpart it is drawn by somebody else.
You can check it on this way:
// Assume that a window handle hWnd is known
int style = GetWindowLong(hWnd, GWL_STYLE);
BOOL bStandard = ((style & WS_VSCROLL) != 0);
It's kind of hard to see how you could do this. A control could just paint scroll bars in its own canvas, do its own hit testing and how would you possibly know. You could do all this without creating separate HWNDs for the scroll bars.
What would be more interesting would be if you could say why you would wish to know this.
精彩评论