1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SV_WINCOMP_HXX
21 #define _SV_WINCOMP_HXX
29 // Anpassungen fuer TypeChecking
31 inline HPEN
SelectPen( HDC hDC
, HPEN hPen
)
33 return (HPEN
)SelectObject( hDC
, (HGDIOBJ
)hPen
);
36 inline void DeletePen( HPEN hPen
)
38 DeleteObject( (HGDIOBJ
)hPen
);
41 inline HPEN
GetStockPen( int nObject
)
43 return (HPEN
)GetStockObject( nObject
);
46 inline HBRUSH
SelectBrush( HDC hDC
, HBRUSH hBrush
)
48 return (HBRUSH
)SelectObject( hDC
, (HGDIOBJ
)hBrush
);
51 inline void DeleteBrush( HBRUSH hBrush
)
53 DeleteObject( (HGDIOBJ
)hBrush
);
56 inline HBRUSH
GetStockBrush( int nObject
)
58 return (HBRUSH
)GetStockObject( nObject
);
61 inline HFONT
SelectFont( HDC hDC
, HFONT hFont
)
63 return (HFONT
)SelectObject( hDC
, (HGDIOBJ
)hFont
);
66 inline void DeleteFont( HFONT hFont
)
68 DeleteObject( (HGDIOBJ
)hFont
);
71 inline HFONT
GetStockFont( int nObject
)
73 return (HFONT
)GetStockObject( nObject
);
76 inline HBITMAP
SelectBitmap( HDC hDC
, HBITMAP hBitmap
)
78 return (HBITMAP
)SelectObject( hDC
, (HGDIOBJ
)hBitmap
);
81 inline void DeleteBitmap( HBITMAP hBitmap
)
83 DeleteObject( (HGDIOBJ
)hBitmap
);
86 inline void DeleteRegion( HRGN hRegion
)
88 DeleteObject( (HGDIOBJ
)hRegion
);
91 inline HPALETTE
GetStockPalette( int nObject
)
93 return (HPALETTE
)GetStockObject( nObject
);
96 inline void DeletePalette( HPALETTE hPalette
)
98 DeleteObject( (HGDIOBJ
)hPalette
);
101 inline void SetWindowStyle( HWND hWnd
, DWORD nStyle
)
103 SetWindowLong( hWnd
, GWL_STYLE
, nStyle
);
106 inline DWORD
GetWindowStyle( HWND hWnd
)
108 return GetWindowLong( hWnd
, GWL_STYLE
);
111 inline void SetWindowExStyle( HWND hWnd
, DWORD nStyle
)
113 SetWindowLong( hWnd
, GWL_EXSTYLE
, nStyle
);
116 inline DWORD
GetWindowExStyle( HWND hWnd
)
118 return GetWindowLong( hWnd
, GWL_EXSTYLE
);
121 inline BOOL
IsMinimized( HWND hWnd
)
123 return IsIconic( hWnd
);
126 inline BOOL
IsMaximized( HWND hWnd
)
128 return IsZoomed( hWnd
);
131 inline void SetWindowFont( HWND hWnd
, HFONT hFont
, BOOL bRedraw
)
133 SendMessage( hWnd
, WM_SETFONT
, (WPARAM
)hFont
, MAKELPARAM((UINT
)bRedraw
,0) );
136 inline HFONT
GetWindowFont( HWND hWnd
)
138 return (HFONT
)(UINT
)SendMessage( hWnd
, WM_GETFONT
, 0, 0 );
141 inline void SetClassCursor( HWND hWnd
, HCURSOR hCursor
)
143 SetClassLongPtr( hWnd
, GCLP_HCURSOR
, (LONG_PTR
)hCursor
);
146 inline HCURSOR
GetClassCursor( HWND hWnd
)
148 return (HCURSOR
)GetClassLongPtr( hWnd
, GCLP_HCURSOR
);
151 inline void SetClassIcon( HWND hWnd
, HICON hIcon
)
153 SetClassLongPtr( hWnd
, GCLP_HICON
, (LONG_PTR
)hIcon
);
156 inline HICON
GetClassIcon( HWND hWnd
)
158 return (HICON
)GetClassLongPtr( hWnd
, GCLP_HICON
);
161 inline HBRUSH
SetClassBrush( HWND hWnd
, HBRUSH hBrush
)
163 return (HBRUSH
)SetClassLongPtr( hWnd
, GCLP_HBRBACKGROUND
, (LONG_PTR
)hBrush
);
166 inline HBRUSH
GetClassBrush( HWND hWnd
)
168 return (HBRUSH
)GetClassLongPtr( hWnd
, GCLP_HBRBACKGROUND
);
171 inline HINSTANCE
GetWindowInstance( HWND hWnd
)
173 return (HINSTANCE
)GetWindowLongPtr( hWnd
, GWLP_HINSTANCE
);
176 // ------------------------
177 // - ZMouse Erweiterungen -
178 // ------------------------
180 #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
182 #define MOUSEZ_CLASSNAME "MouseZ" // wheel window class
183 #define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title
185 #define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
186 #define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
188 #define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
191 #define WHEEL_DELTA 120
193 #ifndef WM_MOUSEWHEEL
194 #define WM_MOUSEWHEEL 0x020A
196 #ifndef SPI_GETWHEELSCROLLLINES
197 #define SPI_GETWHEELSCROLLLINES 104
199 #ifndef SPI_SETWHEELSCROLLLINES
200 #define SPI_SETWHEELSCROLLLINES 105
202 #ifndef WHEEL_PAGESCROLL
203 #define WHEEL_PAGESCROLL (UINT_MAX)
207 // -----------------------------
208 // - SystemAgent Erweiterungen -
209 // -----------------------------
211 #define ENABLE_AGENT 1
212 #define DISABLE_AGENT 2
213 #define GET_AGENT_STATUS 3
214 typedef int (APIENTRY
* SysAgt_Enable_PROC
)( int );
216 // ---------------------
217 // - 5.0-Erweiterungen -
218 // ---------------------
220 #ifndef COLOR_GRADIENTACTIVECAPTION
221 #define COLOR_GRADIENTACTIVECAPTION 27
223 #ifndef COLOR_GRADIENTINACTIVECAPTION
224 #define COLOR_GRADIENTINACTIVECAPTION 28
227 #ifndef SPI_GETFLATMENU
228 #define SPI_GETFLATMENU 0x1022
230 #ifndef COLOR_MENUBAR
231 #define COLOR_MENUBAR 30
233 #ifndef COLOR_MENUHILIGHT
234 #define COLOR_MENUHILIGHT 29
237 #ifndef CS_DROPSHADOW
238 #define CS_DROPSHADOW 0x00020000
241 // -------------------------------------------------------
242 // MT 12/03: From winuser.h, only needed in salframe.cxx
243 // Better change salframe.cxx to include winuser.h
244 // -------------------------------------------------------
246 #define WS_EX_LAYERED 0x00080000
249 #define WM_UNICHAR 0x0109
250 #define UNICODE_NOCHAR 0xFFFF
253 #endif // _SV_WINCOMP_HXX
255 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */