merge the formfield patch from ooo-build
[ooovba.git] / sal / inc / systools / win32 / user9x.h
blob6480e58229119e6f766075105556cf9d4907bf36
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: user9x.h,v $
10 * $Revision: 1.12 $
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 #pragma once
33 #ifndef _WINDOWS_
34 #include <windows.h>
35 #endif
37 #ifdef __cplusplus
38 extern "C"{
39 #endif
41 //------------------------------------------------------------------------
42 // undefine the macros defined in the winuser.h file in order to avoid
43 // warnings because of multiple defines
44 //------------------------------------------------------------------------
46 #ifdef SendMessageW
47 #undef SendMessageW
48 #endif
50 #ifdef CreateWindowExW
51 #undef CreateWindowExW
52 #endif
54 #ifdef RegisterClassExW
55 #undef RegisterClassExW
56 #endif
58 #ifdef UnregisterClassW
59 #undef UnregisterClassW
60 #endif
62 #ifdef RegisterClipboardFormatW
63 #undef RegisterClipboardFormatW
64 #endif
66 #ifdef GetClipboardFormatNameW
67 #undef GetClipboardFormatNameW
68 #endif
70 #ifdef SetWindowTextW
71 #undef SetWindowTextW
72 #endif
74 #ifdef GetWindowTextW
75 #undef GetWindowTextW
76 #endif
78 #ifdef InsertMenuItemW
79 #undef InsertMenuItemW
80 #endif
82 #ifndef DrawTextW
83 #undef DrawTextW
84 #endif
86 //------------------------------------------------------------------------
87 // defines
88 //------------------------------------------------------------------------
90 #define USER9X_API extern
92 //------------------------------------------------------------------------
93 // declare function pointers to the appropriate user32 functions
94 //------------------------------------------------------------------------
96 USER9X_API LRESULT ( WINAPI * lpfnSendMessageW) (
97 HWND hWnd, // handle to the destination window
98 UINT Msg, // message
99 WPARAM wParam, // first message parameter
100 LPARAM lParam // second message parameter
103 USER9X_API HWND ( WINAPI * lpfnCreateWindowExW ) (
104 DWORD dwExStyle, // extended window style
105 LPCWSTR lpClassName, // registered class name
106 LPCWSTR lpWindowName, // window name
107 DWORD dwStyle, // window style
108 int x, // horizontal position of window
109 int y, // vertical position of window
110 int nWidth, // window width
111 int nHeight, // window height
112 HWND hWndParent, // handle to parent or owner window
113 HMENU hMenu, // menu handle or child identifier
114 HINSTANCE hInstance, // handle to application instance
115 LPVOID lpParam // window-creation data
118 USER9X_API ATOM ( WINAPI * lpfnRegisterClassExW ) (
119 CONST WNDCLASSEXW* lpwcx // class data
122 USER9X_API BOOL ( WINAPI * lpfnUnregisterClassW ) (
123 LPCWSTR lpClassName, // class name
124 HINSTANCE hInstance // handle to application instance
127 USER9X_API UINT (WINAPI * lpfnRegisterClipboardFormatW) (
128 LPCWSTR lpszFormat // name of new format
131 USER9X_API int ( WINAPI * lpfnGetClipboardFormatNameW ) (
132 UINT format, // clipboard format to retrieve
133 LPWSTR lpszFormatName, // format name
134 int cchMaxCount // length of format name buffer
137 USER9X_API BOOL ( WINAPI * lpfnSetWindowTextW ) (
138 HWND hWnd,
139 LPCWSTR lpString
142 USER9X_API int ( WINAPI * lpfnGetWindowTextW ) (
143 HWND hWnd, // handle to the window or control
144 LPWSTR lpString, // text buffer
145 int nMaxCount // length of text buffer
148 USER9X_API BOOL ( WINAPI * lpfnInsertMenuItemW ) (
149 HMENU hMenu, // handle to menu
150 UINT uItem, // identifier or position
151 BOOL fByPosition, // meaning of uItem
152 LPCMENUITEMINFOW lpmii // menu item information
155 USER9X_API int ( WINAPI * lpfnDrawTextW ) (
156 HDC hDC, // handle to DC
157 LPCWSTR lpString, // text to draw
158 int nCount, // text length
159 LPRECT lpRect, // formatting dimensions
160 UINT uFormat // text-drawing options
163 USER9X_API BOOL ( WINAPI * lpfnDrawStateW ) (
164 HDC hdc, // handle to device context
165 HBRUSH hbr, // handle to brush
166 DRAWSTATEPROC lpOutputFunc, // callback function
167 LPARAM lData, // image information
168 WPARAM wData, // more image information
169 int x, // horizontal location
170 int y, // vertical location
171 int cx, // image width
172 int cy, // image height
173 UINT fuFlags // image type and state
176 //------------------------------------------------------------------------
177 // redefine the above undefined macros so that the preprocessor replaces
178 // all occurrences of this macros with our function pointer
179 //------------------------------------------------------------------------
181 #define SendMessageW lpfnSendMessageW
182 #define CreateWindowExW lpfnCreateWindowExW
183 #define RegisterClassExW lpfnRegisterClassExW
184 #define UnregisterClassW lpfnUnregisterClassW
185 #define RegisterClipboardFormatW lpfnRegisterClipboardFormatW
186 #define GetClipboardFormatNameW lpfnGetClipboardFormatNameW
187 #define SetWindowTextW lpfnSetWindowTextW
188 #define GetWindowTextW lpfnGetWindowTextW
189 #define InsertMenuItemW lpfnInsertMenuItemW
190 #define DrawTextW lpfnDrawTextW
191 #define DrawStateW lpfnDrawStateW
193 #ifdef __cplusplus
195 #endif