开发者

Detect non-standard scrollbars

开发者 https://www.devze.com 2023-02-04 02:54 出处:网络
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 wi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消