Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
/*
|
|
|
|
* Window procedure callbacks
|
|
|
|
*
|
|
|
|
* Copyright 1995 Martin von Loewis
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
*/
|
|
|
|
|
2001-10-14 18:18:52 +02:00
|
|
|
#include "config.h"
|
2002-04-25 23:40:56 +02:00
|
|
|
#include "wine/port.h"
|
2001-10-14 18:18:52 +02:00
|
|
|
|
2006-05-09 19:55:05 +02:00
|
|
|
#include <assert.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1999-08-15 14:45:01 +02:00
|
|
|
#include <string.h>
|
2000-12-02 21:11:42 +01:00
|
|
|
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
2000-12-03 00:42:13 +01:00
|
|
|
#include "winbase.h"
|
2002-10-17 18:43:42 +02:00
|
|
|
#include "wownt32.h"
|
1999-02-22 11:16:00 +01:00
|
|
|
#include "wine/winbase16.h"
|
1999-12-12 20:40:46 +01:00
|
|
|
#include "wine/winuser16.h"
|
2000-12-11 00:01:33 +01:00
|
|
|
#include "controls.h"
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
#include "win.h"
|
2004-12-08 19:06:14 +01:00
|
|
|
#include "user_private.h"
|
2002-05-21 20:03:15 +02:00
|
|
|
#include "dde.h"
|
2003-01-24 00:07:38 +01:00
|
|
|
#include "winternl.h"
|
2004-01-27 21:28:42 +01:00
|
|
|
#include "wine/unicode.h"
|
|
|
|
#include "wine/debug.h"
|
1996-05-21 17:01:41 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(msg);
|
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(relay);
|
2003-07-10 00:31:34 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(win);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1996-07-05 19:14:13 +02:00
|
|
|
typedef struct tagWINDOWPROC
|
|
|
|
{
|
2006-05-17 13:55:36 +02:00
|
|
|
WNDPROC16 proc16; /* 16-bit window proc */
|
|
|
|
WNDPROC procA; /* ASCII window proc */
|
|
|
|
WNDPROC procW; /* Unicode window proc */
|
1996-05-21 17:01:41 +02:00
|
|
|
} WINDOWPROC;
|
|
|
|
|
2006-05-09 20:24:19 +02:00
|
|
|
#define WINPROC_HANDLE (~0UL >> 16)
|
2006-05-17 13:55:36 +02:00
|
|
|
#define MAX_WINPROCS 8192
|
2007-08-02 17:08:48 +02:00
|
|
|
#define BUILTIN_WINPROCS 8 /* first BUILTIN_WINPROCS entries are reserved for builtin procs */
|
1996-07-05 19:14:13 +02:00
|
|
|
|
2007-10-18 03:55:55 +02:00
|
|
|
WNDPROC EDIT_winproc_handle = 0;
|
|
|
|
|
2003-07-10 00:31:34 +02:00
|
|
|
static WINDOWPROC winproc_array[MAX_WINPROCS];
|
2007-08-02 17:08:48 +02:00
|
|
|
static UINT builtin_used;
|
|
|
|
static UINT winproc_used = BUILTIN_WINPROCS;
|
2003-08-13 01:50:54 +02:00
|
|
|
|
|
|
|
static CRITICAL_SECTION winproc_cs;
|
|
|
|
static CRITICAL_SECTION_DEBUG critsect_debug =
|
|
|
|
{
|
|
|
|
0, 0, &winproc_cs,
|
|
|
|
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
2005-09-09 12:19:44 +02:00
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": winproc_cs") }
|
2003-08-13 01:50:54 +02:00
|
|
|
};
|
|
|
|
static CRITICAL_SECTION winproc_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
|
1997-05-09 10:40:27 +02:00
|
|
|
|
2006-05-20 18:48:04 +02:00
|
|
|
static inline void *get_buffer( void *static_buffer, size_t size, size_t need )
|
|
|
|
{
|
|
|
|
if (size >= need) return static_buffer;
|
|
|
|
return HeapAlloc( GetProcessHeap(), 0, need );
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void free_buffer( void *static_buffer, void *buffer )
|
|
|
|
{
|
|
|
|
if (buffer != static_buffer) HeapFree( GetProcessHeap(), 0, buffer );
|
|
|
|
}
|
|
|
|
|
2006-05-09 19:55:05 +02:00
|
|
|
/* find an existing winproc for a given 16-bit function and type */
|
2004-11-24 19:43:18 +01:00
|
|
|
/* FIXME: probably should do something more clever than a linear search */
|
2006-05-09 19:55:05 +02:00
|
|
|
static inline WINDOWPROC *find_winproc16( WNDPROC16 func )
|
2003-07-10 00:31:34 +02:00
|
|
|
{
|
2004-11-24 19:43:18 +01:00
|
|
|
unsigned int i;
|
|
|
|
|
2007-08-02 17:08:48 +02:00
|
|
|
for (i = BUILTIN_WINPROCS; i < winproc_used; i++)
|
2004-11-24 19:43:18 +01:00
|
|
|
{
|
2006-05-17 13:55:36 +02:00
|
|
|
if (winproc_array[i].proc16 == func) return &winproc_array[i];
|
2004-11-24 19:43:18 +01:00
|
|
|
}
|
2006-05-09 19:55:05 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find an existing winproc for a given function and type */
|
|
|
|
/* FIXME: probably should do something more clever than a linear search */
|
2006-05-17 13:55:36 +02:00
|
|
|
static inline WINDOWPROC *find_winproc( WNDPROC funcA, WNDPROC funcW )
|
2006-05-09 19:55:05 +02:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
2007-08-02 17:08:48 +02:00
|
|
|
for (i = 0; i < builtin_used; i++)
|
2004-11-24 19:43:18 +01:00
|
|
|
{
|
2007-07-12 15:45:00 +02:00
|
|
|
/* match either proc, some apps confuse A and W */
|
|
|
|
if (funcA && winproc_array[i].procA != funcA && winproc_array[i].procW != funcA) continue;
|
|
|
|
if (funcW && winproc_array[i].procA != funcW && winproc_array[i].procW != funcW) continue;
|
2006-05-17 13:55:36 +02:00
|
|
|
return &winproc_array[i];
|
2004-11-24 19:43:18 +01:00
|
|
|
}
|
2007-08-02 17:08:48 +02:00
|
|
|
for (i = BUILTIN_WINPROCS; i < winproc_used; i++)
|
|
|
|
{
|
|
|
|
if (funcA && winproc_array[i].procA != funcA) continue;
|
|
|
|
if (funcW && winproc_array[i].procW != funcW) continue;
|
|
|
|
return &winproc_array[i];
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-05-09 20:24:19 +02:00
|
|
|
/* return the window proc for a given handle, or NULL for an invalid handle */
|
|
|
|
static inline WINDOWPROC *handle_to_proc( WNDPROC handle )
|
|
|
|
{
|
|
|
|
UINT index = LOWORD(handle);
|
|
|
|
if ((ULONG_PTR)handle >> 16 != WINPROC_HANDLE) return NULL;
|
|
|
|
if (index >= winproc_used) return NULL;
|
|
|
|
return &winproc_array[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create a handle for a given window proc */
|
|
|
|
static inline WNDPROC proc_to_handle( WINDOWPROC *proc )
|
|
|
|
{
|
|
|
|
return (WNDPROC)(ULONG_PTR)((proc - winproc_array) | (WINPROC_HANDLE << 16));
|
|
|
|
}
|
|
|
|
|
2006-05-10 16:55:55 +02:00
|
|
|
/* allocate and initialize a new winproc */
|
2006-05-17 13:55:36 +02:00
|
|
|
static inline WINDOWPROC *alloc_winproc( WNDPROC funcA, WNDPROC funcW )
|
2006-05-10 16:55:55 +02:00
|
|
|
{
|
|
|
|
WINDOWPROC *proc;
|
|
|
|
|
|
|
|
/* check if the function is already a win proc */
|
2006-05-17 13:55:36 +02:00
|
|
|
if (funcA && (proc = handle_to_proc( funcA ))) return proc;
|
|
|
|
if (funcW && (proc = handle_to_proc( funcW ))) return proc;
|
|
|
|
if (!funcA && !funcW) return NULL;
|
2006-05-10 16:55:55 +02:00
|
|
|
|
|
|
|
EnterCriticalSection( &winproc_cs );
|
|
|
|
|
|
|
|
/* check if we already have a winproc for that function */
|
2006-05-17 13:55:36 +02:00
|
|
|
if (!(proc = find_winproc( funcA, funcW )))
|
2006-05-10 16:55:55 +02:00
|
|
|
{
|
2007-08-02 17:08:48 +02:00
|
|
|
if (funcA && funcW)
|
|
|
|
{
|
|
|
|
assert( builtin_used < BUILTIN_WINPROCS );
|
|
|
|
proc = &winproc_array[builtin_used++];
|
|
|
|
proc->procA = funcA;
|
|
|
|
proc->procW = funcW;
|
|
|
|
TRACE( "allocated %p for builtin %p/%p (%d/%d used)\n",
|
|
|
|
proc_to_handle(proc), funcA, funcW, builtin_used, BUILTIN_WINPROCS );
|
|
|
|
}
|
|
|
|
else if (winproc_used < MAX_WINPROCS)
|
2006-05-10 16:55:55 +02:00
|
|
|
{
|
2006-05-17 13:55:36 +02:00
|
|
|
proc = &winproc_array[winproc_used++];
|
|
|
|
proc->procA = funcA;
|
|
|
|
proc->procW = funcW;
|
2007-08-02 17:08:48 +02:00
|
|
|
TRACE( "allocated %p for %c %p (%d/%d used)\n",
|
|
|
|
proc_to_handle(proc), funcA ? 'A' : 'W', funcA ? funcA : funcW,
|
|
|
|
winproc_used, MAX_WINPROCS );
|
2006-05-10 16:55:55 +02:00
|
|
|
}
|
2006-05-17 13:55:36 +02:00
|
|
|
else FIXME( "too many winprocs, cannot allocate one for %p/%p\n", funcA, funcW );
|
2006-05-10 16:55:55 +02:00
|
|
|
}
|
2006-05-17 13:55:36 +02:00
|
|
|
else TRACE( "reusing %p for %p/%p\n", proc_to_handle(proc), funcA, funcW );
|
2006-05-10 16:55:55 +02:00
|
|
|
|
|
|
|
LeaveCriticalSection( &winproc_cs );
|
|
|
|
return proc;
|
|
|
|
}
|
|
|
|
|
1996-05-21 17:01:41 +02:00
|
|
|
|
2006-05-17 13:51:37 +02:00
|
|
|
#ifdef __i386__
|
|
|
|
|
|
|
|
#include "pshpack1.h"
|
|
|
|
|
|
|
|
/* Window procedure 16-to-32-bit thunk */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE popl_eax; /* popl %eax (return address) */
|
|
|
|
BYTE pushl_func; /* pushl $proc */
|
|
|
|
WINDOWPROC *proc;
|
|
|
|
BYTE pushl_eax; /* pushl %eax */
|
|
|
|
BYTE ljmp; /* ljmp relay*/
|
|
|
|
DWORD relay_offset; /* __wine_call_wndproc */
|
|
|
|
WORD relay_sel;
|
|
|
|
} WINPROC_THUNK;
|
|
|
|
|
|
|
|
#include "poppack.h"
|
|
|
|
|
|
|
|
#define MAX_THUNKS (0x10000 / sizeof(WINPROC_THUNK))
|
|
|
|
|
|
|
|
static WINPROC_THUNK *thunk_array;
|
|
|
|
static UINT thunk_selector;
|
|
|
|
static UINT thunk_used;
|
|
|
|
|
|
|
|
/* return the window proc for a given handle, or NULL for an invalid handle */
|
|
|
|
static inline WINDOWPROC *handle16_to_proc( WNDPROC16 handle )
|
|
|
|
{
|
|
|
|
if (HIWORD(handle) == thunk_selector)
|
|
|
|
{
|
|
|
|
UINT index = LOWORD(handle) / sizeof(WINPROC_THUNK);
|
|
|
|
/* check alignment */
|
|
|
|
if (index * sizeof(WINPROC_THUNK) != LOWORD(handle)) return NULL;
|
|
|
|
/* check array limits */
|
|
|
|
if (index >= thunk_used) return NULL;
|
|
|
|
return thunk_array[index].proc;
|
|
|
|
}
|
|
|
|
return handle_to_proc( (WNDPROC)handle );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* allocate a 16-bit thunk for an existing window proc */
|
|
|
|
static WNDPROC16 alloc_win16_thunk( WINDOWPROC *proc )
|
|
|
|
{
|
|
|
|
static FARPROC16 relay;
|
|
|
|
UINT i;
|
|
|
|
|
2006-05-17 13:55:36 +02:00
|
|
|
if (proc->proc16) return proc->proc16;
|
|
|
|
|
2006-05-17 13:51:37 +02:00
|
|
|
EnterCriticalSection( &winproc_cs );
|
|
|
|
|
|
|
|
if (!thunk_array) /* allocate the array and its selector */
|
|
|
|
{
|
|
|
|
LDT_ENTRY entry;
|
|
|
|
|
|
|
|
if (!(thunk_selector = wine_ldt_alloc_entries(1))) goto done;
|
|
|
|
if (!(thunk_array = VirtualAlloc( NULL, MAX_THUNKS * sizeof(WINPROC_THUNK), MEM_COMMIT,
|
|
|
|
PAGE_EXECUTE_READWRITE ))) goto done;
|
|
|
|
wine_ldt_set_base( &entry, thunk_array );
|
|
|
|
wine_ldt_set_limit( &entry, MAX_THUNKS * sizeof(WINPROC_THUNK) - 1 );
|
|
|
|
wine_ldt_set_flags( &entry, WINE_LDT_FLAGS_CODE | WINE_LDT_FLAGS_32BIT );
|
|
|
|
wine_ldt_set_entry( thunk_selector, &entry );
|
|
|
|
relay = GetProcAddress16( GetModuleHandle16("user"), "__wine_call_wndproc" );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check if it already exists */
|
|
|
|
for (i = 0; i < thunk_used; i++) if (thunk_array[i].proc == proc) break;
|
|
|
|
|
|
|
|
if (i == thunk_used) /* create a new one */
|
|
|
|
{
|
|
|
|
WINPROC_THUNK *thunk;
|
|
|
|
|
|
|
|
if (thunk_used >= MAX_THUNKS) goto done;
|
|
|
|
thunk = &thunk_array[thunk_used++];
|
|
|
|
thunk->popl_eax = 0x58; /* popl %eax */
|
|
|
|
thunk->pushl_func = 0x68; /* pushl $proc */
|
|
|
|
thunk->proc = proc;
|
|
|
|
thunk->pushl_eax = 0x50; /* pushl %eax */
|
|
|
|
thunk->ljmp = 0xea; /* ljmp relay*/
|
|
|
|
thunk->relay_offset = OFFSETOF(relay);
|
|
|
|
thunk->relay_sel = SELECTOROF(relay);
|
|
|
|
}
|
2006-05-17 13:55:36 +02:00
|
|
|
proc->proc16 = (WNDPROC16)MAKESEGPTR( thunk_selector, i * sizeof(WINPROC_THUNK) );
|
2006-05-17 13:51:37 +02:00
|
|
|
done:
|
|
|
|
LeaveCriticalSection( &winproc_cs );
|
2006-05-17 13:55:36 +02:00
|
|
|
return proc->proc16;
|
2006-05-17 13:51:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#else /* __i386__ */
|
|
|
|
|
|
|
|
static inline WINDOWPROC *handle16_to_proc( WNDPROC16 handle )
|
|
|
|
{
|
|
|
|
return handle_to_proc( (WNDPROC)handle );
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline WNDPROC16 alloc_win16_thunk( WINDOWPROC *proc )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __i386__ */
|
|
|
|
|
|
|
|
|
2000-07-16 22:29:44 +02:00
|
|
|
#ifdef __i386__
|
|
|
|
/* Some window procedures modify register they shouldn't, or are not
|
|
|
|
* properly declared stdcall; so we need a small assembly wrapper to
|
|
|
|
* call them. */
|
|
|
|
extern LRESULT WINPROC_wrapper( WNDPROC proc, HWND hwnd, UINT msg,
|
|
|
|
WPARAM wParam, LPARAM lParam );
|
|
|
|
__ASM_GLOBAL_FUNC( WINPROC_wrapper,
|
|
|
|
"pushl %ebp\n\t"
|
|
|
|
"movl %esp,%ebp\n\t"
|
|
|
|
"pushl %edi\n\t"
|
|
|
|
"pushl %esi\n\t"
|
|
|
|
"pushl %ebx\n\t"
|
2005-11-23 19:55:06 +01:00
|
|
|
"subl $12,%esp\n\t"
|
2000-07-16 22:29:44 +02:00
|
|
|
"pushl 24(%ebp)\n\t"
|
|
|
|
"pushl 20(%ebp)\n\t"
|
|
|
|
"pushl 16(%ebp)\n\t"
|
|
|
|
"pushl 12(%ebp)\n\t"
|
|
|
|
"movl 8(%ebp),%eax\n\t"
|
|
|
|
"call *%eax\n\t"
|
|
|
|
"leal -12(%ebp),%esp\n\t"
|
|
|
|
"popl %ebx\n\t"
|
|
|
|
"popl %esi\n\t"
|
|
|
|
"popl %edi\n\t"
|
|
|
|
"leave\n\t"
|
2007-01-13 00:38:07 +01:00
|
|
|
"ret" )
|
2000-07-16 22:29:44 +02:00
|
|
|
#else
|
|
|
|
static inline LRESULT WINPROC_wrapper( WNDPROC proc, HWND hwnd, UINT msg,
|
|
|
|
WPARAM wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
return proc( hwnd, msg, wParam, lParam );
|
|
|
|
}
|
|
|
|
#endif /* __i386__ */
|
|
|
|
|
2006-05-26 13:31:55 +02:00
|
|
|
static void RECT16to32( const RECT16 *from, RECT *to )
|
|
|
|
{
|
|
|
|
to->left = from->left;
|
|
|
|
to->top = from->top;
|
|
|
|
to->right = from->right;
|
|
|
|
to->bottom = from->bottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void RECT32to16( const RECT *from, RECT16 *to )
|
|
|
|
{
|
|
|
|
to->left = from->left;
|
|
|
|
to->top = from->top;
|
|
|
|
to->right = from->right;
|
|
|
|
to->bottom = from->bottom;
|
|
|
|
}
|
2004-08-30 21:32:08 +02:00
|
|
|
|
|
|
|
static void MINMAXINFO32to16( const MINMAXINFO *from, MINMAXINFO16 *to )
|
|
|
|
{
|
|
|
|
to->ptReserved.x = from->ptReserved.x;
|
|
|
|
to->ptReserved.y = from->ptReserved.y;
|
|
|
|
to->ptMaxSize.x = from->ptMaxSize.x;
|
|
|
|
to->ptMaxSize.y = from->ptMaxSize.y;
|
|
|
|
to->ptMaxPosition.x = from->ptMaxPosition.x;
|
|
|
|
to->ptMaxPosition.y = from->ptMaxPosition.y;
|
|
|
|
to->ptMinTrackSize.x = from->ptMinTrackSize.x;
|
|
|
|
to->ptMinTrackSize.y = from->ptMinTrackSize.y;
|
|
|
|
to->ptMaxTrackSize.x = from->ptMaxTrackSize.x;
|
|
|
|
to->ptMaxTrackSize.y = from->ptMaxTrackSize.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void MINMAXINFO16to32( const MINMAXINFO16 *from, MINMAXINFO *to )
|
|
|
|
{
|
|
|
|
to->ptReserved.x = from->ptReserved.x;
|
|
|
|
to->ptReserved.y = from->ptReserved.y;
|
|
|
|
to->ptMaxSize.x = from->ptMaxSize.x;
|
|
|
|
to->ptMaxSize.y = from->ptMaxSize.y;
|
|
|
|
to->ptMaxPosition.x = from->ptMaxPosition.x;
|
|
|
|
to->ptMaxPosition.y = from->ptMaxPosition.y;
|
|
|
|
to->ptMinTrackSize.x = from->ptMinTrackSize.x;
|
|
|
|
to->ptMinTrackSize.y = from->ptMinTrackSize.y;
|
|
|
|
to->ptMaxTrackSize.x = from->ptMaxTrackSize.x;
|
|
|
|
to->ptMaxTrackSize.y = from->ptMaxTrackSize.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINDOWPOS32to16( const WINDOWPOS* from, WINDOWPOS16* to )
|
|
|
|
{
|
|
|
|
to->hwnd = HWND_16(from->hwnd);
|
|
|
|
to->hwndInsertAfter = HWND_16(from->hwndInsertAfter);
|
|
|
|
to->x = from->x;
|
|
|
|
to->y = from->y;
|
|
|
|
to->cx = from->cx;
|
|
|
|
to->cy = from->cy;
|
|
|
|
to->flags = from->flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINDOWPOS16to32( const WINDOWPOS16* from, WINDOWPOS* to )
|
|
|
|
{
|
|
|
|
to->hwnd = WIN_Handle32(from->hwnd);
|
|
|
|
to->hwndInsertAfter = (from->hwndInsertAfter == (HWND16)-1) ?
|
|
|
|
HWND_TOPMOST : WIN_Handle32(from->hwndInsertAfter);
|
|
|
|
to->x = from->x;
|
|
|
|
to->y = from->y;
|
|
|
|
to->cx = from->cx;
|
|
|
|
to->cy = from->cy;
|
|
|
|
to->flags = from->flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The strings are not copied */
|
|
|
|
static void CREATESTRUCT32Ato16( const CREATESTRUCTA* from, CREATESTRUCT16* to )
|
|
|
|
{
|
|
|
|
to->lpCreateParams = (SEGPTR)from->lpCreateParams;
|
|
|
|
to->hInstance = HINSTANCE_16(from->hInstance);
|
|
|
|
to->hMenu = HMENU_16(from->hMenu);
|
|
|
|
to->hwndParent = HWND_16(from->hwndParent);
|
|
|
|
to->cy = from->cy;
|
|
|
|
to->cx = from->cx;
|
|
|
|
to->y = from->y;
|
|
|
|
to->x = from->x;
|
|
|
|
to->style = from->style;
|
|
|
|
to->dwExStyle = from->dwExStyle;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void CREATESTRUCT16to32A( const CREATESTRUCT16* from, CREATESTRUCTA *to )
|
|
|
|
|
|
|
|
{
|
|
|
|
to->lpCreateParams = (LPVOID)from->lpCreateParams;
|
|
|
|
to->hInstance = HINSTANCE_32(from->hInstance);
|
|
|
|
to->hMenu = HMENU_32(from->hMenu);
|
|
|
|
to->hwndParent = WIN_Handle32(from->hwndParent);
|
|
|
|
to->cy = from->cy;
|
|
|
|
to->cx = from->cx;
|
|
|
|
to->y = from->y;
|
|
|
|
to->x = from->x;
|
|
|
|
to->style = from->style;
|
|
|
|
to->dwExStyle = from->dwExStyle;
|
2006-05-26 13:21:31 +02:00
|
|
|
to->lpszName = MapSL(from->lpszName);
|
|
|
|
to->lpszClass = MapSL(from->lpszClass);
|
2004-08-30 21:32:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The strings are not copied */
|
|
|
|
static void MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from, MDICREATESTRUCT16* to )
|
|
|
|
{
|
|
|
|
to->hOwner = HINSTANCE_16(from->hOwner);
|
|
|
|
to->x = from->x;
|
|
|
|
to->y = from->y;
|
|
|
|
to->cx = from->cx;
|
|
|
|
to->cy = from->cy;
|
|
|
|
to->style = from->style;
|
|
|
|
to->lParam = from->lParam;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from, MDICREATESTRUCTA *to )
|
|
|
|
{
|
|
|
|
to->hOwner = HINSTANCE_32(from->hOwner);
|
|
|
|
to->x = from->x;
|
|
|
|
to->y = from->y;
|
|
|
|
to->cx = from->cx;
|
|
|
|
to->cy = from->cy;
|
|
|
|
to->style = from->style;
|
|
|
|
to->lParam = from->lParam;
|
2006-05-26 13:21:31 +02:00
|
|
|
to->szTitle = MapSL(from->szTitle);
|
|
|
|
to->szClass = MapSL(from->szClass);
|
2004-08-30 21:32:08 +02:00
|
|
|
}
|
|
|
|
|
2006-05-18 16:31:36 +02:00
|
|
|
static WPARAM map_wparam_char_WtoA( WPARAM wParam, DWORD len )
|
|
|
|
{
|
|
|
|
WCHAR wch = wParam;
|
|
|
|
BYTE ch[2];
|
|
|
|
|
|
|
|
RtlUnicodeToMultiByteN( (LPSTR)ch, len, &len, &wch, sizeof(wch) );
|
|
|
|
if (len == 2)
|
|
|
|
return MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wParam) );
|
|
|
|
else
|
|
|
|
return MAKEWPARAM( ch[0], HIWORD(wParam) );
|
|
|
|
}
|
|
|
|
|
2006-05-18 18:05:01 +02:00
|
|
|
/* call a 32-bit window procedure */
|
|
|
|
static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
WNDPROC proc = arg;
|
|
|
|
|
|
|
|
USER_CheckNotLock();
|
|
|
|
|
|
|
|
hwnd = WIN_GetFullHandle( hwnd );
|
|
|
|
if (TRACE_ON(relay))
|
2007-05-24 16:41:17 +02:00
|
|
|
DPRINTF( "%04x:Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
|
2006-05-18 18:05:01 +02:00
|
|
|
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
|
|
|
|
|
|
|
|
*result = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
|
|
|
|
|
|
|
|
if (TRACE_ON(relay))
|
2007-05-24 16:41:17 +02:00
|
|
|
DPRINTF( "%04x:Ret window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx\n",
|
2006-05-18 18:05:01 +02:00
|
|
|
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, *result );
|
|
|
|
return *result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* call a 32-bit dialog procedure */
|
|
|
|
static LRESULT call_dialog_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
WNDPROC proc = arg;
|
|
|
|
LRESULT ret;
|
|
|
|
|
|
|
|
USER_CheckNotLock();
|
|
|
|
|
|
|
|
hwnd = WIN_GetFullHandle( hwnd );
|
|
|
|
if (TRACE_ON(relay))
|
2007-05-24 16:41:17 +02:00
|
|
|
DPRINTF( "%04x:Call dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
|
2006-05-18 18:05:01 +02:00
|
|
|
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
|
|
|
|
|
|
|
|
ret = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
|
|
|
|
*result = GetWindowLongPtrW( hwnd, DWLP_MSGRESULT );
|
|
|
|
|
|
|
|
if (TRACE_ON(relay))
|
2007-05-24 16:41:17 +02:00
|
|
|
DPRINTF( "%04x:Ret dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx result=%08lx\n",
|
2006-05-18 18:05:01 +02:00
|
|
|
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, ret, *result );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-05-18 19:44:30 +02:00
|
|
|
/* call a 16-bit window procedure */
|
|
|
|
static LRESULT call_window_proc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam,
|
|
|
|
LRESULT *result, void *arg )
|
1999-08-15 14:45:01 +02:00
|
|
|
{
|
2006-05-18 19:44:30 +02:00
|
|
|
WNDPROC16 proc = arg;
|
1999-08-15 14:45:01 +02:00
|
|
|
CONTEXT86 context;
|
2005-05-16 16:20:16 +02:00
|
|
|
size_t size = 0;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
WORD params[5];
|
|
|
|
union
|
|
|
|
{
|
|
|
|
CREATESTRUCT16 cs16;
|
|
|
|
DRAWITEMSTRUCT16 dis16;
|
|
|
|
COMPAREITEMSTRUCT16 cis16;
|
|
|
|
} u;
|
|
|
|
} args;
|
2005-03-23 14:18:51 +01:00
|
|
|
|
|
|
|
USER_CheckNotLock();
|
1999-08-15 14:45:01 +02:00
|
|
|
|
|
|
|
/* Window procedures want ax = hInstance, ds = es = ss */
|
|
|
|
|
2003-11-05 01:46:44 +01:00
|
|
|
memset(&context, 0, sizeof(context));
|
2005-05-14 14:16:46 +02:00
|
|
|
context.SegDs = context.SegEs = SELECTOROF(NtCurrentTeb()->WOW32Reserved);
|
2003-11-05 01:46:44 +01:00
|
|
|
context.SegFs = wine_get_fs();
|
|
|
|
context.SegGs = wine_get_gs();
|
2004-09-22 21:14:08 +02:00
|
|
|
if (!(context.Eax = GetWindowWord( HWND_32(hwnd), GWLP_HINSTANCE ))) context.Eax = context.SegDs;
|
2000-09-26 01:53:07 +02:00
|
|
|
context.SegCs = SELECTOROF(proc);
|
|
|
|
context.Eip = OFFSETOF(proc);
|
2007-10-17 14:18:06 +02:00
|
|
|
context.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME, bp);
|
1999-08-15 14:45:01 +02:00
|
|
|
|
|
|
|
if (lParam)
|
|
|
|
{
|
|
|
|
/* Some programs (eg. the "Undocumented Windows" examples, JWP) only
|
|
|
|
work if structures passed in lParam are placed in the stack/data
|
|
|
|
segment. Programmers easily make the mistake of converting lParam
|
|
|
|
to a near rather than a far pointer, since Windows apparently
|
|
|
|
allows this. We copy the structures to the 16 bit stack; this is
|
|
|
|
ugly but makes these programs work. */
|
|
|
|
switch (msg)
|
|
|
|
{
|
|
|
|
case WM_CREATE:
|
|
|
|
case WM_NCCREATE:
|
2005-05-16 16:20:16 +02:00
|
|
|
size = sizeof(CREATESTRUCT16); break;
|
1999-08-15 14:45:01 +02:00
|
|
|
case WM_DRAWITEM:
|
2005-05-16 16:20:16 +02:00
|
|
|
size = sizeof(DRAWITEMSTRUCT16); break;
|
1999-08-15 14:45:01 +02:00
|
|
|
case WM_COMPAREITEM:
|
2005-05-16 16:20:16 +02:00
|
|
|
size = sizeof(COMPAREITEMSTRUCT16); break;
|
1999-08-15 14:45:01 +02:00
|
|
|
}
|
2005-05-16 16:20:16 +02:00
|
|
|
if (size)
|
1999-08-15 14:45:01 +02:00
|
|
|
{
|
2005-05-16 16:20:16 +02:00
|
|
|
memcpy( &args.u, MapSL(lParam), size );
|
2007-05-30 12:32:24 +02:00
|
|
|
lParam = PtrToUlong(NtCurrentTeb()->WOW32Reserved) - size;
|
1999-08-15 14:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-16 16:20:16 +02:00
|
|
|
args.params[4] = hwnd;
|
|
|
|
args.params[3] = msg;
|
|
|
|
args.params[2] = wParam;
|
|
|
|
args.params[1] = HIWORD(lParam);
|
|
|
|
args.params[0] = LOWORD(lParam);
|
|
|
|
WOWCallback16Ex( 0, WCB16_REGS, sizeof(args.params) + size, &args, (DWORD *)&context );
|
2006-05-18 19:44:30 +02:00
|
|
|
*result = MAKELONG( LOWORD(context.Eax), LOWORD(context.Edx) );
|
|
|
|
return *result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* call a 16-bit dialog procedure */
|
|
|
|
static LRESULT call_dialog_proc16( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
LRESULT ret = call_window_proc16( hwnd, msg, wp, lp, result, arg );
|
|
|
|
*result = GetWindowLongPtrW( WIN_Handle32(hwnd), DWLP_MSGRESULT );
|
|
|
|
return LOWORD(ret);
|
1999-08-15 14:45:01 +02:00
|
|
|
}
|
|
|
|
|
2006-05-23 20:33:14 +02:00
|
|
|
/* helper callback for 32W->16 conversion */
|
|
|
|
static LRESULT call_window_proc_Ato16( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
return WINPROC_CallProc32ATo16( call_window_proc16, hwnd, msg, wp, lp, result, arg );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* helper callback for 32W->16 conversion */
|
|
|
|
static LRESULT call_dialog_proc_Ato16( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
return WINPROC_CallProc32ATo16( call_dialog_proc16, hwnd, msg, wp, lp, result, arg );
|
|
|
|
}
|
|
|
|
|
2006-05-23 20:38:41 +02:00
|
|
|
/* helper callback for 16->32W conversion */
|
|
|
|
static LRESULT call_window_proc_AtoW( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
2007-08-08 18:25:38 +02:00
|
|
|
return WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wp, lp, result,
|
|
|
|
arg, WMCHAR_MAP_CALLWINDOWPROC );
|
2006-05-23 20:38:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* helper callback for 16->32W conversion */
|
|
|
|
static LRESULT call_dialog_proc_AtoW( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
2007-08-08 18:25:38 +02:00
|
|
|
return WINPROC_CallProcAtoW( call_dialog_proc, hwnd, msg, wp, lp, result,
|
|
|
|
arg, WMCHAR_MAP_CALLWINDOWPROC );
|
2006-05-23 20:38:41 +02:00
|
|
|
}
|
|
|
|
|
1997-05-09 10:40:27 +02:00
|
|
|
|
2006-05-09 18:40:46 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_GetProc16
|
|
|
|
*
|
|
|
|
* Get a window procedure pointer that can be passed to the Windows program.
|
|
|
|
*/
|
2006-05-10 16:55:55 +02:00
|
|
|
WNDPROC16 WINPROC_GetProc16( WNDPROC proc, BOOL unicode )
|
2006-05-09 18:40:46 +02:00
|
|
|
{
|
2006-05-17 13:55:36 +02:00
|
|
|
WINDOWPROC *ptr;
|
2006-05-09 18:40:46 +02:00
|
|
|
|
2006-05-17 13:55:36 +02:00
|
|
|
if (unicode) ptr = alloc_winproc( NULL, proc );
|
|
|
|
else ptr = alloc_winproc( proc, NULL );
|
2006-05-09 18:40:46 +02:00
|
|
|
|
2006-05-17 13:55:36 +02:00
|
|
|
if (!ptr) return 0;
|
|
|
|
return alloc_win16_thunk( ptr );
|
2006-05-09 18:40:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-05-21 17:01:41 +02:00
|
|
|
/**********************************************************************
|
1996-07-05 19:14:13 +02:00
|
|
|
* WINPROC_GetProc
|
1996-05-21 17:01:41 +02:00
|
|
|
*
|
1996-07-05 19:14:13 +02:00
|
|
|
* Get a window procedure pointer that can be passed to the Windows program.
|
1996-05-21 17:01:41 +02:00
|
|
|
*/
|
2006-05-10 13:20:34 +02:00
|
|
|
WNDPROC WINPROC_GetProc( WNDPROC proc, BOOL unicode )
|
1996-05-21 17:01:41 +02:00
|
|
|
{
|
2006-05-09 20:24:19 +02:00
|
|
|
WINDOWPROC *ptr = handle_to_proc( proc );
|
2001-12-05 23:23:02 +01:00
|
|
|
|
2006-05-17 13:55:36 +02:00
|
|
|
if (!ptr) return proc;
|
|
|
|
if (unicode)
|
|
|
|
{
|
|
|
|
if (ptr->procW) return ptr->procW;
|
|
|
|
return proc;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ptr->procA) return ptr->procA;
|
|
|
|
return proc;
|
|
|
|
}
|
1996-05-21 17:01:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-09 19:55:05 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_AllocProc16
|
|
|
|
*
|
|
|
|
* Allocate a window procedure for a window or class.
|
|
|
|
*
|
|
|
|
* Note that allocated winprocs are never freed; the idea is that even if an app creates a
|
|
|
|
* lot of windows, it will usually only have a limited number of window procedures, so the
|
|
|
|
* array won't grow too large, and this way we avoid the need to track allocations per window.
|
|
|
|
*/
|
|
|
|
WNDPROC WINPROC_AllocProc16( WNDPROC16 func )
|
|
|
|
{
|
|
|
|
WINDOWPROC *proc;
|
|
|
|
|
|
|
|
if (!func) return NULL;
|
|
|
|
|
|
|
|
/* check if the function is already a win proc */
|
2006-05-09 20:24:19 +02:00
|
|
|
if (!(proc = handle16_to_proc( func )))
|
2006-05-09 19:55:05 +02:00
|
|
|
{
|
2006-05-10 15:50:18 +02:00
|
|
|
EnterCriticalSection( &winproc_cs );
|
|
|
|
|
2006-05-09 19:55:05 +02:00
|
|
|
/* then check if we already have a winproc for that function */
|
|
|
|
if (!(proc = find_winproc16( func )))
|
|
|
|
{
|
2006-05-17 13:55:36 +02:00
|
|
|
if (winproc_used < MAX_WINPROCS)
|
2006-05-09 19:55:05 +02:00
|
|
|
{
|
2006-05-17 13:55:36 +02:00
|
|
|
proc = &winproc_array[winproc_used++];
|
|
|
|
proc->proc16 = func;
|
2006-05-09 19:55:05 +02:00
|
|
|
TRACE( "allocated %p for %p/16-bit (%d/%d used)\n",
|
2006-05-09 20:24:19 +02:00
|
|
|
proc_to_handle(proc), func, winproc_used, MAX_WINPROCS );
|
2006-05-09 19:55:05 +02:00
|
|
|
}
|
2006-05-10 15:50:18 +02:00
|
|
|
else FIXME( "too many winprocs, cannot allocate one for 16-bit %p\n", func );
|
2006-05-09 19:55:05 +02:00
|
|
|
}
|
2006-05-09 20:24:19 +02:00
|
|
|
else TRACE( "reusing %p for %p/16-bit\n", proc_to_handle(proc), func );
|
2006-05-09 19:55:05 +02:00
|
|
|
|
2006-05-10 15:50:18 +02:00
|
|
|
LeaveCriticalSection( &winproc_cs );
|
|
|
|
}
|
2006-05-09 20:24:19 +02:00
|
|
|
return proc_to_handle( proc );
|
2006-05-09 19:55:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-05-21 17:01:41 +02:00
|
|
|
/**********************************************************************
|
2004-11-24 19:43:18 +01:00
|
|
|
* WINPROC_AllocProc
|
1997-03-29 18:20:20 +01:00
|
|
|
*
|
2004-11-24 19:43:18 +01:00
|
|
|
* Allocate a window procedure for a window or class.
|
1997-03-29 18:20:20 +01:00
|
|
|
*
|
2004-11-24 19:43:18 +01:00
|
|
|
* Note that allocated winprocs are never freed; the idea is that even if an app creates a
|
|
|
|
* lot of windows, it will usually only have a limited number of window procedures, so the
|
|
|
|
* array won't grow too large, and this way we avoid the need to track allocations per window.
|
1996-05-21 17:01:41 +02:00
|
|
|
*/
|
2006-05-17 13:55:36 +02:00
|
|
|
WNDPROC WINPROC_AllocProc( WNDPROC funcA, WNDPROC funcW )
|
1996-05-21 17:01:41 +02:00
|
|
|
{
|
2004-11-24 19:43:18 +01:00
|
|
|
WINDOWPROC *proc;
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
|
2006-05-17 13:55:36 +02:00
|
|
|
if (!(proc = alloc_winproc( funcA, funcW ))) return NULL;
|
2006-05-09 20:24:19 +02:00
|
|
|
return proc_to_handle( proc );
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2006-05-10 13:27:21 +02:00
|
|
|
* WINPROC_IsUnicode
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
*
|
2006-05-10 13:27:21 +02:00
|
|
|
* Return the window procedure type, or the default value if not a winproc handle.
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
*/
|
2006-05-10 13:27:21 +02:00
|
|
|
BOOL WINPROC_IsUnicode( WNDPROC proc, BOOL def_val )
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
{
|
2006-05-09 20:24:19 +02:00
|
|
|
WINDOWPROC *ptr = handle_to_proc( proc );
|
|
|
|
|
2006-05-10 13:27:21 +02:00
|
|
|
if (!ptr) return def_val;
|
2006-05-17 13:55:36 +02:00
|
|
|
if (ptr->procA && ptr->procW) return def_val; /* can be both */
|
|
|
|
return (ptr->procW != NULL);
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
}
|
2006-05-09 20:24:19 +02:00
|
|
|
|
|
|
|
|
1998-11-08 17:28:49 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_TestLBForStr
|
|
|
|
*
|
|
|
|
* Return TRUE if the lparam is a string
|
|
|
|
*/
|
2007-03-17 11:34:08 +01:00
|
|
|
static inline BOOL WINPROC_TestLBForStr( HWND hwnd, UINT msg )
|
1999-03-14 18:25:32 +01:00
|
|
|
{
|
2001-08-29 02:16:00 +02:00
|
|
|
DWORD style = GetWindowLongA( hwnd, GWL_STYLE );
|
2006-05-18 12:43:40 +02:00
|
|
|
if (msg <= CB_MSGMAX)
|
|
|
|
return (!(style & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) || (style & CBS_HASSTRINGS));
|
|
|
|
else
|
|
|
|
return (!(style & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) || (style & LBS_HASSTRINGS));
|
1999-03-14 18:25:32 +01:00
|
|
|
|
1998-11-08 17:28:49 +01:00
|
|
|
}
|
1996-05-21 17:01:41 +02:00
|
|
|
|
1996-07-05 19:14:13 +02:00
|
|
|
|
2007-05-30 12:32:24 +02:00
|
|
|
static UINT_PTR convert_handle_16_to_32(HANDLE16 src, unsigned int flags)
|
2002-05-21 20:03:15 +02:00
|
|
|
{
|
2005-04-25 13:33:34 +02:00
|
|
|
HANDLE dst;
|
|
|
|
UINT sz = GlobalSize16(src);
|
|
|
|
LPSTR ptr16, ptr32;
|
2002-05-21 20:03:15 +02:00
|
|
|
|
|
|
|
if (!(dst = GlobalAlloc(flags, sz)))
|
2005-04-25 13:33:34 +02:00
|
|
|
return 0;
|
2002-05-21 20:03:15 +02:00
|
|
|
ptr16 = GlobalLock16(src);
|
|
|
|
ptr32 = GlobalLock(dst);
|
|
|
|
if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr32, ptr16, sz);
|
|
|
|
GlobalUnlock16(src);
|
|
|
|
GlobalUnlock(dst);
|
|
|
|
|
2007-05-30 12:32:24 +02:00
|
|
|
return (UINT_PTR)dst;
|
2002-05-21 20:03:15 +02:00
|
|
|
}
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
|
2007-05-30 12:32:24 +02:00
|
|
|
static HANDLE16 convert_handle_32_to_16(UINT_PTR src, unsigned int flags)
|
2002-05-21 20:03:15 +02:00
|
|
|
{
|
2005-04-25 13:33:34 +02:00
|
|
|
HANDLE16 dst;
|
|
|
|
UINT sz = GlobalSize((HANDLE)src);
|
|
|
|
LPSTR ptr16, ptr32;
|
2002-05-21 20:03:15 +02:00
|
|
|
|
|
|
|
if (!(dst = GlobalAlloc16(flags, sz)))
|
2005-04-25 13:33:34 +02:00
|
|
|
return 0;
|
2002-11-22 21:43:01 +01:00
|
|
|
ptr32 = GlobalLock((HANDLE)src);
|
2002-05-21 20:03:15 +02:00
|
|
|
ptr16 = GlobalLock16(dst);
|
|
|
|
if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr16, ptr32, sz);
|
2002-11-22 21:43:01 +01:00
|
|
|
GlobalUnlock((HANDLE)src);
|
2002-05-21 20:03:15 +02:00
|
|
|
GlobalUnlock16(dst);
|
|
|
|
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
1996-07-05 19:14:13 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
2006-05-18 19:09:32 +02:00
|
|
|
* WINPROC_CallProcAtoW
|
1996-07-05 19:14:13 +02:00
|
|
|
*
|
|
|
|
* Call a window procedure, translating args from Ansi to Unicode.
|
|
|
|
*/
|
2006-05-18 19:47:40 +02:00
|
|
|
LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, WPARAM wParam,
|
2007-08-08 18:25:38 +02:00
|
|
|
LPARAM lParam, LRESULT *result, void *arg, enum wm_char_mapping mapping )
|
1996-07-05 19:14:13 +02:00
|
|
|
{
|
2006-05-20 18:48:04 +02:00
|
|
|
LRESULT ret = 0;
|
1996-07-05 19:14:13 +02:00
|
|
|
|
2007-05-24 16:41:17 +02:00
|
|
|
TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
|
2006-05-18 19:09:32 +02:00
|
|
|
hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
|
2002-04-02 04:53:08 +02:00
|
|
|
|
2006-05-20 18:48:04 +02:00
|
|
|
switch(msg)
|
|
|
|
{
|
|
|
|
case WM_NCCREATE:
|
|
|
|
case WM_CREATE:
|
|
|
|
{
|
|
|
|
WCHAR *ptr, buffer[512];
|
|
|
|
CREATESTRUCTA *csA = (CREATESTRUCTA *)lParam;
|
|
|
|
CREATESTRUCTW csW = *(CREATESTRUCTW *)csA;
|
|
|
|
MDICREATESTRUCTW mdi_cs;
|
|
|
|
DWORD name_lenA = 0, name_lenW = 0, class_lenA = 0, class_lenW = 0;
|
|
|
|
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csA->lpszClass))
|
2006-05-20 18:48:04 +02:00
|
|
|
{
|
|
|
|
class_lenA = strlen(csA->lpszClass) + 1;
|
|
|
|
RtlMultiByteToUnicodeSize( &class_lenW, csA->lpszClass, class_lenA );
|
|
|
|
}
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csA->lpszName))
|
2006-05-20 18:48:04 +02:00
|
|
|
{
|
|
|
|
name_lenA = strlen(csA->lpszName) + 1;
|
|
|
|
RtlMultiByteToUnicodeSize( &name_lenW, csA->lpszName, name_lenA );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), class_lenW + name_lenW ))) break;
|
|
|
|
|
|
|
|
if (class_lenW)
|
|
|
|
{
|
|
|
|
csW.lpszClass = ptr;
|
|
|
|
RtlMultiByteToUnicodeN( ptr, class_lenW, NULL, csA->lpszClass, class_lenA );
|
|
|
|
}
|
|
|
|
if (name_lenW)
|
|
|
|
{
|
|
|
|
csW.lpszName = ptr + class_lenW/sizeof(WCHAR);
|
|
|
|
RtlMultiByteToUnicodeN( ptr + class_lenW/sizeof(WCHAR), name_lenW, NULL,
|
|
|
|
csA->lpszName, name_lenA );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_MDICHILD)
|
|
|
|
{
|
|
|
|
mdi_cs = *(MDICREATESTRUCTW *)csA->lpCreateParams;
|
|
|
|
mdi_cs.szTitle = csW.lpszName;
|
|
|
|
mdi_cs.szClass = csW.lpszClass;
|
|
|
|
csW.lpCreateParams = &mdi_cs;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)&csW, result, arg );
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-20 18:49:40 +02:00
|
|
|
|
|
|
|
case WM_MDICREATE:
|
|
|
|
{
|
|
|
|
WCHAR *ptr, buffer[512];
|
|
|
|
DWORD title_lenA = 0, title_lenW = 0, class_lenA = 0, class_lenW = 0;
|
|
|
|
MDICREATESTRUCTA *csA = (MDICREATESTRUCTA *)lParam;
|
|
|
|
MDICREATESTRUCTW csW;
|
|
|
|
|
|
|
|
memcpy( &csW, csA, sizeof(csW) );
|
|
|
|
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csA->szTitle))
|
2006-05-20 18:49:40 +02:00
|
|
|
{
|
|
|
|
title_lenA = strlen(csA->szTitle) + 1;
|
|
|
|
RtlMultiByteToUnicodeSize( &title_lenW, csA->szTitle, title_lenA );
|
|
|
|
}
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csA->szClass))
|
2006-05-20 18:49:40 +02:00
|
|
|
{
|
|
|
|
class_lenA = strlen(csA->szClass) + 1;
|
|
|
|
RtlMultiByteToUnicodeSize( &class_lenW, csA->szClass, class_lenA );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), title_lenW + class_lenW ))) break;
|
|
|
|
|
|
|
|
if (title_lenW)
|
|
|
|
{
|
|
|
|
csW.szTitle = ptr;
|
|
|
|
RtlMultiByteToUnicodeN( ptr, title_lenW, NULL, csA->szTitle, title_lenA );
|
|
|
|
}
|
|
|
|
if (class_lenW)
|
|
|
|
{
|
|
|
|
csW.szClass = ptr + title_lenW/sizeof(WCHAR);
|
|
|
|
RtlMultiByteToUnicodeN( ptr + title_lenW/sizeof(WCHAR), class_lenW, NULL,
|
|
|
|
csA->szClass, class_lenA );
|
|
|
|
}
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)&csW, result, arg );
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-20 18:53:16 +02:00
|
|
|
|
|
|
|
case WM_GETTEXT:
|
|
|
|
case WM_ASKCBFORMATNAME:
|
|
|
|
{
|
|
|
|
WCHAR *ptr, buffer[512];
|
|
|
|
LPSTR str = (LPSTR)lParam;
|
|
|
|
DWORD len = wParam * sizeof(WCHAR);
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), len ))) break;
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
|
2007-03-22 12:08:21 +01:00
|
|
|
if (wParam)
|
2006-05-20 18:53:16 +02:00
|
|
|
{
|
2007-03-22 12:08:21 +01:00
|
|
|
len = 0;
|
|
|
|
if (*result)
|
|
|
|
RtlUnicodeToMultiByteN( str, wParam - 1, &len, ptr, strlenW(ptr) * sizeof(WCHAR) );
|
2006-05-20 18:53:16 +02:00
|
|
|
str[len] = 0;
|
|
|
|
*result = len;
|
|
|
|
}
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-20 18:54:25 +02:00
|
|
|
|
|
|
|
case LB_ADDSTRING:
|
|
|
|
case LB_INSERTSTRING:
|
|
|
|
case LB_FINDSTRING:
|
|
|
|
case LB_FINDSTRINGEXACT:
|
|
|
|
case LB_SELECTSTRING:
|
|
|
|
case CB_ADDSTRING:
|
|
|
|
case CB_INSERTSTRING:
|
|
|
|
case CB_FINDSTRING:
|
|
|
|
case CB_FINDSTRINGEXACT:
|
|
|
|
case CB_SELECTSTRING:
|
|
|
|
if (!lParam || !WINPROC_TestLBForStr( hwnd, msg ))
|
|
|
|
{
|
|
|
|
ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* fall through */
|
|
|
|
case WM_SETTEXT:
|
|
|
|
case WM_WININICHANGE:
|
|
|
|
case WM_DEVMODECHANGE:
|
|
|
|
case CB_DIR:
|
|
|
|
case LB_DIR:
|
|
|
|
case LB_ADDFILE:
|
|
|
|
case EM_REPLACESEL:
|
|
|
|
if (!lParam) ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WCHAR *ptr, buffer[512];
|
|
|
|
LPCSTR strA = (LPCSTR)lParam;
|
|
|
|
DWORD lenW, lenA = strlen(strA) + 1;
|
|
|
|
|
|
|
|
RtlMultiByteToUnicodeSize( &lenW, strA, lenA );
|
|
|
|
if ((ptr = get_buffer( buffer, sizeof(buffer), lenW )))
|
|
|
|
{
|
|
|
|
RtlMultiByteToUnicodeN( ptr, lenW, NULL, strA, lenA );
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2006-05-20 18:55:34 +02:00
|
|
|
|
|
|
|
case LB_GETTEXT:
|
|
|
|
case CB_GETLBTEXT:
|
|
|
|
if (lParam && WINPROC_TestLBForStr( hwnd, msg ))
|
|
|
|
{
|
|
|
|
WCHAR buffer[512]; /* FIXME: fixed sized buffer */
|
|
|
|
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)buffer, result, arg );
|
|
|
|
if (*result >= 0)
|
|
|
|
{
|
|
|
|
DWORD len;
|
|
|
|
RtlUnicodeToMultiByteN( (LPSTR)lParam, ~0u, &len,
|
|
|
|
buffer, (strlenW(buffer) + 1) * sizeof(WCHAR) );
|
|
|
|
*result = len - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
2006-05-20 18:48:04 +02:00
|
|
|
|
2006-05-20 18:57:11 +02:00
|
|
|
case EM_GETLINE:
|
|
|
|
{
|
|
|
|
WCHAR *ptr, buffer[512];
|
|
|
|
WORD len = *(WORD *)lParam;
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), len * sizeof(WCHAR) ))) break;
|
|
|
|
*((WORD *)ptr) = len; /* store the length */
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
|
|
|
|
if (*result)
|
|
|
|
{
|
|
|
|
DWORD reslen;
|
|
|
|
RtlUnicodeToMultiByteN( (LPSTR)lParam, len, &reslen, ptr, *result * sizeof(WCHAR) );
|
|
|
|
if (reslen < len) ((LPSTR)lParam)[reslen] = 0;
|
|
|
|
*result = reslen;
|
|
|
|
}
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
2006-05-20 18:57:36 +02:00
|
|
|
break;
|
|
|
|
|
2006-05-22 12:29:02 +02:00
|
|
|
case WM_GETDLGCODE:
|
|
|
|
if (lParam)
|
|
|
|
{
|
|
|
|
MSG newmsg = *(MSG *)lParam;
|
2007-08-08 18:25:38 +02:00
|
|
|
if (map_wparam_AtoW( newmsg.message, &newmsg.wParam, WMCHAR_MAP_NOMAPPING ))
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)&newmsg, result, arg );
|
2006-05-22 12:29:02 +02:00
|
|
|
}
|
|
|
|
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
|
2006-05-20 18:57:36 +02:00
|
|
|
case WM_CHARTOITEM:
|
|
|
|
case WM_MENUCHAR:
|
|
|
|
case WM_CHAR:
|
|
|
|
case WM_DEADCHAR:
|
|
|
|
case WM_SYSCHAR:
|
|
|
|
case WM_SYSDEADCHAR:
|
|
|
|
case EM_SETPASSWORDCHAR:
|
|
|
|
case WM_IME_CHAR:
|
2007-08-08 18:25:38 +02:00
|
|
|
if (map_wparam_AtoW( msg, &wParam, mapping ))
|
|
|
|
ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
2006-05-20 19:58:38 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_GETTEXTLENGTH:
|
|
|
|
case CB_GETLBTEXTLEN:
|
|
|
|
case LB_GETTEXTLEN:
|
|
|
|
ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
if (*result >= 0)
|
|
|
|
{
|
|
|
|
WCHAR *ptr, buffer[512];
|
|
|
|
LRESULT tmp;
|
|
|
|
DWORD len = *result + 1;
|
|
|
|
/* Determine respective GETTEXT message */
|
|
|
|
UINT msgGetText = (msg == WM_GETTEXTLENGTH) ? WM_GETTEXT :
|
|
|
|
((msg == CB_GETLBTEXTLEN) ? CB_GETLBTEXT : LB_GETTEXT);
|
|
|
|
/* wParam differs between the messages */
|
|
|
|
WPARAM wp = (msg == WM_GETTEXTLENGTH) ? len : wParam;
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), len * sizeof(WCHAR) ))) break;
|
|
|
|
|
|
|
|
if (callback == call_window_proc) /* FIXME: hack */
|
|
|
|
callback( hwnd, msgGetText, wp, (LPARAM)ptr, &tmp, arg );
|
|
|
|
else
|
|
|
|
tmp = SendMessageW( hwnd, msgGetText, wp, (LPARAM)ptr );
|
|
|
|
RtlUnicodeToMultiByteSize( &len, ptr, tmp * sizeof(WCHAR) );
|
|
|
|
*result = len;
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
2006-05-20 18:57:11 +02:00
|
|
|
break;
|
|
|
|
|
2006-05-20 19:59:19 +02:00
|
|
|
case WM_PAINTCLIPBOARD:
|
|
|
|
case WM_SIZECLIPBOARD:
|
|
|
|
FIXME_(msg)( "message %s (0x%x) needs translation, please report\n",
|
|
|
|
SPY_GetMsgName(msg, hwnd), msg );
|
|
|
|
break;
|
|
|
|
|
2006-05-20 18:48:04 +02:00
|
|
|
default:
|
|
|
|
ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
}
|
2006-05-17 20:53:51 +02:00
|
|
|
return ret;
|
1996-07-05 19:14:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-02-20 06:14:48 +01:00
|
|
|
/**********************************************************************
|
2006-05-18 18:05:01 +02:00
|
|
|
* WINPROC_CallProcWtoA
|
2004-02-20 06:14:48 +01:00
|
|
|
*
|
2006-05-18 11:02:28 +02:00
|
|
|
* Call a window procedure, translating args from Unicode to Ansi.
|
2004-02-20 06:14:48 +01:00
|
|
|
*/
|
2006-05-18 18:05:01 +02:00
|
|
|
static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UINT msg, WPARAM wParam,
|
|
|
|
LPARAM lParam, LRESULT *result, void *arg )
|
2004-02-20 06:14:48 +01:00
|
|
|
{
|
2006-05-18 11:02:28 +02:00
|
|
|
LRESULT ret = 0;
|
|
|
|
|
2007-05-24 16:41:17 +02:00
|
|
|
TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
|
2006-05-18 18:05:01 +02:00
|
|
|
hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
|
2006-05-18 11:02:28 +02:00
|
|
|
|
2004-02-20 06:14:48 +01:00
|
|
|
switch(msg)
|
|
|
|
{
|
|
|
|
case WM_NCCREATE:
|
|
|
|
case WM_CREATE:
|
2007-11-06 13:58:05 +01:00
|
|
|
{
|
|
|
|
char buffer[1024], *cls;
|
2004-02-20 06:14:48 +01:00
|
|
|
CREATESTRUCTW *csW = (CREATESTRUCTW *)lParam;
|
|
|
|
CREATESTRUCTA csA = *(CREATESTRUCTA *)csW;
|
2006-01-19 12:43:45 +01:00
|
|
|
MDICREATESTRUCTA mdi_cs;
|
2007-11-06 13:58:05 +01:00
|
|
|
DWORD name_lenA = 0, name_lenW = 0, class_lenA = 0, class_lenW = 0;
|
2004-02-20 06:14:48 +01:00
|
|
|
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csW->lpszClass))
|
|
|
|
{
|
|
|
|
class_lenW = (strlenW(csW->lpszClass) + 1) * sizeof(WCHAR);
|
|
|
|
RtlUnicodeToMultiByteSize(&class_lenA, csW->lpszClass, class_lenW);
|
|
|
|
}
|
|
|
|
if (!IS_INTRESOURCE(csW->lpszName))
|
2004-02-20 06:14:48 +01:00
|
|
|
{
|
2007-11-06 13:58:05 +01:00
|
|
|
name_lenW = (strlenW(csW->lpszName) + 1) * sizeof(WCHAR);
|
2004-02-20 06:14:48 +01:00
|
|
|
RtlUnicodeToMultiByteSize(&name_lenA, csW->lpszName, name_lenW);
|
|
|
|
}
|
|
|
|
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!(cls = get_buffer( buffer, sizeof(buffer), class_lenA + name_lenA ))) break;
|
2004-02-20 06:14:48 +01:00
|
|
|
|
2007-11-06 13:58:05 +01:00
|
|
|
if (class_lenA)
|
|
|
|
{
|
|
|
|
RtlUnicodeToMultiByteN(cls, class_lenA, NULL, csW->lpszClass, class_lenW);
|
|
|
|
csA.lpszClass = cls;
|
|
|
|
}
|
|
|
|
if (name_lenA)
|
2004-02-20 06:14:48 +01:00
|
|
|
{
|
2007-11-06 13:58:05 +01:00
|
|
|
char *name = cls + class_lenA;
|
2004-02-20 06:14:48 +01:00
|
|
|
RtlUnicodeToMultiByteN(name, name_lenA, NULL, csW->lpszName, name_lenW);
|
|
|
|
csA.lpszName = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_MDICHILD)
|
|
|
|
{
|
|
|
|
mdi_cs = *(MDICREATESTRUCTA *)csW->lpCreateParams;
|
|
|
|
mdi_cs.szTitle = csA.lpszName;
|
|
|
|
mdi_cs.szClass = csA.lpszClass;
|
|
|
|
csA.lpCreateParams = &mdi_cs;
|
|
|
|
}
|
|
|
|
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)&csA, result, arg );
|
2006-05-18 11:03:30 +02:00
|
|
|
free_buffer( buffer, cls );
|
2004-02-20 06:14:48 +01:00
|
|
|
}
|
2006-05-18 11:02:28 +02:00
|
|
|
break;
|
2004-02-20 06:14:48 +01:00
|
|
|
|
2006-05-18 11:22:55 +02:00
|
|
|
case WM_GETTEXT:
|
|
|
|
case WM_ASKCBFORMATNAME:
|
|
|
|
{
|
|
|
|
char *ptr, buffer[512];
|
|
|
|
DWORD len = wParam * 2;
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), len ))) break;
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
|
2007-03-22 12:08:21 +01:00
|
|
|
if (len)
|
2006-05-18 11:22:55 +02:00
|
|
|
{
|
2007-03-22 12:08:21 +01:00
|
|
|
if (*result)
|
|
|
|
{
|
|
|
|
RtlMultiByteToUnicodeN( (LPWSTR)lParam, wParam*sizeof(WCHAR), &len, ptr, strlen(ptr)+1 );
|
|
|
|
*result = len/sizeof(WCHAR) - 1; /* do not count terminating null */
|
|
|
|
}
|
2006-05-18 18:05:01 +02:00
|
|
|
((LPWSTR)lParam)[*result] = 0;
|
2006-05-18 11:22:55 +02:00
|
|
|
}
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-05-18 12:43:40 +02:00
|
|
|
case LB_ADDSTRING:
|
|
|
|
case LB_INSERTSTRING:
|
|
|
|
case LB_FINDSTRING:
|
|
|
|
case LB_FINDSTRINGEXACT:
|
|
|
|
case LB_SELECTSTRING:
|
|
|
|
case CB_ADDSTRING:
|
|
|
|
case CB_INSERTSTRING:
|
|
|
|
case CB_FINDSTRING:
|
|
|
|
case CB_FINDSTRINGEXACT:
|
|
|
|
case CB_SELECTSTRING:
|
|
|
|
if (!lParam || !WINPROC_TestLBForStr( hwnd, msg ))
|
|
|
|
{
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
2006-05-18 12:43:40 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* fall through */
|
2006-05-18 11:29:31 +02:00
|
|
|
case WM_SETTEXT:
|
|
|
|
case WM_WININICHANGE:
|
|
|
|
case WM_DEVMODECHANGE:
|
|
|
|
case CB_DIR:
|
|
|
|
case LB_DIR:
|
|
|
|
case LB_ADDFILE:
|
|
|
|
case EM_REPLACESEL:
|
2006-05-18 18:05:01 +02:00
|
|
|
if (!lParam) ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
2006-05-18 11:29:31 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
char *ptr, buffer[512];
|
|
|
|
LPCWSTR strW = (LPCWSTR)lParam;
|
|
|
|
DWORD lenA, lenW = (strlenW(strW) + 1) * sizeof(WCHAR);
|
|
|
|
|
|
|
|
RtlUnicodeToMultiByteSize( &lenA, strW, lenW );
|
|
|
|
if ((ptr = get_buffer( buffer, sizeof(buffer), lenA )))
|
|
|
|
{
|
|
|
|
RtlUnicodeToMultiByteN( ptr, lenA, NULL, strW, lenW );
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
|
2006-05-18 11:29:31 +02:00
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-05-18 11:37:41 +02:00
|
|
|
case WM_MDICREATE:
|
|
|
|
{
|
|
|
|
char *ptr, buffer[1024];
|
|
|
|
DWORD title_lenA = 0, title_lenW = 0, class_lenA = 0, class_lenW = 0;
|
|
|
|
MDICREATESTRUCTW *csW = (MDICREATESTRUCTW *)lParam;
|
|
|
|
MDICREATESTRUCTA csA;
|
|
|
|
|
|
|
|
memcpy( &csA, csW, sizeof(csA) );
|
|
|
|
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csW->szTitle))
|
2006-05-18 11:37:41 +02:00
|
|
|
{
|
|
|
|
title_lenW = (strlenW(csW->szTitle) + 1) * sizeof(WCHAR);
|
|
|
|
RtlUnicodeToMultiByteSize( &title_lenA, csW->szTitle, title_lenW );
|
|
|
|
}
|
2007-11-06 13:58:05 +01:00
|
|
|
if (!IS_INTRESOURCE(csW->szClass))
|
2006-05-18 11:37:41 +02:00
|
|
|
{
|
|
|
|
class_lenW = (strlenW(csW->szClass) + 1) * sizeof(WCHAR);
|
|
|
|
RtlUnicodeToMultiByteSize( &class_lenA, csW->szClass, class_lenW );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), title_lenA + class_lenA ))) break;
|
|
|
|
|
|
|
|
if (title_lenA)
|
|
|
|
{
|
|
|
|
RtlUnicodeToMultiByteN( ptr, title_lenA, NULL, csW->szTitle, title_lenW );
|
|
|
|
csA.szTitle = ptr;
|
|
|
|
}
|
|
|
|
if (class_lenA)
|
|
|
|
{
|
|
|
|
RtlUnicodeToMultiByteN( ptr + title_lenA, class_lenA, NULL, csW->szClass, class_lenW );
|
|
|
|
csA.szClass = ptr + title_lenA;
|
|
|
|
}
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)&csA, result, arg );
|
2006-05-18 11:37:41 +02:00
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-05-18 12:17:44 +02:00
|
|
|
case LB_GETTEXT:
|
|
|
|
case CB_GETLBTEXT:
|
2006-05-18 12:43:40 +02:00
|
|
|
if (lParam && WINPROC_TestLBForStr( hwnd, msg ))
|
2006-05-18 12:17:44 +02:00
|
|
|
{
|
|
|
|
char buffer[512]; /* FIXME: fixed sized buffer */
|
|
|
|
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)buffer, result, arg );
|
|
|
|
if (*result >= 0)
|
2006-05-18 12:17:44 +02:00
|
|
|
{
|
|
|
|
DWORD len;
|
|
|
|
RtlMultiByteToUnicodeN( (LPWSTR)lParam, ~0u, &len, buffer, strlen(buffer) + 1 );
|
2006-05-18 18:05:01 +02:00
|
|
|
*result = len / sizeof(WCHAR) - 1;
|
2006-05-18 12:17:44 +02:00
|
|
|
}
|
|
|
|
}
|
2006-05-18 18:05:01 +02:00
|
|
|
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
2006-05-18 12:17:44 +02:00
|
|
|
break;
|
|
|
|
|
2006-05-18 12:20:14 +02:00
|
|
|
case EM_GETLINE:
|
|
|
|
{
|
|
|
|
char *ptr, buffer[512];
|
|
|
|
WORD len = *(WORD *)lParam;
|
|
|
|
|
|
|
|
if (!(ptr = get_buffer( buffer, sizeof(buffer), len * 2 ))) break;
|
|
|
|
*((WORD *)ptr) = len * 2; /* store the length */
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
|
|
|
|
if (*result)
|
2006-05-18 12:20:14 +02:00
|
|
|
{
|
2006-05-18 18:05:01 +02:00
|
|
|
DWORD reslen;
|
2006-05-20 18:57:11 +02:00
|
|
|
RtlMultiByteToUnicodeN( (LPWSTR)lParam, len*sizeof(WCHAR), &reslen, ptr, *result );
|
2006-05-18 18:05:01 +02:00
|
|
|
*result = reslen / sizeof(WCHAR);
|
|
|
|
if (*result < len) ((LPWSTR)lParam)[*result] = 0;
|
2006-05-18 12:20:14 +02:00
|
|
|
}
|
|
|
|
free_buffer( buffer, ptr );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-05-22 12:29:02 +02:00
|
|
|
case WM_GETDLGCODE:
|
|
|
|
if (lParam)
|
|
|
|
{
|
|
|
|
MSG newmsg = *(MSG *)lParam;
|
|
|
|
switch(newmsg.message)
|
|
|
|
{
|
|
|
|
case WM_CHAR:
|
|
|
|
case WM_DEADCHAR:
|
|
|
|
case WM_SYSCHAR:
|
|
|
|
case WM_SYSDEADCHAR:
|
|
|
|
newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 1 );
|
|
|
|
break;
|
|
|
|
case WM_IME_CHAR:
|
|
|
|
newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 2 );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ret = callback( hwnd, msg, wParam, (LPARAM)&newmsg, result, arg );
|
|
|
|
}
|
|
|
|
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
|
2007-08-08 18:25:38 +02:00
|
|
|
case WM_CHAR:
|
|
|
|
{
|
|
|
|
WCHAR wch = wParam;
|
|
|
|
char ch[2];
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
RtlUnicodeToMultiByteN( ch, 2, &len, &wch, sizeof(wch) );
|
|
|
|
ret = callback( hwnd, msg, (BYTE)ch[0], lParam, result, arg );
|
|
|
|
if (len == 2) ret = callback( hwnd, msg, (BYTE)ch[1], lParam, result, arg );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-05-18 12:27:27 +02:00
|
|
|
case WM_CHARTOITEM:
|
|
|
|
case WM_MENUCHAR:
|
|
|
|
case WM_DEADCHAR:
|
|
|
|
case WM_SYSCHAR:
|
|
|
|
case WM_SYSDEADCHAR:
|
|
|
|
case EM_SETPASSWORDCHAR:
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, map_wparam_char_WtoA(wParam,1), lParam, result, arg );
|
2006-05-18 12:27:27 +02:00
|
|
|
break;
|
|
|
|
|
2006-05-18 12:28:07 +02:00
|
|
|
case WM_IME_CHAR:
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, map_wparam_char_WtoA(wParam,2), lParam, result, arg );
|
2006-05-18 12:28:07 +02:00
|
|
|
break;
|
|
|
|
|
2006-05-18 12:29:19 +02:00
|
|
|
case WM_PAINTCLIPBOARD:
|
|
|
|
case WM_SIZECLIPBOARD:
|
|
|
|
FIXME_(msg)( "message %s (%04x) needs translation, please report\n",
|
|
|
|
SPY_GetMsgName(msg, hwnd), msg );
|
|
|
|
break;
|
|
|
|
|
2004-02-20 06:14:48 +01:00
|
|
|
default:
|
2006-05-18 18:05:01 +02:00
|
|
|
ret = callback( hwnd, msg, wParam, lParam, result, arg );
|
2006-05-18 11:02:28 +02:00
|
|
|
break;
|
2006-05-17 20:53:51 +02:00
|
|
|
}
|
2006-05-18 11:02:28 +02:00
|
|
|
|
2006-05-17 20:53:51 +02:00
|
|
|
return ret;
|
1996-07-05 19:14:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2006-05-10 15:50:18 +02:00
|
|
|
* WINPROC_CallProc16To32A
|
1996-07-05 19:14:13 +02:00
|
|
|
*/
|
2006-05-20 16:32:45 +02:00
|
|
|
LRESULT WINPROC_CallProc16To32A( winproc_callback_t callback, HWND16 hwnd, UINT16 msg,
|
|
|
|
WPARAM16 wParam, LPARAM lParam, LRESULT *result, void *arg )
|
1996-07-05 19:14:13 +02:00
|
|
|
{
|
2006-05-26 13:21:31 +02:00
|
|
|
LRESULT ret = 0;
|
2001-09-19 22:37:04 +02:00
|
|
|
HWND hwnd32 = WIN_Handle32( hwnd );
|
1996-07-05 19:14:13 +02:00
|
|
|
|
2006-05-18 19:09:32 +02:00
|
|
|
TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
|
|
|
|
hwnd32, SPY_GetMsgName(msg, hwnd32), wParam, lParam);
|
2004-06-14 19:55:27 +02:00
|
|
|
|
2006-05-26 13:21:31 +02:00
|
|
|
switch(msg)
|
|
|
|
{
|
|
|
|
case WM_NCCREATE:
|
|
|
|
case WM_CREATE:
|
|
|
|
{
|
|
|
|
CREATESTRUCT16 *cs16 = MapSL(lParam);
|
|
|
|
CREATESTRUCTA cs;
|
|
|
|
MDICREATESTRUCTA mdi_cs;
|
2006-05-17 20:53:51 +02:00
|
|
|
|
2006-05-26 13:21:31 +02:00
|
|
|
CREATESTRUCT16to32A( cs16, &cs );
|
|
|
|
if (GetWindowLongW(hwnd32, GWL_EXSTYLE) & WS_EX_MDICHILD)
|
|
|
|
{
|
|
|
|
MDICREATESTRUCT16 *mdi_cs16 = MapSL(cs16->lpCreateParams);
|
|
|
|
MDICREATESTRUCT16to32A(mdi_cs16, &mdi_cs);
|
|
|
|
cs.lpCreateParams = &mdi_cs;
|
|
|
|
}
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&cs, result, arg );
|
|
|
|
CREATESTRUCT32Ato16( &cs, cs16 );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_MDICREATE:
|
|
|
|
{
|
|
|
|
MDICREATESTRUCT16 *cs16 = MapSL(lParam);
|
|
|
|
MDICREATESTRUCTA cs;
|
|
|
|
|
|
|
|
MDICREATESTRUCT16to32A( cs16, &cs );
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&cs, result, arg );
|
|
|
|
MDICREATESTRUCT32Ato16( &cs, cs16 );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 13:40:02 +02:00
|
|
|
case WM_MDIACTIVATE:
|
|
|
|
if (lParam)
|
|
|
|
ret = callback( hwnd32, msg, (WPARAM)WIN_Handle32( HIWORD(lParam) ),
|
|
|
|
(LPARAM)WIN_Handle32( LOWORD(lParam) ), result, arg );
|
|
|
|
else /* message sent to MDI client */
|
|
|
|
ret = callback( hwnd32, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_MDIGETACTIVE:
|
|
|
|
{
|
|
|
|
BOOL maximized = FALSE;
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&maximized, result, arg );
|
|
|
|
*result = MAKELRESULT( LOWORD(*result), maximized );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_MDISETMENU:
|
|
|
|
ret = callback( hwnd32, wParam ? WM_MDIREFRESHMENU : WM_MDISETMENU,
|
|
|
|
(WPARAM)HMENU_32(LOWORD(lParam)), (LPARAM)HMENU_32(HIWORD(lParam)),
|
|
|
|
result, arg );
|
|
|
|
break;
|
2006-05-26 13:31:55 +02:00
|
|
|
case WM_GETMINMAXINFO:
|
|
|
|
{
|
|
|
|
MINMAXINFO16 *mmi16 = MapSL(lParam);
|
|
|
|
MINMAXINFO mmi;
|
|
|
|
|
|
|
|
MINMAXINFO16to32( mmi16, &mmi );
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&mmi, result, arg );
|
|
|
|
MINMAXINFO32to16( &mmi, mmi16 );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS16 *winpos16 = MapSL(lParam);
|
|
|
|
WINDOWPOS winpos;
|
|
|
|
|
|
|
|
WINDOWPOS16to32( winpos16, &winpos );
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&winpos, result, arg );
|
|
|
|
WINDOWPOS32to16( &winpos, winpos16 );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_NCCALCSIZE:
|
|
|
|
{
|
|
|
|
NCCALCSIZE_PARAMS16 *nc16 = MapSL(lParam);
|
|
|
|
NCCALCSIZE_PARAMS nc;
|
|
|
|
WINDOWPOS winpos;
|
|
|
|
|
|
|
|
RECT16to32( &nc16->rgrc[0], &nc.rgrc[0] );
|
|
|
|
if (wParam)
|
|
|
|
{
|
|
|
|
RECT16to32( &nc16->rgrc[1], &nc.rgrc[1] );
|
|
|
|
RECT16to32( &nc16->rgrc[2], &nc.rgrc[2] );
|
|
|
|
WINDOWPOS16to32( MapSL(nc16->lppos), &winpos );
|
|
|
|
nc.lppos = &winpos;
|
|
|
|
}
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&nc, result, arg );
|
|
|
|
RECT32to16( &nc.rgrc[0], &nc16->rgrc[0] );
|
|
|
|
if (wParam)
|
|
|
|
{
|
|
|
|
RECT32to16( &nc.rgrc[1], &nc16->rgrc[1] );
|
|
|
|
RECT32to16( &nc.rgrc[2], &nc16->rgrc[2] );
|
|
|
|
WINDOWPOS32to16( &winpos, MapSL(nc16->lppos) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 13:24:47 +02:00
|
|
|
case WM_COMPAREITEM:
|
|
|
|
{
|
|
|
|
COMPAREITEMSTRUCT16* cis16 = MapSL(lParam);
|
|
|
|
COMPAREITEMSTRUCT cis;
|
|
|
|
cis.CtlType = cis16->CtlType;
|
|
|
|
cis.CtlID = cis16->CtlID;
|
|
|
|
cis.hwndItem = WIN_Handle32( cis16->hwndItem );
|
|
|
|
cis.itemID1 = cis16->itemID1;
|
|
|
|
cis.itemData1 = cis16->itemData1;
|
|
|
|
cis.itemID2 = cis16->itemID2;
|
|
|
|
cis.itemData2 = cis16->itemData2;
|
|
|
|
cis.dwLocaleId = 0; /* FIXME */
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&cis, result, arg );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_DELETEITEM:
|
|
|
|
{
|
|
|
|
DELETEITEMSTRUCT16* dis16 = MapSL(lParam);
|
|
|
|
DELETEITEMSTRUCT dis;
|
|
|
|
dis.CtlType = dis16->CtlType;
|
|
|
|
dis.CtlID = dis16->CtlID;
|
|
|
|
dis.hwndItem = WIN_Handle32( dis16->hwndItem );
|
|
|
|
dis.itemData = dis16->itemData;
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&dis, result, arg );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_MEASUREITEM:
|
|
|
|
{
|
|
|
|
MEASUREITEMSTRUCT16* mis16 = MapSL(lParam);
|
|
|
|
MEASUREITEMSTRUCT mis;
|
|
|
|
mis.CtlType = mis16->CtlType;
|
|
|
|
mis.CtlID = mis16->CtlID;
|
|
|
|
mis.itemID = mis16->itemID;
|
|
|
|
mis.itemWidth = mis16->itemWidth;
|
|
|
|
mis.itemHeight = mis16->itemHeight;
|
|
|
|
mis.itemData = mis16->itemData;
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&mis, result, arg );
|
|
|
|
mis16->itemWidth = (UINT16)mis.itemWidth;
|
|
|
|
mis16->itemHeight = (UINT16)mis.itemHeight;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_DRAWITEM:
|
|
|
|
{
|
|
|
|
DRAWITEMSTRUCT16* dis16 = MapSL(lParam);
|
|
|
|
DRAWITEMSTRUCT dis;
|
|
|
|
dis.CtlType = dis16->CtlType;
|
|
|
|
dis.CtlID = dis16->CtlID;
|
|
|
|
dis.itemID = dis16->itemID;
|
|
|
|
dis.itemAction = dis16->itemAction;
|
|
|
|
dis.itemState = dis16->itemState;
|
|
|
|
dis.hwndItem = (dis.CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem)
|
|
|
|
: WIN_Handle32( dis16->hwndItem );
|
|
|
|
dis.hDC = HDC_32(dis16->hDC);
|
|
|
|
dis.itemData = dis16->itemData;
|
|
|
|
dis.rcItem.left = dis16->rcItem.left;
|
|
|
|
dis.rcItem.top = dis16->rcItem.top;
|
|
|
|
dis.rcItem.right = dis16->rcItem.right;
|
|
|
|
dis.rcItem.bottom = dis16->rcItem.bottom;
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&dis, result, arg );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 13:36:57 +02:00
|
|
|
case WM_COPYDATA:
|
|
|
|
{
|
|
|
|
COPYDATASTRUCT16 *cds16 = MapSL(lParam);
|
|
|
|
COPYDATASTRUCT cds;
|
|
|
|
cds.dwData = cds16->dwData;
|
|
|
|
cds.cbData = cds16->cbData;
|
|
|
|
cds.lpData = MapSL(cds16->lpData);
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&cds, result, arg );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_GETDLGCODE:
|
|
|
|
if (lParam)
|
|
|
|
{
|
|
|
|
MSG16 *msg16 = MapSL(lParam);
|
|
|
|
MSG msg32;
|
|
|
|
msg32.hwnd = WIN_Handle32( msg16->hwnd );
|
|
|
|
msg32.message = msg16->message;
|
|
|
|
msg32.wParam = msg16->wParam;
|
|
|
|
msg32.lParam = msg16->lParam;
|
|
|
|
msg32.time = msg16->time;
|
|
|
|
msg32.pt.x = msg16->pt.x;
|
|
|
|
msg32.pt.y = msg16->pt.y;
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&msg32, result, arg );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = callback( hwnd32, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_NEXTMENU:
|
|
|
|
{
|
|
|
|
MDINEXTMENU next;
|
|
|
|
next.hmenuIn = (HMENU)lParam;
|
|
|
|
next.hmenuNext = 0;
|
|
|
|
next.hwndNext = 0;
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)&next, result, arg );
|
|
|
|
*result = MAKELONG( HMENU_16(next.hmenuNext), HWND_16(next.hwndNext) );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 13:44:57 +02:00
|
|
|
case WM_ACTIVATE:
|
|
|
|
case WM_CHARTOITEM:
|
|
|
|
case WM_COMMAND:
|
|
|
|
case WM_VKEYTOITEM:
|
|
|
|
ret = callback( hwnd32, msg, MAKEWPARAM( wParam, HIWORD(lParam) ),
|
|
|
|
(LPARAM)WIN_Handle32( LOWORD(lParam) ), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_HSCROLL:
|
|
|
|
case WM_VSCROLL:
|
|
|
|
ret = callback( hwnd32, msg, MAKEWPARAM( wParam, LOWORD(lParam) ),
|
|
|
|
(LPARAM)WIN_Handle32( HIWORD(lParam) ), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_CTLCOLOR:
|
|
|
|
if (HIWORD(lParam) <= CTLCOLOR_STATIC)
|
|
|
|
ret = callback( hwnd32, WM_CTLCOLORMSGBOX + HIWORD(lParam),
|
|
|
|
(WPARAM)HDC_32(wParam), (LPARAM)WIN_Handle32( LOWORD(lParam) ),
|
|
|
|
result, arg );
|
|
|
|
break;
|
|
|
|
case WM_GETTEXT:
|
|
|
|
case WM_SETTEXT:
|
|
|
|
case WM_WININICHANGE:
|
|
|
|
case WM_DEVMODECHANGE:
|
|
|
|
case WM_ASKCBFORMATNAME:
|
|
|
|
case WM_NOTIFY:
|
|
|
|
ret = callback( hwnd32, msg, wParam, (LPARAM)MapSL(lParam), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_MENUCHAR:
|
|
|
|
ret = callback( hwnd32, msg, MAKEWPARAM( wParam, LOWORD(lParam) ),
|
|
|
|
(LPARAM)HMENU_32(HIWORD(lParam)), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_MENUSELECT:
|
|
|
|
if((LOWORD(lParam) & MF_POPUP) && (LOWORD(lParam) != 0xFFFF))
|
|
|
|
{
|
|
|
|
HMENU hmenu = HMENU_32(HIWORD(lParam));
|
|
|
|
UINT pos = MENU_FindSubMenu( &hmenu, HMENU_32(wParam) );
|
|
|
|
if (pos == 0xffff) pos = 0; /* NO_SELECTED_ITEM */
|
|
|
|
wParam = pos;
|
|
|
|
}
|
|
|
|
ret = callback( hwnd32, msg, MAKEWPARAM( wParam, LOWORD(lParam) ),
|
|
|
|
(LPARAM)HMENU_32(HIWORD(lParam)), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_PARENTNOTIFY:
|
|
|
|
if ((wParam == WM_CREATE) || (wParam == WM_DESTROY))
|
|
|
|
ret = callback( hwnd32, msg, MAKEWPARAM( wParam, HIWORD(lParam) ),
|
|
|
|
(LPARAM)WIN_Handle32( LOWORD(lParam) ), result, arg );
|
|
|
|
else
|
|
|
|
ret = callback( hwnd32, msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_ACTIVATEAPP:
|
|
|
|
/* We need this when SetActiveWindow sends a Sendmessage16() to
|
|
|
|
* a 32bit window. Might be superflous with 32bit interprocess
|
|
|
|
* message queues. */
|
2006-05-28 18:26:32 +02:00
|
|
|
if (lParam) lParam = HTASK_32(lParam);
|
|
|
|
ret = callback( hwnd32, msg, wParam, lParam, result, arg );
|
2006-05-26 13:44:57 +02:00
|
|
|
break;
|
2006-05-26 13:42:00 +02:00
|
|
|
case WM_DDE_INITIATE:
|
|
|
|
case WM_DDE_TERMINATE:
|
|
|
|
case WM_DDE_UNADVISE:
|
|
|
|
case WM_DDE_REQUEST:
|
|
|
|
ret = callback( hwnd32, msg, (WPARAM)WIN_Handle32(wParam), lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_DDE_ADVISE:
|
|
|
|
case WM_DDE_DATA:
|
|
|
|
case WM_DDE_POKE:
|
|
|
|
{
|
|
|
|
HANDLE16 lo16 = LOWORD(lParam);
|
2007-05-30 12:32:24 +02:00
|
|
|
UINT_PTR lo32 = 0;
|
2006-05-26 13:42:00 +02:00
|
|
|
if (lo16 && !(lo32 = convert_handle_16_to_32(lo16, GMEM_DDESHARE))) break;
|
|
|
|
lParam = PackDDElParam( msg, lo32, HIWORD(lParam) );
|
|
|
|
ret = callback( hwnd32, msg, (WPARAM)WIN_Handle32(wParam), lParam, result, arg );
|
|
|
|
}
|
|
|
|
break; /* FIXME don't know how to free allocated memory (handle) !! */
|
|
|
|
case WM_DDE_ACK:
|
|
|
|
{
|
2007-05-30 12:32:24 +02:00
|
|
|
UINT_PTR lo = LOWORD(lParam);
|
|
|
|
UINT_PTR hi = HIWORD(lParam);
|
2006-05-26 13:42:00 +02:00
|
|
|
int flag = 0;
|
|
|
|
char buf[2];
|
|
|
|
|
|
|
|
if (GlobalGetAtomNameA(hi, buf, 2) > 0) flag |= 1;
|
|
|
|
if (GlobalSize16(hi) != 0) flag |= 2;
|
|
|
|
switch (flag)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (hi)
|
|
|
|
{
|
|
|
|
MESSAGE("DDE_ACK: neither atom nor handle!!!\n");
|
|
|
|
hi = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
break; /* atom, nothing to do */
|
|
|
|
case 3:
|
2007-05-30 12:32:24 +02:00
|
|
|
MESSAGE("DDE_ACK: %lx both atom and handle... choosing handle\n", hi);
|
2006-05-26 13:42:00 +02:00
|
|
|
/* fall thru */
|
|
|
|
case 2:
|
|
|
|
hi = convert_handle_16_to_32(hi, GMEM_DDESHARE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
lParam = PackDDElParam( WM_DDE_ACK, lo, hi );
|
|
|
|
ret = callback( hwnd32, msg, (WPARAM)WIN_Handle32(wParam), lParam, result, arg );
|
|
|
|
}
|
|
|
|
break; /* FIXME don't know how to free allocated memory (handle) !! */
|
|
|
|
case WM_DDE_EXECUTE:
|
|
|
|
lParam = convert_handle_16_to_32( lParam, GMEM_DDESHARE );
|
|
|
|
ret = callback( hwnd32, msg, wParam, lParam, result, arg );
|
|
|
|
break; /* FIXME don't know how to free allocated memory (handle) !! */
|
2006-05-26 13:44:57 +02:00
|
|
|
case WM_PAINTCLIPBOARD:
|
|
|
|
case WM_SIZECLIPBOARD:
|
|
|
|
FIXME_(msg)( "message %04x needs translation\n", msg );
|
|
|
|
break;
|
2006-05-26 13:21:31 +02:00
|
|
|
default:
|
2006-05-26 13:44:57 +02:00
|
|
|
ret = callback( hwnd32, msg, wParam, lParam, result, arg );
|
2006-05-26 13:21:31 +02:00
|
|
|
break;
|
|
|
|
}
|
2006-05-17 20:53:51 +02:00
|
|
|
return ret;
|
1996-07-05 19:14:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-10 15:50:18 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* __wine_call_wndproc (USER.1010)
|
|
|
|
*/
|
|
|
|
LRESULT WINAPI __wine_call_wndproc( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam,
|
|
|
|
WINDOWPROC *proc )
|
|
|
|
{
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
|
|
|
|
|
|
|
if (proc->procA)
|
|
|
|
WINPROC_CallProc16To32A( call_window_proc, hwnd, msg, wParam, lParam, &result, proc->procA );
|
|
|
|
else
|
2006-05-23 20:38:41 +02:00
|
|
|
WINPROC_CallProc16To32A( call_window_proc_AtoW, hwnd, msg, wParam, lParam, &result, proc->procW );
|
2006-05-18 19:09:32 +02:00
|
|
|
return result;
|
2006-05-10 15:50:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-07-05 19:14:13 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_CallProc32ATo16
|
|
|
|
*
|
|
|
|
* Call a 16-bit window procedure, translating the 32-bit args.
|
|
|
|
*/
|
2006-05-20 16:34:14 +02:00
|
|
|
LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT msg,
|
|
|
|
WPARAM wParam, LPARAM lParam, LRESULT *result, void *arg )
|
1996-07-05 19:14:13 +02:00
|
|
|
{
|
2006-05-26 13:53:15 +02:00
|
|
|
LRESULT ret = 0;
|
1996-07-05 19:14:13 +02:00
|
|
|
|
2007-05-24 16:41:17 +02:00
|
|
|
TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
|
2006-05-18 19:44:30 +02:00
|
|
|
hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
|
2002-04-02 04:53:08 +02:00
|
|
|
|
2006-05-26 13:53:15 +02:00
|
|
|
switch(msg)
|
|
|
|
{
|
|
|
|
case WM_NCCREATE:
|
|
|
|
case WM_CREATE:
|
|
|
|
{
|
|
|
|
CREATESTRUCTA *cs32 = (CREATESTRUCTA *)lParam;
|
|
|
|
CREATESTRUCT16 cs;
|
|
|
|
MDICREATESTRUCT16 mdi_cs16;
|
|
|
|
BOOL mdi_child = (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_MDICHILD);
|
|
|
|
|
|
|
|
CREATESTRUCT32Ato16( cs32, &cs );
|
|
|
|
cs.lpszName = MapLS( cs32->lpszName );
|
|
|
|
cs.lpszClass = MapLS( cs32->lpszClass );
|
|
|
|
|
|
|
|
if (mdi_child)
|
|
|
|
{
|
|
|
|
MDICREATESTRUCTA *mdi_cs = (MDICREATESTRUCTA *)cs32->lpCreateParams;
|
|
|
|
MDICREATESTRUCT32Ato16( mdi_cs, &mdi_cs16 );
|
|
|
|
mdi_cs16.szTitle = MapLS( mdi_cs->szTitle );
|
|
|
|
mdi_cs16.szClass = MapLS( mdi_cs->szClass );
|
|
|
|
cs.lpCreateParams = MapLS( &mdi_cs16 );
|
|
|
|
}
|
|
|
|
lParam = MapLS( &cs );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
UnMapLS( cs.lpszName );
|
|
|
|
UnMapLS( cs.lpszClass );
|
|
|
|
if (mdi_child)
|
|
|
|
{
|
|
|
|
UnMapLS( cs.lpCreateParams );
|
|
|
|
UnMapLS( mdi_cs16.szTitle );
|
|
|
|
UnMapLS( mdi_cs16.szClass );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_MDICREATE:
|
|
|
|
{
|
|
|
|
MDICREATESTRUCTA *cs32 = (MDICREATESTRUCTA *)lParam;
|
|
|
|
MDICREATESTRUCT16 cs;
|
|
|
|
|
|
|
|
MDICREATESTRUCT32Ato16( cs32, &cs );
|
|
|
|
cs.szTitle = MapLS( cs32->szTitle );
|
|
|
|
cs.szClass = MapLS( cs32->szClass );
|
|
|
|
lParam = MapLS( &cs );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
UnMapLS( cs.szTitle );
|
|
|
|
UnMapLS( cs.szClass );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 14:08:09 +02:00
|
|
|
case WM_MDIACTIVATE:
|
|
|
|
if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_MDICHILD)
|
|
|
|
ret = callback( HWND_16(hwnd), msg, ((HWND)lParam == hwnd),
|
|
|
|
MAKELPARAM( LOWORD(lParam), LOWORD(wParam) ), result, arg );
|
|
|
|
else
|
|
|
|
ret = callback( HWND_16(hwnd), msg, HWND_16( (HWND)wParam ), 0, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_MDIGETACTIVE:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
if (lParam) *(BOOL *)lParam = (BOOL16)HIWORD(*result);
|
|
|
|
*result = (LRESULT)WIN_Handle32( LOWORD(*result) );
|
|
|
|
break;
|
|
|
|
case WM_MDISETMENU:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, (lParam == 0),
|
|
|
|
MAKELPARAM( LOWORD(wParam), LOWORD(lParam) ), result, arg );
|
|
|
|
break;
|
2006-05-26 14:00:36 +02:00
|
|
|
case WM_GETMINMAXINFO:
|
|
|
|
{
|
|
|
|
MINMAXINFO *mmi32 = (MINMAXINFO *)lParam;
|
|
|
|
MINMAXINFO16 mmi;
|
|
|
|
|
|
|
|
MINMAXINFO32to16( mmi32, &mmi );
|
|
|
|
lParam = MapLS( &mmi );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
MINMAXINFO16to32( &mmi, mmi32 );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_NCCALCSIZE:
|
|
|
|
{
|
|
|
|
NCCALCSIZE_PARAMS *nc32 = (NCCALCSIZE_PARAMS *)lParam;
|
|
|
|
NCCALCSIZE_PARAMS16 nc;
|
|
|
|
WINDOWPOS16 winpos;
|
|
|
|
|
|
|
|
RECT32to16( &nc32->rgrc[0], &nc.rgrc[0] );
|
|
|
|
if (wParam)
|
|
|
|
{
|
|
|
|
RECT32to16( &nc32->rgrc[1], &nc.rgrc[1] );
|
|
|
|
RECT32to16( &nc32->rgrc[2], &nc.rgrc[2] );
|
|
|
|
WINDOWPOS32to16( nc32->lppos, &winpos );
|
|
|
|
nc.lppos = MapLS( &winpos );
|
|
|
|
}
|
|
|
|
lParam = MapLS( &nc );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
RECT16to32( &nc.rgrc[0], &nc32->rgrc[0] );
|
|
|
|
if (wParam)
|
|
|
|
{
|
|
|
|
RECT16to32( &nc.rgrc[1], &nc32->rgrc[1] );
|
|
|
|
RECT16to32( &nc.rgrc[2], &nc32->rgrc[2] );
|
|
|
|
WINDOWPOS16to32( &winpos, nc32->lppos );
|
|
|
|
UnMapLS( nc.lppos );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS *winpos32 = (WINDOWPOS *)lParam;
|
|
|
|
WINDOWPOS16 winpos;
|
|
|
|
|
|
|
|
WINDOWPOS32to16( winpos32, &winpos );
|
|
|
|
lParam = MapLS( &winpos );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
WINDOWPOS16to32( &winpos, winpos32 );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 13:54:57 +02:00
|
|
|
case WM_COMPAREITEM:
|
|
|
|
{
|
|
|
|
COMPAREITEMSTRUCT *cis32 = (COMPAREITEMSTRUCT *)lParam;
|
|
|
|
COMPAREITEMSTRUCT16 cis;
|
|
|
|
cis.CtlType = cis32->CtlType;
|
|
|
|
cis.CtlID = cis32->CtlID;
|
|
|
|
cis.hwndItem = HWND_16( cis32->hwndItem );
|
|
|
|
cis.itemID1 = cis32->itemID1;
|
|
|
|
cis.itemData1 = cis32->itemData1;
|
|
|
|
cis.itemID2 = cis32->itemID2;
|
|
|
|
cis.itemData2 = cis32->itemData2;
|
|
|
|
lParam = MapLS( &cis );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_DELETEITEM:
|
|
|
|
{
|
|
|
|
DELETEITEMSTRUCT *dis32 = (DELETEITEMSTRUCT *)lParam;
|
|
|
|
DELETEITEMSTRUCT16 dis;
|
|
|
|
dis.CtlType = dis32->CtlType;
|
|
|
|
dis.CtlID = dis32->CtlID;
|
|
|
|
dis.itemID = dis32->itemID;
|
|
|
|
dis.hwndItem = (dis.CtlType == ODT_MENU) ? (HWND16)LOWORD(dis32->hwndItem)
|
|
|
|
: HWND_16( dis32->hwndItem );
|
|
|
|
dis.itemData = dis32->itemData;
|
|
|
|
lParam = MapLS( &dis );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_DRAWITEM:
|
|
|
|
{
|
|
|
|
DRAWITEMSTRUCT *dis32 = (DRAWITEMSTRUCT *)lParam;
|
|
|
|
DRAWITEMSTRUCT16 dis;
|
|
|
|
dis.CtlType = dis32->CtlType;
|
|
|
|
dis.CtlID = dis32->CtlID;
|
|
|
|
dis.itemID = dis32->itemID;
|
|
|
|
dis.itemAction = dis32->itemAction;
|
|
|
|
dis.itemState = dis32->itemState;
|
|
|
|
dis.hwndItem = HWND_16( dis32->hwndItem );
|
|
|
|
dis.hDC = HDC_16(dis32->hDC);
|
|
|
|
dis.itemData = dis32->itemData;
|
|
|
|
dis.rcItem.left = dis32->rcItem.left;
|
|
|
|
dis.rcItem.top = dis32->rcItem.top;
|
|
|
|
dis.rcItem.right = dis32->rcItem.right;
|
|
|
|
dis.rcItem.bottom = dis32->rcItem.bottom;
|
|
|
|
lParam = MapLS( &dis );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_MEASUREITEM:
|
|
|
|
{
|
|
|
|
MEASUREITEMSTRUCT *mis32 = (MEASUREITEMSTRUCT *)lParam;
|
|
|
|
MEASUREITEMSTRUCT16 mis;
|
|
|
|
mis.CtlType = mis32->CtlType;
|
|
|
|
mis.CtlID = mis32->CtlID;
|
|
|
|
mis.itemID = mis32->itemID;
|
|
|
|
mis.itemWidth = mis32->itemWidth;
|
|
|
|
mis.itemHeight = mis32->itemHeight;
|
|
|
|
mis.itemData = mis32->itemData;
|
|
|
|
lParam = MapLS( &mis );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
mis32->itemWidth = mis.itemWidth;
|
|
|
|
mis32->itemHeight = mis.itemHeight;
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 14:03:49 +02:00
|
|
|
case WM_COPYDATA:
|
|
|
|
{
|
|
|
|
COPYDATASTRUCT *cds32 = (COPYDATASTRUCT *)lParam;
|
|
|
|
COPYDATASTRUCT16 cds;
|
|
|
|
|
|
|
|
cds.dwData = cds32->dwData;
|
|
|
|
cds.cbData = cds32->cbData;
|
|
|
|
cds.lpData = MapLS( cds32->lpData );
|
|
|
|
lParam = MapLS( &cds );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
UnMapLS( cds.lpData );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_GETDLGCODE:
|
|
|
|
if (lParam)
|
|
|
|
{
|
|
|
|
MSG *msg32 = (MSG *)lParam;
|
|
|
|
MSG16 msg16;
|
|
|
|
|
|
|
|
msg16.hwnd = HWND_16( msg32->hwnd );
|
|
|
|
msg16.message = msg32->message;
|
|
|
|
msg16.wParam = msg32->wParam;
|
|
|
|
msg16.lParam = msg32->lParam;
|
|
|
|
msg16.time = msg32->time;
|
|
|
|
msg16.pt.x = msg32->pt.x;
|
|
|
|
msg16.pt.y = msg32->pt.y;
|
|
|
|
lParam = MapLS( &msg16 );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_NEXTMENU:
|
|
|
|
{
|
|
|
|
MDINEXTMENU *next = (MDINEXTMENU *)lParam;
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, (LPARAM)next->hmenuIn, result, arg );
|
|
|
|
next->hmenuNext = HMENU_32( LOWORD(*result) );
|
|
|
|
next->hwndNext = WIN_Handle32( HIWORD(*result) );
|
|
|
|
*result = 0;
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 14:14:14 +02:00
|
|
|
case WM_GETTEXT:
|
|
|
|
case WM_ASKCBFORMATNAME:
|
|
|
|
wParam = min( wParam, 0xff80 ); /* Must be < 64K */
|
|
|
|
/* fall through */
|
|
|
|
case WM_NOTIFY:
|
|
|
|
case WM_SETTEXT:
|
|
|
|
case WM_WININICHANGE:
|
|
|
|
case WM_DEVMODECHANGE:
|
|
|
|
lParam = MapLS( (void *)lParam );
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
break;
|
2006-05-26 14:28:22 +02:00
|
|
|
case WM_ACTIVATE:
|
|
|
|
case WM_CHARTOITEM:
|
|
|
|
case WM_COMMAND:
|
|
|
|
case WM_VKEYTOITEM:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, MAKELPARAM( (HWND16)lParam, HIWORD(wParam) ),
|
|
|
|
result, arg );
|
|
|
|
break;
|
|
|
|
case WM_HSCROLL:
|
|
|
|
case WM_VSCROLL:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, MAKELPARAM( HIWORD(wParam), (HWND16)lParam ),
|
|
|
|
result, arg );
|
|
|
|
break;
|
|
|
|
case WM_CTLCOLORMSGBOX:
|
|
|
|
case WM_CTLCOLOREDIT:
|
|
|
|
case WM_CTLCOLORLISTBOX:
|
|
|
|
case WM_CTLCOLORBTN:
|
|
|
|
case WM_CTLCOLORDLG:
|
|
|
|
case WM_CTLCOLORSCROLLBAR:
|
|
|
|
case WM_CTLCOLORSTATIC:
|
|
|
|
ret = callback( HWND_16(hwnd), WM_CTLCOLOR, wParam,
|
|
|
|
MAKELPARAM( (HWND16)lParam, msg - WM_CTLCOLORMSGBOX ), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_MENUSELECT:
|
|
|
|
if(HIWORD(wParam) & MF_POPUP)
|
|
|
|
{
|
|
|
|
HMENU hmenu;
|
|
|
|
if ((HIWORD(wParam) != 0xffff) || lParam)
|
|
|
|
{
|
|
|
|
if ((hmenu = GetSubMenu( (HMENU)lParam, LOWORD(wParam) )))
|
|
|
|
{
|
|
|
|
ret = callback( HWND_16(hwnd), msg, HMENU_16(hmenu),
|
|
|
|
MAKELPARAM( HIWORD(wParam), (HMENU16)lParam ), result, arg );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* fall through */
|
|
|
|
case WM_MENUCHAR:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam,
|
|
|
|
MAKELPARAM( HIWORD(wParam), (HMENU16)lParam ), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_PARENTNOTIFY:
|
|
|
|
if ((LOWORD(wParam) == WM_CREATE) || (LOWORD(wParam) == WM_DESTROY))
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam,
|
|
|
|
MAKELPARAM( (HWND16)lParam, HIWORD(wParam) ), result, arg );
|
|
|
|
else
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_ACTIVATEAPP:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, HTASK_16( (HANDLE)lParam ), result, arg );
|
|
|
|
break;
|
|
|
|
case WM_PAINT:
|
|
|
|
if (IsIconic( hwnd ) && GetClassLongPtrW( hwnd, GCLP_HICON ))
|
|
|
|
ret = callback( HWND_16(hwnd), WM_PAINTICON, 1, lParam, result, arg );
|
|
|
|
else
|
|
|
|
ret = callback( HWND_16(hwnd), WM_PAINT, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_ERASEBKGND:
|
|
|
|
if (IsIconic( hwnd ) && GetClassLongPtrW( hwnd, GCLP_HICON )) msg = WM_ICONERASEBKGND;
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
break;
|
2006-05-26 14:09:26 +02:00
|
|
|
case WM_DDE_INITIATE:
|
|
|
|
case WM_DDE_TERMINATE:
|
|
|
|
case WM_DDE_UNADVISE:
|
|
|
|
case WM_DDE_REQUEST:
|
|
|
|
ret = callback( HWND_16(hwnd), msg, HWND_16((HWND)wParam), lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case WM_DDE_ADVISE:
|
|
|
|
case WM_DDE_DATA:
|
|
|
|
case WM_DDE_POKE:
|
|
|
|
{
|
|
|
|
UINT_PTR lo32, hi;
|
|
|
|
HANDLE16 lo16 = 0;
|
|
|
|
|
|
|
|
UnpackDDElParam( msg, lParam, &lo32, &hi );
|
|
|
|
if (lo32 && !(lo16 = convert_handle_32_to_16(lo32, GMEM_DDESHARE))) break;
|
|
|
|
ret = callback( HWND_16(hwnd), msg, HWND_16((HWND)wParam),
|
|
|
|
MAKELPARAM(lo16, hi), result, arg );
|
|
|
|
}
|
|
|
|
break; /* FIXME don't know how to free allocated memory (handle) !! */
|
|
|
|
case WM_DDE_ACK:
|
|
|
|
{
|
|
|
|
UINT_PTR lo, hi;
|
|
|
|
int flag = 0;
|
|
|
|
char buf[2];
|
|
|
|
|
|
|
|
UnpackDDElParam( msg, lParam, &lo, &hi );
|
|
|
|
|
|
|
|
if (GlobalGetAtomNameA((ATOM)hi, buf, sizeof(buf)) > 0) flag |= 1;
|
|
|
|
if (GlobalSize((HANDLE)hi) != 0) flag |= 2;
|
|
|
|
switch (flag)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (hi)
|
|
|
|
{
|
|
|
|
MESSAGE("DDE_ACK: neither atom nor handle!!!\n");
|
|
|
|
hi = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
break; /* atom, nothing to do */
|
|
|
|
case 3:
|
2007-05-24 16:41:17 +02:00
|
|
|
MESSAGE("DDE_ACK: %lx both atom and handle... choosing handle\n", hi);
|
2006-05-26 14:09:26 +02:00
|
|
|
/* fall thru */
|
|
|
|
case 2:
|
|
|
|
hi = convert_handle_32_to_16(hi, GMEM_DDESHARE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ret = callback( HWND_16(hwnd), msg, HWND_16((HWND)wParam),
|
|
|
|
MAKELPARAM(lo, hi), result, arg );
|
|
|
|
}
|
|
|
|
break; /* FIXME don't know how to free allocated memory (handle) !! */
|
|
|
|
case WM_DDE_EXECUTE:
|
|
|
|
lParam = convert_handle_32_to_16(lParam, GMEM_DDESHARE);
|
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
|
|
|
break; /* FIXME don't know how to free allocated memory (handle) !! */
|
2006-05-26 14:16:00 +02:00
|
|
|
case SBM_SETRANGE:
|
|
|
|
ret = callback( HWND_16(hwnd), SBM_SETRANGE16, 0, MAKELPARAM(wParam, lParam), result, arg );
|
|
|
|
break;
|
|
|
|
case SBM_GETRANGE:
|
|
|
|
ret = callback( HWND_16(hwnd), SBM_GETRANGE16, wParam, lParam, result, arg );
|
|
|
|
*(LPINT)wParam = LOWORD(*result);
|
|
|
|
*(LPINT)lParam = HIWORD(*result);
|
|
|
|
break;
|
|
|
|
case BM_GETCHECK:
|
|
|
|
case BM_SETCHECK:
|
|
|
|
case BM_GETSTATE:
|
|
|
|
case BM_SETSTATE:
|
|
|
|
case BM_SETSTYLE:
|
|
|
|
ret = callback( HWND_16(hwnd), msg + BM_GETCHECK16 - BM_GETCHECK, wParam, lParam, result, arg );
|
|
|
|
break;
|
2006-05-26 14:17:28 +02:00
|
|
|
case EM_GETSEL:
|
|
|
|
case EM_GETRECT:
|
|
|
|
case EM_SETRECT:
|
|
|
|
case EM_SETRECTNP:
|
|
|
|
case EM_SCROLL:
|
|
|
|
case EM_LINESCROLL:
|
|
|
|
case EM_SCROLLCARET:
|
|
|
|
case EM_GETMODIFY:
|
|
|
|
case EM_SETMODIFY:
|
|
|
|
case EM_GETLINECOUNT:
|
|
|
|
case EM_LINEINDEX:
|
|
|
|
case EM_SETHANDLE:
|
|
|
|
case EM_GETHANDLE:
|
|
|
|
case EM_GETTHUMB:
|
|
|
|
case EM_LINELENGTH:
|
|
|
|
case EM_REPLACESEL:
|
|
|
|
case EM_GETLINE:
|
|
|
|
case EM_LIMITTEXT:
|
|
|
|
case EM_CANUNDO:
|
|
|
|
case EM_UNDO:
|
|
|
|
case EM_FMTLINES:
|
|
|
|
case EM_LINEFROMCHAR:
|
|
|
|
case EM_SETTABSTOPS:
|
|
|
|
case EM_SETPASSWORDCHAR:
|
|
|
|
case EM_EMPTYUNDOBUFFER:
|
|
|
|
case EM_GETFIRSTVISIBLELINE:
|
|
|
|
case EM_SETREADONLY:
|
|
|
|
case EM_SETWORDBREAKPROC:
|
|
|
|
case EM_GETWORDBREAKPROC:
|
|
|
|
case EM_GETPASSWORDCHAR:
|
|
|
|
ret = callback( HWND_16(hwnd), msg + EM_GETSEL16 - EM_GETSEL, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case EM_SETSEL:
|
|
|
|
ret = callback( HWND_16(hwnd), EM_SETSEL16, 0, MAKELPARAM( wParam, lParam ), result, arg );
|
|
|
|
break;
|
2006-05-26 14:25:18 +02:00
|
|
|
case LB_CARETOFF:
|
|
|
|
case LB_CARETON:
|
|
|
|
case LB_DELETESTRING:
|
|
|
|
case LB_GETANCHORINDEX:
|
|
|
|
case LB_GETCARETINDEX:
|
|
|
|
case LB_GETCOUNT:
|
|
|
|
case LB_GETCURSEL:
|
|
|
|
case LB_GETHORIZONTALEXTENT:
|
|
|
|
case LB_GETITEMDATA:
|
|
|
|
case LB_GETITEMHEIGHT:
|
|
|
|
case LB_GETSEL:
|
|
|
|
case LB_GETSELCOUNT:
|
|
|
|
case LB_GETTEXTLEN:
|
|
|
|
case LB_GETTOPINDEX:
|
|
|
|
case LB_RESETCONTENT:
|
|
|
|
case LB_SELITEMRANGE:
|
|
|
|
case LB_SELITEMRANGEEX:
|
|
|
|
case LB_SETANCHORINDEX:
|
|
|
|
case LB_SETCARETINDEX:
|
|
|
|
case LB_SETCOLUMNWIDTH:
|
|
|
|
case LB_SETCURSEL:
|
|
|
|
case LB_SETHORIZONTALEXTENT:
|
|
|
|
case LB_SETITEMDATA:
|
|
|
|
case LB_SETITEMHEIGHT:
|
|
|
|
case LB_SETSEL:
|
|
|
|
case LB_SETTOPINDEX:
|
|
|
|
ret = callback( HWND_16(hwnd), msg + LB_ADDSTRING16 - LB_ADDSTRING, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case LB_ADDSTRING:
|
|
|
|
case LB_FINDSTRING:
|
|
|
|
case LB_FINDSTRINGEXACT:
|
|
|
|
case LB_INSERTSTRING:
|
|
|
|
case LB_SELECTSTRING:
|
|
|
|
case LB_GETTEXT:
|
|
|
|
case LB_DIR:
|
|
|
|
case LB_ADDFILE:
|
|
|
|
lParam = MapLS( (LPSTR)lParam );
|
|
|
|
ret = callback( HWND_16(hwnd), msg + LB_ADDSTRING16 - LB_ADDSTRING, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
break;
|
|
|
|
case LB_GETSELITEMS:
|
|
|
|
{
|
|
|
|
INT *items32 = (INT *)lParam;
|
|
|
|
INT16 *items, buffer[512];
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
wParam = min( wParam, 0x7f80 ); /* Must be < 64K */
|
|
|
|
if (!(items = get_buffer( buffer, sizeof(buffer), wParam * sizeof(INT16) ))) break;
|
|
|
|
lParam = MapLS( items );
|
|
|
|
ret = callback( HWND_16(hwnd), LB_GETSELITEMS16, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
for (i = 0; i < wParam; i++) items32[i] = items[i];
|
|
|
|
free_buffer( buffer, items );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LB_SETTABSTOPS:
|
|
|
|
if (wParam)
|
|
|
|
{
|
|
|
|
INT *stops32 = (INT *)lParam;
|
|
|
|
INT16 *stops, buffer[512];
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
wParam = min( wParam, 0x7f80 ); /* Must be < 64K */
|
|
|
|
if (!(stops = get_buffer( buffer, sizeof(buffer), wParam * sizeof(INT16) ))) break;
|
|
|
|
for (i = 0; i < wParam; i++) stops[i] = stops32[i];
|
|
|
|
lParam = MapLS( stops );
|
|
|
|
ret = callback( HWND_16(hwnd), LB_SETTABSTOPS16, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
free_buffer( buffer, stops );
|
|
|
|
}
|
|
|
|
else ret = callback( HWND_16(hwnd), LB_SETTABSTOPS16, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case CB_DELETESTRING:
|
|
|
|
case CB_GETCOUNT:
|
|
|
|
case CB_GETLBTEXTLEN:
|
|
|
|
case CB_LIMITTEXT:
|
|
|
|
case CB_RESETCONTENT:
|
|
|
|
case CB_SETEDITSEL:
|
|
|
|
case CB_GETCURSEL:
|
|
|
|
case CB_SETCURSEL:
|
|
|
|
case CB_SHOWDROPDOWN:
|
|
|
|
case CB_SETITEMDATA:
|
|
|
|
case CB_SETITEMHEIGHT:
|
|
|
|
case CB_GETITEMHEIGHT:
|
|
|
|
case CB_SETEXTENDEDUI:
|
|
|
|
case CB_GETEXTENDEDUI:
|
|
|
|
case CB_GETDROPPEDSTATE:
|
|
|
|
ret = callback( HWND_16(hwnd), msg + CB_GETEDITSEL16 - CB_GETEDITSEL, wParam, lParam, result, arg );
|
|
|
|
break;
|
|
|
|
case CB_GETEDITSEL:
|
|
|
|
ret = callback( HWND_16(hwnd), CB_GETEDITSEL16, wParam, lParam, result, arg );
|
|
|
|
if (wParam) *((PUINT)(wParam)) = LOWORD(*result);
|
|
|
|
if (lParam) *((PUINT)(lParam)) = HIWORD(*result); /* FIXME: substract 1? */
|
|
|
|
break;
|
|
|
|
case CB_ADDSTRING:
|
|
|
|
case CB_FINDSTRING:
|
|
|
|
case CB_FINDSTRINGEXACT:
|
|
|
|
case CB_INSERTSTRING:
|
|
|
|
case CB_SELECTSTRING:
|
|
|
|
case CB_DIR:
|
|
|
|
case CB_GETLBTEXT:
|
|
|
|
lParam = MapLS( (LPSTR)lParam );
|
|
|
|
ret = callback( HWND_16(hwnd), msg + CB_GETEDITSEL16 - CB_GETEDITSEL, wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
break;
|
|
|
|
case LB_GETITEMRECT:
|
|
|
|
case CB_GETDROPPEDCONTROLRECT:
|
|
|
|
{
|
|
|
|
RECT *r32 = (RECT *)lParam;
|
|
|
|
RECT16 rect;
|
|
|
|
lParam = MapLS( &rect );
|
|
|
|
ret = callback( HWND_16(hwnd),
|
|
|
|
(msg == LB_GETITEMRECT) ? LB_GETITEMRECT16 : CB_GETDROPPEDCONTROLRECT16,
|
|
|
|
wParam, lParam, result, arg );
|
|
|
|
UnMapLS( lParam );
|
|
|
|
RECT16to32( &rect, r32 );
|
|
|
|
}
|
|
|
|
break;
|
2006-05-26 14:28:22 +02:00
|
|
|
case WM_PAINTCLIPBOARD:
|
|
|
|
case WM_SIZECLIPBOARD:
|
|
|
|
FIXME_(msg)( "message %04x needs translation\n", msg );
|
|
|
|
break;
|
|
|
|
/* the following messages should not be sent to 16-bit apps */
|
|
|
|
case WM_SIZING:
|
|
|
|
case WM_MOVING:
|
|
|
|
case WM_CAPTURECHANGED:
|
|
|
|
case WM_STYLECHANGING:
|
|
|
|
case WM_STYLECHANGED:
|
|
|
|
break;
|
2006-05-26 13:53:15 +02:00
|
|
|
default:
|
2006-05-26 14:28:22 +02:00
|
|
|
ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
|
2006-05-26 13:53:15 +02:00
|
|
|
break;
|
|
|
|
}
|
2006-05-17 20:53:51 +02:00
|
|
|
return ret;
|
1996-07-05 19:14:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-08 17:02:42 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_call_window
|
|
|
|
*
|
|
|
|
* Call the window procedure of the specified window.
|
|
|
|
*/
|
|
|
|
BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
|
2007-08-08 18:25:38 +02:00
|
|
|
LRESULT *result, BOOL unicode, enum wm_char_mapping mapping )
|
2007-08-08 17:02:42 +02:00
|
|
|
{
|
|
|
|
WND *wndPtr;
|
|
|
|
WINDOWPROC *proc;
|
|
|
|
|
|
|
|
if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE;
|
|
|
|
if (wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE;
|
|
|
|
if (wndPtr->tid != GetCurrentThreadId())
|
|
|
|
{
|
|
|
|
WIN_ReleasePtr( wndPtr );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
proc = handle_to_proc( wndPtr->winproc );
|
|
|
|
WIN_ReleasePtr( wndPtr );
|
|
|
|
|
|
|
|
if (!proc) return TRUE;
|
|
|
|
|
|
|
|
if (unicode)
|
|
|
|
{
|
|
|
|
if (proc->procW)
|
|
|
|
call_window_proc( hwnd, msg, wParam, lParam, result, proc->procW );
|
2007-08-11 22:45:28 +02:00
|
|
|
else if (proc->procA)
|
2007-08-08 17:02:42 +02:00
|
|
|
WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, result, proc->procA );
|
2007-08-11 22:45:28 +02:00
|
|
|
else
|
|
|
|
WINPROC_CallProcWtoA( call_window_proc_Ato16, hwnd, msg, wParam, lParam, result, proc->proc16 );
|
2007-08-08 17:02:42 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (proc->procA)
|
|
|
|
call_window_proc( hwnd, msg, wParam, lParam, result, proc->procA );
|
2007-08-11 22:45:28 +02:00
|
|
|
else if (proc->procW)
|
2007-08-08 18:25:38 +02:00
|
|
|
WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, result, proc->procW, mapping );
|
2007-08-11 22:45:28 +02:00
|
|
|
else
|
|
|
|
WINPROC_CallProc32ATo16( call_window_proc16, hwnd, msg, wParam, lParam, result, proc->proc16 );
|
2007-08-08 17:02:42 +02:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
/**********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* CallWindowProc (USER.122)
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
LRESULT WINAPI CallWindowProc16( WNDPROC16 func, HWND16 hwnd, UINT16 msg,
|
|
|
|
WPARAM16 wParam, LPARAM lParam )
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
{
|
2002-05-07 20:31:10 +02:00
|
|
|
WINDOWPROC *proc;
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
2002-05-07 20:31:10 +02:00
|
|
|
|
|
|
|
if (!func) return 0;
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
|
2006-05-09 20:24:19 +02:00
|
|
|
if (!(proc = handle16_to_proc( func )))
|
2006-05-18 19:44:30 +02:00
|
|
|
call_window_proc16( hwnd, msg, wParam, lParam, &result, func );
|
|
|
|
else if (proc->procA)
|
2006-05-18 19:09:32 +02:00
|
|
|
WINPROC_CallProc16To32A( call_window_proc, hwnd, msg, wParam, lParam, &result, proc->procA );
|
|
|
|
else if (proc->procW)
|
2006-05-23 20:38:41 +02:00
|
|
|
WINPROC_CallProc16To32A( call_window_proc_AtoW, hwnd, msg, wParam, lParam, &result, proc->procW );
|
2006-05-18 19:09:32 +02:00
|
|
|
else
|
2006-05-18 19:44:30 +02:00
|
|
|
call_window_proc16( hwnd, msg, wParam, lParam, &result, proc->proc16 );
|
2006-05-18 19:09:32 +02:00
|
|
|
|
|
|
|
return result;
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* CallWindowProcA (USER32.@)
|
Release 980809
Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*]
Added some missing WINAPI and some missing prototypes for
functions.
* [controls/static.c]
Got rid of the MODULE32_LookupHMODULE error showing up for every
message box.
* [windows/winproc.c]
WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called).
* [misc/winsock.c]
hostent/servent/protoent should not use the same static buffers.
(has broken nt3.15 finger.exe which does hp=gethostbyname(), then
getservbyname("finger","tcp") and the references hp->h_addr_list[0]).
Sat Aug 8 13:21:24 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/server.h] [tools/make_requests] [server/request.c]
[server/trace.c]
Automated part of the client/server request code generation.
Added tracing of client/server communication.
* [scheduler/*.c] [server/process.c]
Added support for server-side handles.
* [scheduler/thread.c]
Added DLL_THREAD_ATTACH/DETACH notifications.
* [configure.in]
Added check for -lsocket.
* [windows/winproc.c]
Return the thunk address in WINPROC_GetProc if the function types
don't match.
Sat Aug 8 02:44:04 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/winproc.c][windows/win.c][windows/message.c]
Documentation for CallWindowProc, SetWindowLong, DispatchMessage,
WaitMessage, GetMessage, and PeekMessage.
Sat Aug 8 01:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [controls/commctrl.c][controls/widgets.c][include/builtin32.h]
[include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec]
[tools/build.c] [relay32/shell32.spec]
Added the functionality of the LibMain function. The common
controls are properly initialized now.
* [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c]
[windows/msgbox.c][windows/win.c]
Put TRACE in, put SetLastError() in.
* [include/interfaces.h]
Added IClassFactory::LockServer.
* [include/ole2.h]
Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32.
* [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c]
Reorganized and many structs and classes (IShellBrowser,IShellView)
added. shell32.dll should work in many cases now.
Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A.
New Shell32LibMain started ShellIconCache Implementation.
* [misc/shellord.c]
Rewrote ILCombine, ILGetSize
New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx,
SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries.
* [include/winerror.h]
Class and window related error codes added.
* [memory/heap.c]
Changed lstrlen32A to strlen to get rid of milions of TRACE lines.
* [misc/ddeml.c]
First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32.
* [misc/network.c][relay32/mpr.spec]
Fixed some bugs, changed ordinals.
* [windows/class.c]
Workarounds for incorrect hInstance handling. Fixes parts of
MSWord95/Excel95 and Money95.
Thu Aug 6 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [windows/nonclient.c][misc/tweak.c][include/tweak.h]
[documentation/win95look]
Removed some tweak variables. They are no longer needed.
* [files/dos_fs.c]
Added check for null pointer in DOSFS_GetDevice().
* [controls/tooltips.c][include/commctrl.h]
Improved tooltips.
* [controls/status.c][include/commctrl.h]
Cleaned up code and added tooltip support.
* [controls/toolbar.c][include/commctrl.h]
Added tooltip support.
* [documentation/common_controls]
Updated.
Thu Aug 6 00:05:22 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [include/ver.h] [misc/ver.c]
Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL.
* [debugger/hash.c] [debugger/stabs.c]
Make debug output more friendly for posting.
* [files/file.c]
Partial implementation of OF_SHARE_EXCLUSIVE.
Needed for Quicklogic/QuickChip (InstallShield).
* [files/profile.c]
When a cached-only entry is found, return it.
* [graphics/x11drv/xfont.c]
Accept a space as delimiter for a fontname and inhibit overrun
(Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed).
* [miscemu/main.c]
Delay setting IF1632_CallLargeStack after loading the executables.
Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when
showing the Blinker error Message Box.
* [misc/network.c]
Make WNetGetConnection16 recognise a CDROM as a local drive.
* [multimedia/mmsystem.c]
Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME.
Tue Aug 4 21:15:23 1998 James Juran <jrj120@psu.edu>
* [ole/ole2nls.c]
Fixed bug in CompareString32A. strcmp() doesn't necessarily
return -1, 0, or 1, which the previous code depended on.
Changed name of is_punctuation to OLE2NLS_isPunctuation.
Made NORM_IGNOREWIDTH not print a FIXME message in
LCMapString32A.
Other debugging messages, documentation, and code cleanups.
* [objects/font.c] [relay32/gdi32.spec] [include/winerror.h]
Added stub for GetFontData32, and added GDI_ERROR constant
to winerror.h.
Tue Aug 4 07:44:43 1998 Ove Kaaven <ovek@arcticnet.no>
* [multimedia/mmio.c]
Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and
mmioCreateChunk to the best of my knowledge. But watch out,
there's bound to be bugs in there...
* [include/mmsystem.h] [multimedia/mmsystem.c]
Hacked in support for 32-bit multimedia function callbacks.
* [AUTHORS] [misc/shell.c]
Selfishly credited my authorship. Hopefully I'm excused.
* [include/dosexe.h] [include/module.h] [loader/dos/*]
[loader/module.c] [loader/task.c] [Makefile.in]
[configure.in] [Makefile.in]
Added DOS EXE (MZ) loader and virtual machine. Task
structure integration thanks to Ulrich Weigand.
* [files/dos_fs.c]
Work around a null pointer dereference if ioctlGetDeviceInfo-ing
a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd).
* [include/miscemu.h] [include/winnt.h] [loader/main.c]
[memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c]
Added support for DOS memory images, and added
DOSMEM_ResizeBlock() and DOSMEM_Available().
* [msdos/int21.c]
Added support for the DOS virtual machine, tweaked handle
assignment to avoid stdio clashes, forced INT21_FindNext to exit
wildcardless searches after finding one entry, added AH=7, 8, 9,
C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the
long filename calls only respond if running with with -winver
win95.
* [objects/cursoricon.c]
DestroyCursor32 and DestroyIcon32 should now free the objects
(hopefully) correctly.
Sun Aug 2 21:42:09 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [include/psdrv.h]
Added PPD file parsing - at the moment it reads a file called
default.ppd from the directory in which you start Wine. Page sizes
other than A4 should now work (landscape may not). All fonts that are
present on your printer (according to the PPD) should be available,
providing you have the AFM files. Fonts should now be the correct size.
Graphics is still basically lines only. See graphics/psdrv/README .
* [misc/printdrv.c]
Yet more Drv[Get/Set]PrinterData fixes.
Fri Jul 31 21:33:22 1998 Per Lindstrm <pelinstr@algonet.se>
* [relay32/crtdll.spec] [misc/crtdll.c]
Added stub for freopen, _findfirst, _findnext, _fstat and _read.
* [files/directory.c]
Modified warning message.
Wed Jul 29 11:25:28 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com>
* [objects/font.c]
Added stub for GetFontData.
* [multimedia/msvideo.c]
Created this file to hold the msvideo.dll calls (and maybe also
msvfw32.dll).
* [objects/cursoricon.c]
Added search in Global Heap for cursor when trying to destroy it
with DestroyCursor16. This test should be done in many (all?)
other functions that use FreeResource.
* [controls/treeview.c] [include/commctrl.h]
Minor correction in name and addition of many placeholders for TVM
messages in TREEVIEW_WindowProc.
* [msdos/dpmi.c]
Fixed a bug in DPMI_xrealloc where in a copy of a memory region
"A" of size "a" to a region "B" of size "b", "b" bytes were being
copied, instead of "a", as the new version does. This both
increases speed, as well as avoids segfaults.
1998-08-09 14:47:43 +02:00
|
|
|
*
|
|
|
|
* The CallWindowProc() function invokes the windows procedure _func_,
|
|
|
|
* with _hwnd_ as the target window, the message specified by _msg_, and
|
|
|
|
* the message parameters _wParam_ and _lParam_.
|
|
|
|
*
|
|
|
|
* Some kinds of argument conversion may be done, I'm not sure what.
|
|
|
|
*
|
|
|
|
* CallWindowProc() may be used for windows subclassing. Use
|
|
|
|
* SetWindowLong() to set a new windows procedure for windows of the
|
|
|
|
* subclass, and handle subclassed messages in the new windows
|
|
|
|
* procedure. The new windows procedure may then use CallWindowProc()
|
|
|
|
* with _func_ set to the parent class's windows procedure to dispatch
|
|
|
|
* the message to the superclass.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* The return value is message dependent.
|
|
|
|
*
|
|
|
|
* CONFORMANCE
|
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* ECMA-234, Win32
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
LRESULT WINAPI CallWindowProcA(
|
2000-12-02 00:58:28 +01:00
|
|
|
WNDPROC func, /* [in] window procedure */
|
|
|
|
HWND hwnd, /* [in] target window */
|
|
|
|
UINT msg, /* [in] message */
|
|
|
|
WPARAM wParam, /* [in] message dependent parameter */
|
|
|
|
LPARAM lParam /* [in] message dependent parameter */
|
Release 980809
Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*]
Added some missing WINAPI and some missing prototypes for
functions.
* [controls/static.c]
Got rid of the MODULE32_LookupHMODULE error showing up for every
message box.
* [windows/winproc.c]
WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called).
* [misc/winsock.c]
hostent/servent/protoent should not use the same static buffers.
(has broken nt3.15 finger.exe which does hp=gethostbyname(), then
getservbyname("finger","tcp") and the references hp->h_addr_list[0]).
Sat Aug 8 13:21:24 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/server.h] [tools/make_requests] [server/request.c]
[server/trace.c]
Automated part of the client/server request code generation.
Added tracing of client/server communication.
* [scheduler/*.c] [server/process.c]
Added support for server-side handles.
* [scheduler/thread.c]
Added DLL_THREAD_ATTACH/DETACH notifications.
* [configure.in]
Added check for -lsocket.
* [windows/winproc.c]
Return the thunk address in WINPROC_GetProc if the function types
don't match.
Sat Aug 8 02:44:04 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/winproc.c][windows/win.c][windows/message.c]
Documentation for CallWindowProc, SetWindowLong, DispatchMessage,
WaitMessage, GetMessage, and PeekMessage.
Sat Aug 8 01:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [controls/commctrl.c][controls/widgets.c][include/builtin32.h]
[include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec]
[tools/build.c] [relay32/shell32.spec]
Added the functionality of the LibMain function. The common
controls are properly initialized now.
* [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c]
[windows/msgbox.c][windows/win.c]
Put TRACE in, put SetLastError() in.
* [include/interfaces.h]
Added IClassFactory::LockServer.
* [include/ole2.h]
Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32.
* [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c]
Reorganized and many structs and classes (IShellBrowser,IShellView)
added. shell32.dll should work in many cases now.
Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A.
New Shell32LibMain started ShellIconCache Implementation.
* [misc/shellord.c]
Rewrote ILCombine, ILGetSize
New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx,
SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries.
* [include/winerror.h]
Class and window related error codes added.
* [memory/heap.c]
Changed lstrlen32A to strlen to get rid of milions of TRACE lines.
* [misc/ddeml.c]
First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32.
* [misc/network.c][relay32/mpr.spec]
Fixed some bugs, changed ordinals.
* [windows/class.c]
Workarounds for incorrect hInstance handling. Fixes parts of
MSWord95/Excel95 and Money95.
Thu Aug 6 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [windows/nonclient.c][misc/tweak.c][include/tweak.h]
[documentation/win95look]
Removed some tweak variables. They are no longer needed.
* [files/dos_fs.c]
Added check for null pointer in DOSFS_GetDevice().
* [controls/tooltips.c][include/commctrl.h]
Improved tooltips.
* [controls/status.c][include/commctrl.h]
Cleaned up code and added tooltip support.
* [controls/toolbar.c][include/commctrl.h]
Added tooltip support.
* [documentation/common_controls]
Updated.
Thu Aug 6 00:05:22 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [include/ver.h] [misc/ver.c]
Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL.
* [debugger/hash.c] [debugger/stabs.c]
Make debug output more friendly for posting.
* [files/file.c]
Partial implementation of OF_SHARE_EXCLUSIVE.
Needed for Quicklogic/QuickChip (InstallShield).
* [files/profile.c]
When a cached-only entry is found, return it.
* [graphics/x11drv/xfont.c]
Accept a space as delimiter for a fontname and inhibit overrun
(Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed).
* [miscemu/main.c]
Delay setting IF1632_CallLargeStack after loading the executables.
Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when
showing the Blinker error Message Box.
* [misc/network.c]
Make WNetGetConnection16 recognise a CDROM as a local drive.
* [multimedia/mmsystem.c]
Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME.
Tue Aug 4 21:15:23 1998 James Juran <jrj120@psu.edu>
* [ole/ole2nls.c]
Fixed bug in CompareString32A. strcmp() doesn't necessarily
return -1, 0, or 1, which the previous code depended on.
Changed name of is_punctuation to OLE2NLS_isPunctuation.
Made NORM_IGNOREWIDTH not print a FIXME message in
LCMapString32A.
Other debugging messages, documentation, and code cleanups.
* [objects/font.c] [relay32/gdi32.spec] [include/winerror.h]
Added stub for GetFontData32, and added GDI_ERROR constant
to winerror.h.
Tue Aug 4 07:44:43 1998 Ove Kaaven <ovek@arcticnet.no>
* [multimedia/mmio.c]
Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and
mmioCreateChunk to the best of my knowledge. But watch out,
there's bound to be bugs in there...
* [include/mmsystem.h] [multimedia/mmsystem.c]
Hacked in support for 32-bit multimedia function callbacks.
* [AUTHORS] [misc/shell.c]
Selfishly credited my authorship. Hopefully I'm excused.
* [include/dosexe.h] [include/module.h] [loader/dos/*]
[loader/module.c] [loader/task.c] [Makefile.in]
[configure.in] [Makefile.in]
Added DOS EXE (MZ) loader and virtual machine. Task
structure integration thanks to Ulrich Weigand.
* [files/dos_fs.c]
Work around a null pointer dereference if ioctlGetDeviceInfo-ing
a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd).
* [include/miscemu.h] [include/winnt.h] [loader/main.c]
[memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c]
Added support for DOS memory images, and added
DOSMEM_ResizeBlock() and DOSMEM_Available().
* [msdos/int21.c]
Added support for the DOS virtual machine, tweaked handle
assignment to avoid stdio clashes, forced INT21_FindNext to exit
wildcardless searches after finding one entry, added AH=7, 8, 9,
C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the
long filename calls only respond if running with with -winver
win95.
* [objects/cursoricon.c]
DestroyCursor32 and DestroyIcon32 should now free the objects
(hopefully) correctly.
Sun Aug 2 21:42:09 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [include/psdrv.h]
Added PPD file parsing - at the moment it reads a file called
default.ppd from the directory in which you start Wine. Page sizes
other than A4 should now work (landscape may not). All fonts that are
present on your printer (according to the PPD) should be available,
providing you have the AFM files. Fonts should now be the correct size.
Graphics is still basically lines only. See graphics/psdrv/README .
* [misc/printdrv.c]
Yet more Drv[Get/Set]PrinterData fixes.
Fri Jul 31 21:33:22 1998 Per Lindstrm <pelinstr@algonet.se>
* [relay32/crtdll.spec] [misc/crtdll.c]
Added stub for freopen, _findfirst, _findnext, _fstat and _read.
* [files/directory.c]
Modified warning message.
Wed Jul 29 11:25:28 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com>
* [objects/font.c]
Added stub for GetFontData.
* [multimedia/msvideo.c]
Created this file to hold the msvideo.dll calls (and maybe also
msvfw32.dll).
* [objects/cursoricon.c]
Added search in Global Heap for cursor when trying to destroy it
with DestroyCursor16. This test should be done in many (all?)
other functions that use FreeResource.
* [controls/treeview.c] [include/commctrl.h]
Minor correction in name and addition of many placeholders for TVM
messages in TREEVIEW_WindowProc.
* [msdos/dpmi.c]
Fixed a bug in DPMI_xrealloc where in a copy of a memory region
"A" of size "a" to a region "B" of size "b", "b" bytes were being
copied, instead of "a", as the new version does. This both
increases speed, as well as avoids segfaults.
1998-08-09 14:47:43 +02:00
|
|
|
) {
|
2003-08-05 21:17:19 +02:00
|
|
|
WINDOWPROC *proc;
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
2003-08-05 21:17:19 +02:00
|
|
|
|
|
|
|
if (!func) return 0;
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
|
2007-08-09 06:35:28 +02:00
|
|
|
if (!(proc = handle_to_proc( func )))
|
2007-10-18 03:55:55 +02:00
|
|
|
call_window_proc( hwnd, msg, wParam, lParam, &result, func );
|
2006-05-18 19:09:32 +02:00
|
|
|
else if (proc->procA)
|
|
|
|
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
|
|
|
|
else if (proc->procW)
|
2007-08-08 18:25:38 +02:00
|
|
|
WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, &result,
|
|
|
|
proc->procW, WMCHAR_MAP_CALLWINDOWPROC );
|
2006-05-18 19:09:32 +02:00
|
|
|
else
|
2006-05-18 19:44:30 +02:00
|
|
|
WINPROC_CallProc32ATo16( call_window_proc16, hwnd, msg, wParam, lParam, &result, proc->proc16 );
|
2006-05-18 19:09:32 +02:00
|
|
|
return result;
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* CallWindowProcW (USER32.@)
|
2005-11-09 11:33:40 +01:00
|
|
|
*
|
|
|
|
* See CallWindowProcA.
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg,
|
|
|
|
WPARAM wParam, LPARAM lParam )
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
{
|
2003-08-05 21:17:19 +02:00
|
|
|
WINDOWPROC *proc;
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
1996-05-21 17:01:41 +02:00
|
|
|
|
2003-08-05 21:17:19 +02:00
|
|
|
if (!func) return 0;
|
|
|
|
|
2007-08-09 06:35:28 +02:00
|
|
|
if (!(proc = handle_to_proc( func )))
|
2007-10-18 03:55:55 +02:00
|
|
|
call_window_proc( hwnd, msg, wParam, lParam, &result, func );
|
2006-05-18 19:09:32 +02:00
|
|
|
else if (proc->procW)
|
|
|
|
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
|
|
|
|
else if (proc->procA)
|
2006-05-18 18:05:01 +02:00
|
|
|
WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, &result, proc->procA );
|
2006-05-18 19:09:32 +02:00
|
|
|
else
|
2006-05-23 20:33:14 +02:00
|
|
|
WINPROC_CallProcWtoA( call_window_proc_Ato16, hwnd, msg, wParam, lParam, &result, proc->proc16 );
|
2006-05-18 19:09:32 +02:00
|
|
|
return result;
|
Release 960516
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
|
|
|
}
|
2006-05-09 20:33:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_CallDlgProc16
|
|
|
|
*/
|
|
|
|
INT_PTR WINPROC_CallDlgProc16( DLGPROC16 func, HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
WINDOWPROC *proc;
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
|
|
|
INT_PTR ret;
|
2006-05-09 20:33:11 +02:00
|
|
|
|
|
|
|
if (!func) return 0;
|
|
|
|
|
|
|
|
if (!(proc = handle16_to_proc( (WNDPROC16)func )))
|
2006-05-18 19:44:30 +02:00
|
|
|
{
|
|
|
|
ret = call_dialog_proc16( hwnd, msg, wParam, lParam, &result, func );
|
|
|
|
}
|
|
|
|
else if (proc->procA)
|
2006-05-18 19:09:32 +02:00
|
|
|
{
|
|
|
|
ret = WINPROC_CallProc16To32A( call_dialog_proc, hwnd, msg, wParam, lParam,
|
|
|
|
&result, proc->procA );
|
|
|
|
SetWindowLongPtrW( WIN_Handle32(hwnd), DWLP_MSGRESULT, result );
|
|
|
|
}
|
|
|
|
else if (proc->procW)
|
|
|
|
{
|
2006-05-23 20:38:41 +02:00
|
|
|
ret = WINPROC_CallProc16To32A( call_dialog_proc_AtoW, hwnd, msg, wParam, lParam,
|
2006-05-18 19:09:32 +02:00
|
|
|
&result, proc->procW );
|
|
|
|
SetWindowLongPtrW( WIN_Handle32(hwnd), DWLP_MSGRESULT, result );
|
|
|
|
}
|
2006-05-18 19:44:30 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = call_dialog_proc16( hwnd, msg, wParam, lParam, &result, proc->proc16 );
|
|
|
|
}
|
2006-05-18 19:09:32 +02:00
|
|
|
return ret;
|
2006-05-09 20:33:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_CallDlgProcA
|
|
|
|
*/
|
|
|
|
INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
WINDOWPROC *proc;
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
|
|
|
INT_PTR ret;
|
2006-05-09 20:33:11 +02:00
|
|
|
|
|
|
|
if (!func) return 0;
|
|
|
|
|
2007-08-09 06:35:28 +02:00
|
|
|
if (!(proc = handle_to_proc( func )))
|
2007-10-18 03:55:55 +02:00
|
|
|
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, func );
|
2006-05-18 19:09:32 +02:00
|
|
|
else if (proc->procA)
|
|
|
|
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
|
|
|
|
else if (proc->procW)
|
|
|
|
{
|
2007-08-08 18:25:38 +02:00
|
|
|
ret = WINPROC_CallProcAtoW( call_dialog_proc, hwnd, msg, wParam, lParam, &result,
|
|
|
|
proc->procW, WMCHAR_MAP_CALLWINDOWPROC );
|
2006-05-18 19:09:32 +02:00
|
|
|
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, result );
|
|
|
|
}
|
|
|
|
else
|
2006-05-18 19:44:30 +02:00
|
|
|
{
|
|
|
|
ret = WINPROC_CallProc32ATo16( call_dialog_proc16, hwnd, msg, wParam, lParam, &result, proc->proc16 );
|
|
|
|
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, result );
|
|
|
|
}
|
2006-05-18 19:09:32 +02:00
|
|
|
return ret;
|
2006-05-09 20:33:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* WINPROC_CallDlgProcW
|
|
|
|
*/
|
|
|
|
INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
WINDOWPROC *proc;
|
2006-05-18 19:09:32 +02:00
|
|
|
LRESULT result;
|
|
|
|
INT_PTR ret;
|
2006-05-09 20:33:11 +02:00
|
|
|
|
|
|
|
if (!func) return 0;
|
|
|
|
|
2007-08-09 06:35:28 +02:00
|
|
|
if (!(proc = handle_to_proc( func )))
|
2007-10-18 03:55:55 +02:00
|
|
|
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, func );
|
2006-05-18 19:09:32 +02:00
|
|
|
else if (proc->procW)
|
|
|
|
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
|
|
|
|
else if (proc->procA)
|
2006-05-18 18:05:01 +02:00
|
|
|
{
|
2006-05-18 19:09:32 +02:00
|
|
|
ret = WINPROC_CallProcWtoA( call_dialog_proc, hwnd, msg, wParam, lParam, &result, proc->procA );
|
2006-05-18 18:05:01 +02:00
|
|
|
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, result );
|
|
|
|
}
|
2006-05-18 19:09:32 +02:00
|
|
|
else
|
2006-05-18 19:44:30 +02:00
|
|
|
{
|
2006-05-23 20:33:14 +02:00
|
|
|
ret = WINPROC_CallProcWtoA( call_dialog_proc_Ato16, hwnd, msg, wParam, lParam, &result, proc->proc16 );
|
2006-05-18 19:44:30 +02:00
|
|
|
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, result );
|
|
|
|
}
|
2006-05-18 19:09:32 +02:00
|
|
|
return ret;
|
2006-05-09 20:33:11 +02:00
|
|
|
}
|