2 * Window procedure callbacks definitions
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_WINPROC_H
22 #define __WINE_WINPROC_H
28 #include "wine/winbase16.h"
55 extern WNDPROC16
WINPROC_GetProc( WNDPROC proc
, WINDOWPROCTYPE type
);
56 extern WNDPROC
WINPROC_AllocProc( WNDPROC func
, WINDOWPROCTYPE type
);
57 extern WINDOWPROCTYPE
WINPROC_GetProcType( WNDPROC proc
);
59 extern INT
WINPROC_MapMsg32ATo32W( HWND hwnd
, UINT msg
, WPARAM
*pwparam
,
61 extern INT
WINPROC_MapMsg16To32A( HWND hwnd
, UINT16 msg16
, WPARAM16 wParam16
,
62 UINT
*pmsg32
, WPARAM
*pwparam32
,
64 extern INT
WINPROC_MapMsg16To32W( HWND hwnd
, UINT16 msg16
, WPARAM16 wParam16
,
65 UINT
*pmsg32
, WPARAM
*pwparam32
,
67 extern INT
WINPROC_MapMsg32ATo16( HWND hwnd
, UINT msg32
,
68 WPARAM wParam32
, UINT16
*pmsg16
,
69 WPARAM16
*pwparam16
, LPARAM
*plparam
);
70 extern INT
WINPROC_MapMsg32WTo16( HWND hwnd
, UINT msg32
,
71 WPARAM wParam32
, UINT16
*pmsg16
,
72 WPARAM16
*pwparam16
, LPARAM
*plparam
);
73 extern LRESULT
WINPROC_UnmapMsg32ATo32W( HWND hwnd
, UINT msg
, WPARAM wParam
,
74 LPARAM lParam
, LRESULT result
,
76 extern LRESULT
WINPROC_UnmapMsg16To32A( HWND hwnd
, UINT msg
, WPARAM wParam
,
77 LPARAM lParam
, LRESULT result
);
78 extern LRESULT
WINPROC_UnmapMsg16To32W( HWND hwnd
, UINT msg
, WPARAM wParam
,
79 LPARAM lParam
, LRESULT result
,
81 extern void WINPROC_UnmapMsg32ATo16( HWND hwnd
, UINT msg
, WPARAM wParam
,
82 LPARAM lParam
, MSGPARAM16
* pm16
);
83 extern void WINPROC_UnmapMsg32WTo16( HWND hwnd
, UINT msg
, WPARAM wParam
,
84 LPARAM lParam
, MSGPARAM16
* pm16
);
86 /* map a Unicode string to a 16-bit pointer */
87 inline static SEGPTR
map_str_32W_to_16( LPCWSTR str
)
92 if (!HIWORD(str
)) return (SEGPTR
)LOWORD(str
);
93 len
= WideCharToMultiByte( CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
94 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
)))
95 WideCharToMultiByte( CP_ACP
, 0, str
, -1, ret
, len
, NULL
, NULL
);
99 /* unmap a Unicode string that was converted to a 16-bit pointer */
100 inline static void unmap_str_32W_to_16( SEGPTR str
)
102 if (!HIWORD(str
)) return;
103 HeapFree( GetProcessHeap(), 0, MapSL(str
) );
107 /* map a 16-bit pointer to a Unicode string */
108 inline static LPWSTR
map_str_16_to_32W( SEGPTR str
)
113 if (!HIWORD(str
)) return (LPWSTR
)(ULONG_PTR
)LOWORD(str
);
114 len
= MultiByteToWideChar( CP_ACP
, 0, MapSL(str
), -1, NULL
, 0 );
115 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) )))
116 MultiByteToWideChar( CP_ACP
, 0, MapSL(str
), -1, ret
, len
);
120 /* unmap a 16-bit pointer that was converted to a Unicode string */
121 inline static void unmap_str_16_to_32W( LPCWSTR str
)
123 if (HIWORD(str
)) HeapFree( GetProcessHeap(), 0, (void *)str
);
127 /* Class functions */
128 struct tagCLASS
; /* opaque structure */
130 extern void CLASS_RegisterBuiltinClasses(void);
131 extern void CLASS_AddWindow( struct tagCLASS
*class, struct tagWND
*win
, WINDOWPROCTYPE type
);
132 extern void CLASS_FreeModuleClasses( HMODULE16 hModule
);
134 #endif /* __WINE_WINPROC_H */