2 * Window procedure callbacks definitions
4 * Copyright 1996 Alexandre Julliard
7 #ifndef __WINE_WINPROC_H
8 #define __WINE_WINPROC_H
11 #include "wine/winbase16.h"
29 typedef void *HWINDOWPROC; /* Really a pointer to a WINDOWPROC */
45 extern BOOL WINPROC_Init(void);
46 extern WNDPROC16 WINPROC_GetProc( HWINDOWPROC proc, WINDOWPROCTYPE type );
47 extern BOOL WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC16 func,
48 WINDOWPROCTYPE type, WINDOWPROCUSER user );
49 extern void WINPROC_FreeProc( HWINDOWPROC proc, WINDOWPROCUSER user );
50 extern WINDOWPROCTYPE WINPROC_GetProcType( HWINDOWPROC proc );
52 extern INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam,
54 extern INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam,
56 extern INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16,
57 UINT *pmsg32, WPARAM *pwparam32,
59 extern INT WINPROC_MapMsg16To32W( HWND hwnd, UINT16 msg16, WPARAM16 wParam16,
60 UINT *pmsg32, WPARAM *pwparam32,
62 extern INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32,
63 WPARAM wParam32, UINT16 *pmsg16,
64 WPARAM16 *pwparam16, LPARAM *plparam );
65 extern INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32,
66 WPARAM wParam32, UINT16 *pmsg16,
67 WPARAM16 *pwparam16, LPARAM *plparam );
68 extern LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam,
69 LPARAM lParam, LRESULT result );
70 extern void WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam,
72 extern LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam,
73 LPARAM lParam, LRESULT result );
74 extern LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam,
75 LPARAM lParam, LRESULT result );
76 extern void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam,
77 LPARAM lParam, MSGPARAM16* pm16 );
78 extern void WINPROC_UnmapMsg32WTo16( HWND hwnd, UINT msg, WPARAM wParam,
79 LPARAM lParam, MSGPARAM16* pm16 );
81 /* map a Unicode string to a 16-bit pointer */
82 inline static SEGPTR map_str_32W_to_16( LPCWSTR str )
87 if (!HIWORD(str)) return (SEGPTR)LOWORD(str);
88 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
89 if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
90 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
94 /* unmap a Unicode string that was converted to a 16-bit pointer */
95 inline static void unmap_str_32W_to_16( SEGPTR str )
97 if (!HIWORD(str)) return;
98 HeapFree( GetProcessHeap(), 0, MapSL(str) );
102 /* map a 16-bit pointer to a Unicode string */
103 inline static LPWSTR map_str_16_to_32W( SEGPTR str )
108 if (!HIWORD(str)) return (LPWSTR)(ULONG_PTR)LOWORD(str);
109 len = MultiByteToWideChar( CP_ACP, 0, MapSL(str), -1, NULL, 0 );
110 if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
111 MultiByteToWideChar( CP_ACP, 0, MapSL(str), -1, ret, len );
115 /* unmap a 16-bit pointer that was converted to a Unicode string */
116 inline static void unmap_str_16_to_32W( LPCWSTR str )
118 if (HIWORD(str)) HeapFree( GetProcessHeap(), 0, (void *)str );
121 #endif /* __WINE_WINPROC_H */