xref: /trunk/main/vcl/inc/win/wincomp.hxx (revision 161f4cd1)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_WINCOMP_HXX
25 #define _SV_WINCOMP_HXX
26 
27 #ifndef _STRING_H
28 #include <string.h>
29 #endif
30 
31 // ----------
32 // - Strict -
33 // ----------
34 
35 // Anpassungen fuer TypeChecking
36 
37 inline HPEN SelectPen( HDC hDC, HPEN hPen )
38 {
39 	return (HPEN)SelectObject( hDC, (HGDIOBJ)hPen );
40 }
41 
42 inline void DeletePen( HPEN hPen )
43 {
44 	DeleteObject( (HGDIOBJ)hPen );
45 }
46 
47 inline HPEN GetStockPen( int nObject )
48 {
49 	return (HPEN)GetStockObject( nObject );
50 }
51 
52 inline HBRUSH SelectBrush( HDC hDC, HBRUSH hBrush )
53 {
54 	return (HBRUSH)SelectObject( hDC, (HGDIOBJ)hBrush );
55 }
56 
57 inline void DeleteBrush( HBRUSH hBrush )
58 {
59 	DeleteObject( (HGDIOBJ)hBrush );
60 }
61 
62 inline HBRUSH GetStockBrush( int nObject )
63 {
64 	return (HBRUSH)GetStockObject( nObject );
65 }
66 
67 inline HFONT SelectFont( HDC hDC, HFONT hFont )
68 {
69 	return (HFONT)SelectObject( hDC, (HGDIOBJ)hFont );
70 }
71 
72 inline void DeleteFont( HFONT hFont )
73 {
74 	DeleteObject( (HGDIOBJ)hFont );
75 }
76 
77 inline HFONT GetStockFont( int nObject )
78 {
79 	return (HFONT)GetStockObject( nObject );
80 }
81 
82 inline HBITMAP SelectBitmap( HDC hDC, HBITMAP hBitmap )
83 {
84 	return (HBITMAP)SelectObject( hDC, (HGDIOBJ)hBitmap );
85 }
86 
87 inline void DeleteBitmap( HBITMAP hBitmap )
88 {
89 	DeleteObject( (HGDIOBJ)hBitmap );
90 }
91 
92 inline void DeleteRegion( HRGN hRegion )
93 {
94 	DeleteObject( (HGDIOBJ)hRegion );
95 }
96 
97 inline HPALETTE GetStockPalette( int nObject )
98 {
99 	return (HPALETTE)GetStockObject( nObject );
100 }
101 
102 inline void DeletePalette( HPALETTE hPalette )
103 {
104 	DeleteObject( (HGDIOBJ)hPalette );
105 }
106 
107 inline void SetWindowStyle( HWND hWnd, DWORD nStyle )
108 {
109 	SetWindowLong( hWnd, GWL_STYLE, nStyle );
110 }
111 
112 inline DWORD GetWindowStyle( HWND hWnd )
113 {
114 	return GetWindowLong( hWnd, GWL_STYLE );
115 }
116 
117 inline void SetWindowExStyle( HWND hWnd, DWORD nStyle )
118 {
119 	SetWindowLong( hWnd, GWL_EXSTYLE, nStyle );
120 }
121 
122 inline DWORD GetWindowExStyle( HWND hWnd )
123 {
124 	return GetWindowLong( hWnd, GWL_EXSTYLE );
125 }
126 
127 inline BOOL IsMinimized( HWND hWnd )
128 {
129 	return IsIconic( hWnd );
130 }
131 
132 inline BOOL IsMaximized( HWND hWnd )
133 {
134 	return IsZoomed( hWnd );
135 }
136 
137 inline void SetWindowFont( HWND hWnd, HFONT hFont, BOOL bRedraw )
138 {
139 	SendMessage( hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM((UINT)bRedraw,0) );
140 }
141 
142 inline HFONT GetWindowFont( HWND hWnd )
143 {
144 	return (HFONT)(UINT)SendMessage( hWnd, WM_GETFONT, 0, 0 );
145 }
146 
147 inline void SetClassCursor( HWND hWnd, HCURSOR hCursor )
148 {
149 	SetClassLong( hWnd, GCL_HCURSOR, (DWORD)hCursor );
150 }
151 
152 inline HCURSOR GetClassCursor( HWND hWnd )
153 {
154 	return (HCURSOR)GetClassLong( hWnd, GCL_HCURSOR );
155 }
156 
157 inline void SetClassIcon( HWND hWnd, HICON hIcon )
158 {
159 	SetClassLong( hWnd, GCL_HICON, (DWORD)hIcon );
160 }
161 
162 inline HICON GetClassIcon( HWND hWnd )
163 {
164 	return (HICON)GetClassLong( hWnd, GCL_HICON );
165 }
166 
167 inline HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush )
168 {
169 	return (HBRUSH)SetClassLong( hWnd, GCL_HBRBACKGROUND, (DWORD)hBrush );
170 }
171 
172 inline HBRUSH GetClassBrush( HWND hWnd )
173 {
174 	return (HBRUSH)GetClassLong( hWnd, GCL_HBRBACKGROUND );
175 }
176 
177 inline HINSTANCE GetWindowInstance( HWND hWnd )
178 {
179 	return (HINSTANCE)GetWindowLong( hWnd, GWL_HINSTANCE );
180 }
181 
182 // ------------------------
183 // - ZMouse Erweiterungen -
184 // ------------------------
185 
186 #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
187 
188 #define MOUSEZ_CLASSNAME  "MouseZ"            // wheel window class
189 #define MOUSEZ_TITLE	  "Magellan MSWHEEL"  // wheel window title
190 
191 #define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
192 #define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
193 
194 #define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
195 
196 #ifndef WHEEL_DELTA
197 #define WHEEL_DELTA 				120
198 #endif
199 #ifndef WM_MOUSEWHEEL
200 #define WM_MOUSEWHEEL				0x020A
201 #endif
202 #ifndef SPI_GETWHEELSCROLLLINES
203 #define SPI_GETWHEELSCROLLLINES		104
204 #endif
205 #ifndef SPI_SETWHEELSCROLLLINES
206 #define SPI_SETWHEELSCROLLLINES		105
207 #endif
208 #ifndef WHEEL_PAGESCROLL
209 #define WHEEL_PAGESCROLL			(UINT_MAX)
210 #endif
211 
212 
213 // -----------------------------
214 // - SystemAgent Erweiterungen -
215 // -----------------------------
216 
217 #define ENABLE_AGENT			1
218 #define DISABLE_AGENT			2
219 #define GET_AGENT_STATUS		3
220 typedef int (APIENTRY* SysAgt_Enable_PROC)( int );
221 
222 // ---------------------
223 // - 5.0-Erweiterungen -
224 // ---------------------
225 
226 #ifndef COLOR_GRADIENTACTIVECAPTION
227 #define COLOR_GRADIENTACTIVECAPTION 	27
228 #endif
229 #ifndef COLOR_GRADIENTINACTIVECAPTION
230 #define COLOR_GRADIENTINACTIVECAPTION	28
231 #endif
232 
233 #ifndef SPI_GETFLATMENU
234 #define SPI_GETFLATMENU     0x1022
235 #endif
236 #ifndef COLOR_MENUBAR
237 #define COLOR_MENUBAR       30
238 #endif
239 #ifndef COLOR_MENUHILIGHT
240 #define COLOR_MENUHILIGHT   29
241 #endif
242 
243 #ifndef CS_DROPSHADOW
244 #define CS_DROPSHADOW       0x00020000
245 #endif
246 
247 // -------------------------------------------------------
248 // MT 12/03: From winuser.h, only needed in salframe.cxx
249 // Better change salframe.cxx to include winuser.h
250 // -------------------------------------------------------
251 
252 #define WS_EX_LAYERED           0x00080000
253 
254 #ifndef WM_UNICHAR
255 #define WM_UNICHAR              0x0109
256 #define UNICODE_NOCHAR          0xFFFF
257 #endif
258 
259 #endif // _SV_WINCOMP_HXX
260