I want to check if the window of an external application has the vertical or horizontal scrollbar visible using the HWND (handle) of the window, exist any WinApi function to get this information? I really try the GetScrollInfo
function but it seems that not retrieve information about the visibility of the scrollbars.
How about GetScrollBarInfo
with OBJID_HSCROLL
or OBJID_VSCROLL
If idObject is OBJID_CLIENT and the window specified by hwnd is not a system scroll bar control, the system sends the SBM_GETSCROLLBARINFO message to the window to obtain scroll bar information. This allows GetScrollBarInfo to operate on a custom control that mimics a scroll bar. If the window does not handle the SBM_GETSCROLLBARINFO message, the GetScrollBarInfo function fails.
You can test rgstate
in the SCROLLBARINFO
structure, there is a STATE_SYSTEM_INVISIBLE
flag there.
Another possible way is to test GetWindowLong(hWnd, GWL_STYLE) and (WS_HSCROLL or WS_VSCROLL) <> 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With