Skip to content

Commit ec96b7e

Browse files
committed
ShowScrollBar function; fix #165.
1 parent c72d112 commit ec96b7e

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ WinSafe documentation:
2525

2626
| Native FFI item | Count |
2727
| - | -: |
28-
| Functions | 900 |
28+
| Functions | 901 |
2929
| Structs | 263 |
3030
| Constants | 15,099 |
3131
| Window messages | 684 |

src/user/co/consts.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,8 +2297,9 @@ const_ordinary! { SB_REQ: u16;
22972297
const_ordinary! { SBB: i32;
22982298
/// [`HWND::EnableScrollBar`](crate::HWND::EnableScrollBar),
22992299
/// [`HWND::GetScrollInfo`](crate::HWND::GetScrollInfo),
2300-
/// [`HWND::SetScrollInfo`](crate::HWND::SetScrollInfo) and
2301-
/// [`HWND::SetScrollRange`](crate::HWND::SetScrollRange) `bar` (`i32`).
2300+
/// [`HWND::SetScrollInfo`](crate::HWND::SetScrollInfo),
2301+
/// [`HWND::SetScrollRange`](crate::HWND::SetScrollRange) and
2302+
/// [`HWND::ShowScrollBar`](crate::HWND::ShowScrollBar) `bar` (`i32`).
23022303
///
23032304
/// Originally has `SB` prefix.
23042305
=>

src/user/ffi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ extern_sys! { "user32";
269269
ShowCaret(HANDLE) -> BOOL
270270
ShowCursor(BOOL) -> i32
271271
ShowOwnedPopups(HANDLE, BOOL) -> BOOL
272+
ShowScrollBar(HANDLE, i32, BOOL) -> BOOL
272273
ShowWindow(HANDLE, i32) -> BOOL
273274
ShowWindowAsync(HANDLE, i32) -> BOOL
274275
ShutdownBlockReasonCreate(HANDLE, PCSTR) -> BOOL

src/user/handles/hwnd.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,12 @@ impl HWND {
15101510
unsafe { ffi::SetScrollInfo(self.ptr(), bar.raw(), pcvoid(si), redraw as _) }
15111511
}
15121512

1513+
/// [`ShowScrollBar`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showscrollbar)
1514+
/// function.
1515+
pub fn ShowScrollBar(&self, bar: co::SBB, show: bool) -> SysResult<()> {
1516+
BoolRet(unsafe { ffi::ShowScrollBar(self.ptr(), bar.raw(), show as _) }).to_sysresult()
1517+
}
1518+
15131519
/// [`SetScrollPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setscrollpos)
15141520
/// function.
15151521
pub fn SetScrollPos(&self, b: co::SBB, pos: i32, redraw: bool) -> SysResult<i32> {

0 commit comments

Comments
 (0)