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