xref: /aoo41x/main/sal/inc/systools/win32/user9x.h (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #pragma once
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #ifndef _WINDOWS_
31*cdf0e10cSrcweir #include <windows.h>
32*cdf0e10cSrcweir #endif
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #ifdef __cplusplus
35*cdf0e10cSrcweir extern "C"{
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir //------------------------------------------------------------------------
39*cdf0e10cSrcweir // undefine the macros defined in the winuser.h file in order to avoid
40*cdf0e10cSrcweir // warnings because of multiple defines
41*cdf0e10cSrcweir //------------------------------------------------------------------------
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir #ifdef SendMessageW
44*cdf0e10cSrcweir #undef SendMessageW
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir #ifdef CreateWindowExW
48*cdf0e10cSrcweir #undef CreateWindowExW
49*cdf0e10cSrcweir #endif
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir #ifdef RegisterClassExW
52*cdf0e10cSrcweir #undef RegisterClassExW
53*cdf0e10cSrcweir #endif
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir #ifdef UnregisterClassW
56*cdf0e10cSrcweir #undef UnregisterClassW
57*cdf0e10cSrcweir #endif
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir #ifdef RegisterClipboardFormatW
60*cdf0e10cSrcweir #undef RegisterClipboardFormatW
61*cdf0e10cSrcweir #endif
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir #ifdef GetClipboardFormatNameW
64*cdf0e10cSrcweir #undef GetClipboardFormatNameW
65*cdf0e10cSrcweir #endif
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir #ifdef SetWindowTextW
68*cdf0e10cSrcweir #undef SetWindowTextW
69*cdf0e10cSrcweir #endif
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir #ifdef GetWindowTextW
72*cdf0e10cSrcweir #undef GetWindowTextW
73*cdf0e10cSrcweir #endif
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir #ifdef InsertMenuItemW
76*cdf0e10cSrcweir #undef InsertMenuItemW
77*cdf0e10cSrcweir #endif
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir #ifndef DrawTextW
80*cdf0e10cSrcweir #undef DrawTextW
81*cdf0e10cSrcweir #endif
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir //------------------------------------------------------------------------
84*cdf0e10cSrcweir // defines
85*cdf0e10cSrcweir //------------------------------------------------------------------------
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir #define USER9X_API extern
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir //------------------------------------------------------------------------
90*cdf0e10cSrcweir // declare function pointers to the appropriate user32 functions
91*cdf0e10cSrcweir //------------------------------------------------------------------------
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir USER9X_API LRESULT ( WINAPI * lpfnSendMessageW) (
94*cdf0e10cSrcweir 	HWND hWnd,		// handle to the destination window
95*cdf0e10cSrcweir 	UINT Msg,		// message
96*cdf0e10cSrcweir 	WPARAM wParam,	// first message parameter
97*cdf0e10cSrcweir 	LPARAM lParam	// second message parameter
98*cdf0e10cSrcweir );
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir USER9X_API HWND ( WINAPI * lpfnCreateWindowExW ) (
101*cdf0e10cSrcweir 	DWORD dwExStyle,      // extended window style
102*cdf0e10cSrcweir 	LPCWSTR lpClassName,  // registered class name
103*cdf0e10cSrcweir 	LPCWSTR lpWindowName, // window name
104*cdf0e10cSrcweir 	DWORD dwStyle,        // window style
105*cdf0e10cSrcweir 	int x,                // horizontal position of window
106*cdf0e10cSrcweir 	int y,                // vertical position of window
107*cdf0e10cSrcweir 	int nWidth,           // window width
108*cdf0e10cSrcweir 	int nHeight,          // window height
109*cdf0e10cSrcweir 	HWND hWndParent,      // handle to parent or owner window
110*cdf0e10cSrcweir 	HMENU hMenu,          // menu handle or child identifier
111*cdf0e10cSrcweir 	HINSTANCE hInstance,  // handle to application instance
112*cdf0e10cSrcweir 	LPVOID lpParam        // window-creation data
113*cdf0e10cSrcweir );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir USER9X_API ATOM ( WINAPI * lpfnRegisterClassExW ) (
116*cdf0e10cSrcweir 	CONST WNDCLASSEXW* lpwcx // class data
117*cdf0e10cSrcweir );
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir USER9X_API BOOL ( WINAPI * lpfnUnregisterClassW ) (
120*cdf0e10cSrcweir 	LPCWSTR lpClassName, // class name
121*cdf0e10cSrcweir 	HINSTANCE hInstance	 // handle to application instance
122*cdf0e10cSrcweir );
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir USER9X_API UINT (WINAPI * lpfnRegisterClipboardFormatW) (
125*cdf0e10cSrcweir 	LPCWSTR lpszFormat // name of new format
126*cdf0e10cSrcweir );
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir USER9X_API int ( WINAPI * lpfnGetClipboardFormatNameW ) (
129*cdf0e10cSrcweir 	UINT   format,			// clipboard format to retrieve
130*cdf0e10cSrcweir 	LPWSTR lpszFormatName,	// format name
131*cdf0e10cSrcweir 	int    cchMaxCount		// length of format name buffer
132*cdf0e10cSrcweir );
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir USER9X_API BOOL ( WINAPI * lpfnSetWindowTextW ) (
135*cdf0e10cSrcweir 	HWND hWnd,
136*cdf0e10cSrcweir     LPCWSTR lpString
137*cdf0e10cSrcweir );
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir USER9X_API int ( WINAPI * lpfnGetWindowTextW ) (
140*cdf0e10cSrcweir     HWND hWnd,			// handle to the window or control
141*cdf0e10cSrcweir 	LPWSTR lpString,	// text buffer
142*cdf0e10cSrcweir 	int    nMaxCount		// length of text buffer
143*cdf0e10cSrcweir );
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir USER9X_API BOOL ( WINAPI * lpfnInsertMenuItemW ) (
146*cdf0e10cSrcweir     HMENU hMenu,            // handle to menu
147*cdf0e10cSrcweir     UINT uItem,             // identifier or position
148*cdf0e10cSrcweir     BOOL fByPosition,       // meaning of uItem
149*cdf0e10cSrcweir     LPCMENUITEMINFOW lpmii  // menu item information
150*cdf0e10cSrcweir );
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir USER9X_API int ( WINAPI * lpfnDrawTextW ) (
153*cdf0e10cSrcweir   HDC hDC,          // handle to DC
154*cdf0e10cSrcweir   LPCWSTR lpString, // text to draw
155*cdf0e10cSrcweir   int nCount,       // text length
156*cdf0e10cSrcweir   LPRECT lpRect,    // formatting dimensions
157*cdf0e10cSrcweir   UINT uFormat      // text-drawing options
158*cdf0e10cSrcweir );
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir USER9X_API BOOL ( WINAPI * lpfnDrawStateW ) (
161*cdf0e10cSrcweir   HDC hdc,                     // handle to device context
162*cdf0e10cSrcweir   HBRUSH hbr,                  // handle to brush
163*cdf0e10cSrcweir   DRAWSTATEPROC lpOutputFunc,  // callback function
164*cdf0e10cSrcweir   LPARAM lData,                // image information
165*cdf0e10cSrcweir   WPARAM wData,                // more image information
166*cdf0e10cSrcweir   int x,                       // horizontal location
167*cdf0e10cSrcweir   int y,                       // vertical location
168*cdf0e10cSrcweir   int cx,                      // image width
169*cdf0e10cSrcweir   int cy,                      // image height
170*cdf0e10cSrcweir   UINT fuFlags                 // image type and state
171*cdf0e10cSrcweir );
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir //------------------------------------------------------------------------
174*cdf0e10cSrcweir // redefine the above undefined macros so that the preprocessor replaces
175*cdf0e10cSrcweir // all occurrences of this macros with our function pointer
176*cdf0e10cSrcweir //------------------------------------------------------------------------
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir #define SendMessageW				lpfnSendMessageW
179*cdf0e10cSrcweir #define CreateWindowExW				lpfnCreateWindowExW
180*cdf0e10cSrcweir #define RegisterClassExW			lpfnRegisterClassExW
181*cdf0e10cSrcweir #define UnregisterClassW			lpfnUnregisterClassW
182*cdf0e10cSrcweir #define RegisterClipboardFormatW	lpfnRegisterClipboardFormatW
183*cdf0e10cSrcweir #define GetClipboardFormatNameW		lpfnGetClipboardFormatNameW
184*cdf0e10cSrcweir #define SetWindowTextW				lpfnSetWindowTextW
185*cdf0e10cSrcweir #define GetWindowTextW              lpfnGetWindowTextW
186*cdf0e10cSrcweir #define InsertMenuItemW				lpfnInsertMenuItemW
187*cdf0e10cSrcweir #define DrawTextW                   lpfnDrawTextW
188*cdf0e10cSrcweir #define DrawStateW                  lpfnDrawStateW
189*cdf0e10cSrcweir 
190*cdf0e10cSrcweir #ifdef __cplusplus
191*cdf0e10cSrcweir }
192*cdf0e10cSrcweir #endif
193