1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wincomp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SV_WINCOMP_HXX
32 #define _SV_WINCOMP_HXX
43 // Anpassungen fuer TypeChecking
45 inline HPEN
SelectPen( HDC hDC
, HPEN hPen
)
47 return (HPEN
)SelectObject( hDC
, (HGDIOBJ
)hPen
);
50 inline void DeletePen( HPEN hPen
)
52 DeleteObject( (HGDIOBJ
)hPen
);
55 inline HPEN
GetStockPen( int nObject
)
57 return (HPEN
)GetStockObject( nObject
);
60 inline HBRUSH
SelectBrush( HDC hDC
, HBRUSH hBrush
)
62 return (HBRUSH
)SelectObject( hDC
, (HGDIOBJ
)hBrush
);
65 inline void DeleteBrush( HBRUSH hBrush
)
67 DeleteObject( (HGDIOBJ
)hBrush
);
70 inline HBRUSH
GetStockBrush( int nObject
)
72 return (HBRUSH
)GetStockObject( nObject
);
75 inline HFONT
SelectFont( HDC hDC
, HFONT hFont
)
77 return (HFONT
)SelectObject( hDC
, (HGDIOBJ
)hFont
);
80 inline void DeleteFont( HFONT hFont
)
82 DeleteObject( (HGDIOBJ
)hFont
);
85 inline HFONT
GetStockFont( int nObject
)
87 return (HFONT
)GetStockObject( nObject
);
90 inline HBITMAP
SelectBitmap( HDC hDC
, HBITMAP hBitmap
)
92 return (HBITMAP
)SelectObject( hDC
, (HGDIOBJ
)hBitmap
);
95 inline void DeleteBitmap( HBITMAP hBitmap
)
97 DeleteObject( (HGDIOBJ
)hBitmap
);
100 inline void DeleteRegion( HRGN hRegion
)
102 DeleteObject( (HGDIOBJ
)hRegion
);
105 inline HPALETTE
GetStockPalette( int nObject
)
107 return (HPALETTE
)GetStockObject( nObject
);
110 inline void DeletePalette( HPALETTE hPalette
)
112 DeleteObject( (HGDIOBJ
)hPalette
);
115 inline void SetWindowStyle( HWND hWnd
, DWORD nStyle
)
117 SetWindowLong( hWnd
, GWL_STYLE
, nStyle
);
120 inline DWORD
GetWindowStyle( HWND hWnd
)
122 return GetWindowLong( hWnd
, GWL_STYLE
);
125 inline void SetWindowExStyle( HWND hWnd
, DWORD nStyle
)
127 SetWindowLong( hWnd
, GWL_EXSTYLE
, nStyle
);
130 inline DWORD
GetWindowExStyle( HWND hWnd
)
132 return GetWindowLong( hWnd
, GWL_EXSTYLE
);
135 inline WIN_BOOL
IsMinimized( HWND hWnd
)
137 return IsIconic( hWnd
);
140 inline WIN_BOOL
IsMaximized( HWND hWnd
)
142 return IsZoomed( hWnd
);
145 inline void SetWindowFont( HWND hWnd
, HFONT hFont
, WIN_BOOL bRedraw
)
147 SendMessage( hWnd
, WM_SETFONT
, (WPARAM
)hFont
, MAKELPARAM((UINT
)bRedraw
,0) );
150 inline HFONT
GetWindowFont( HWND hWnd
)
152 return (HFONT
)(UINT
)SendMessage( hWnd
, WM_GETFONT
, 0, 0 );
155 inline void SetClassCursor( HWND hWnd
, HCURSOR hCursor
)
157 SetClassLong( hWnd
, GCL_HCURSOR
, (DWORD
)hCursor
);
160 inline HCURSOR
GetClassCursor( HWND hWnd
)
162 return (HCURSOR
)GetClassLong( hWnd
, GCL_HCURSOR
);
165 inline void SetClassIcon( HWND hWnd
, HICON hIcon
)
167 SetClassLong( hWnd
, GCL_HICON
, (DWORD
)hIcon
);
170 inline HICON
GetClassIcon( HWND hWnd
)
172 return (HICON
)GetClassLong( hWnd
, GCL_HICON
);
175 inline HBRUSH
SetClassBrush( HWND hWnd
, HBRUSH hBrush
)
177 return (HBRUSH
)SetClassLong( hWnd
, GCL_HBRBACKGROUND
, (DWORD
)hBrush
);
180 inline HBRUSH
GetClassBrush( HWND hWnd
)
182 return (HBRUSH
)GetClassLong( hWnd
, GCL_HBRBACKGROUND
);
185 inline HINSTANCE
GetWindowInstance( HWND hWnd
)
187 return (HINSTANCE
)GetWindowLong( hWnd
, GWL_HINSTANCE
);
190 // ------------------------
191 // - ZMouse Erweiterungen -
192 // ------------------------
194 #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
196 #define MOUSEZ_CLASSNAME "MouseZ" // wheel window class
197 #define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title
199 #define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
200 #define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
202 #define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
205 #define WHEEL_DELTA 120
207 #ifndef WM_MOUSEWHEEL
208 #define WM_MOUSEWHEEL 0x020A
210 #ifndef SPI_GETWHEELSCROLLLINES
211 #define SPI_GETWHEELSCROLLLINES 104
213 #ifndef SPI_SETWHEELSCROLLLINES
214 #define SPI_SETWHEELSCROLLLINES 105
216 #ifndef WHEEL_PAGESCROLL
217 #define WHEEL_PAGESCROLL (UINT_MAX)
221 // -----------------------------
222 // - SystemAgent Erweiterungen -
223 // -----------------------------
225 #define ENABLE_AGENT 1
226 #define DISABLE_AGENT 2
227 #define GET_AGENT_STATUS 3
228 typedef int (APIENTRY
* SysAgt_Enable_PROC
)( int );
230 // ---------------------
231 // - 5.0-Erweiterungen -
232 // ---------------------
234 #ifndef COLOR_GRADIENTACTIVECAPTION
235 #define COLOR_GRADIENTACTIVECAPTION 27
237 #ifndef COLOR_GRADIENTINACTIVECAPTION
238 #define COLOR_GRADIENTINACTIVECAPTION 28
241 #ifndef SPI_GETFLATMENU
242 #define SPI_GETFLATMENU 0x1022
244 #ifndef COLOR_MENUBAR
245 #define COLOR_MENUBAR 30
247 #ifndef COLOR_MENUHILIGHT
248 #define COLOR_MENUHILIGHT 29
251 #ifndef CS_DROPSHADOW
252 #define CS_DROPSHADOW 0x00020000
255 // -------------------------------------------------------
256 // MT 12/03: From winuser.h, only needed in salframe.cxx
257 // Better change salframe.cxx to include winuser.h
258 // -------------------------------------------------------
260 #define WS_EX_LAYERED 0x00080000
263 #define WM_UNICHAR 0x0109
264 #define UNICODE_NOCHAR 0xFFFF
267 #endif // _SV_WINCOMP_HXX