diff --git a/lcl/interfaces/wince/wincewinapi.inc b/lcl/interfaces/wince/wincewinapi.inc index 80d9284253..da1743843d 100644 --- a/lcl/interfaces/wince/wincewinapi.inc +++ b/lcl/interfaces/wince/wincewinapi.inc @@ -3144,6 +3144,7 @@ function TWinCEWidgetSet.ShowCaret(hWnd: HWND): Boolean; begin Result := Boolean(Windows.ShowCaret(HWnd)); end; + {------------------------------------------------------------------------------ Method: ShowScrollBar Params: Handle - handle of window with scroll bar @@ -3153,11 +3154,33 @@ end; Shows or hides the specified scroll bar. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.ShowScrollBar(Handle: HWND; wBar: Integer; +function TWinCEWidgetSet.ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; +var + dwStyle: DWORD; begin - Result:=inherited ShowScrollBar(Handle, wBar, bShow); -end;} + Result := True; + dwStyle := GetWindowLong(Handle, GWL_STYLE); + case wBar of + SB_BOTH: + if bShow then + SetWindowLong(Handle, GWL_STYLE, dwStyle or WS_VSCROLL or WS_HSCROLL) + else + SetWindowLong(Handle, GWL_STYLE, (dwStyle and not WS_VSCROLL) and not WS_HSCROLL); + SB_VERT: + if bShow then + SetWindowLong(Handle, GWL_STYLE, dwStyle or WS_VSCROLL) + else + SetWindowLong(Handle, GWL_STYLE, dwStyle and not WS_VSCROLL); + SB_HORZ: + if bShow then + SetWindowLong(Handle, GWL_STYLE, dwStyle or WS_HSCROLL) + else + SetWindowLong(Handle, GWL_STYLE, dwStyle and not WS_HSCROLL); + else + Result := False; + end; +end; {------------------------------------------------------------------------------ Method: ShowWindow diff --git a/lcl/interfaces/wince/wincewinapih.inc b/lcl/interfaces/wince/wincewinapih.inc index 272f4303b8..6cd659b494 100644 --- a/lcl/interfaces/wince/wincewinapih.inc +++ b/lcl/interfaces/wince/wincewinapih.inc @@ -221,7 +221,7 @@ function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; OldPoint: PPoint) : Bool function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override; function ShowCaret(hWnd: HWND): Boolean; override; -{function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;} +function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override; function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override; function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override; function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;