Commit 2d93d000 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 960521

Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
parent e2bfa4c7
This is release 960516 of Wine the MS Windows emulator. This is still a
This is release 960521 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960516: (see ChangeLog for details)
- Tons of Win32 support.
- Several local heap fixes.
- Window management improvements.
WHAT'S NEW with Wine-960521: (see ChangeLog for details)
- Even more Win32 support.
- Winhelp clone should compile OK.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -17,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960516.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960516.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960516.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960516.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960521.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960521.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960521.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960521.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c]
Made ButtonWndProc a 32-bit window procedure.
* [controls/desktop.c]
Made DesktopWndProc a 32-bit window procedure.
Added handling of WM_SETCURSOR.
* [controls/menu.c]
Allocate menu items and strings on the 32-bit system heap.
Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu,
AppendMenu and LoadMenuIndirect.
* [controls/widgets.c]
Added possibility to have 32-bit built-in classes.
* [files/drive.c]
Implemented GetLogicalDrive() and GetLogicalDriveStrings().
* [misc/spy.c] [include/spy.h]
Added support for spying Win32 messages.
* [loader/builtin.c]
Fixed bug in -dll option parsing.
* [memory/local.c]
Added back the change by Huw D. M. Davies to free the block in
LocalRealloc() before allocating the new one.
* [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c]
Fixed bug in bitmap size that caused memory corruption for 24bpp.
* [windows/defwnd.c]
Implemented Win32 version of DefWindowProc().
* [windows/dialog.c]
Implemented Win32 version of SendDlgItemMessage,
Get/SetDlgItemText and Get/SetDlgItemInt.
* [windows/mdi.c]
Implemented Win32 version of DefFrameProc() and DefMDIChildProc().
Don't make a copy of the OBM bitmaps for every MDI window.
* [windows/message.c]
Implemented Win32 version of SendMessage().
* [windows/winproc.c] [windows/class.c] [windows/win.c]
New scheme for 32-bit window procedures to replace aliases. All
32-bit window procedure get a 16-bit address pointing to a
WINDOWPROC structure.
Implemented Ansi<->Unicode translation for CallWindowProc().
Added translation of WM_DRAWITEM between Win16 and Win32.
* [windows/win.c] [include/callback.h]
Added ugly hack to build CREATESTRUCT on the stack when sending
WM_NCCREATE.
Implemented Win32 version of Get/SetWindowWord/Long and
Get/SetWindowText.
Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de>
* [controls/button.c]
Avoid gray text on gray background in disabled push buttons
using a b/w raster and some raster operations (PatBlt,BitBlt).
* [objects/text.c]
DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
----------------------------------------------------------------------
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
......
......@@ -43,6 +43,28 @@ defined as a DWORD, you'll get a compilation warning if you mistakenly
use it as a regular 32-bit pointer.
STRUCTURE PACKING
=================
Under Windows, data structures are tightly packed, i.e. there is no
padding between structure members. On the other hand, by default gcc
aligns structure members (e.g. WORDs are on a WORD boundary, etc.).
This means that a structure like
struct { BYTE x; WORD y; };
will take 3 bytes under Windows, but 4 with gcc, because gcc will add a
dummy byte between x and y. To have the correct layout for structures
used by Windows code, you need to use the WINE_PACKED attribute; so you
would declare the above structure like this:
struct { BYTE x; WORD y WINE_PACKED; };
You have to do this every time a structure member is not aligned
correctly under Windows (i.e. a WORD not on an even address, or a
DWORD on a address that is not a multiple of 4).
NAMING CONVENTIONS FOR API FUNCTIONS AND TYPES
==============================================
......
......@@ -128,7 +128,8 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
*
* Window procedure for the desktop window.
*/
LRESULT DesktopWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
LRESULT DesktopWndProc( HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam )
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
......@@ -152,7 +153,10 @@ LRESULT DesktopWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
case WM_SYSCOMMAND:
if ((wParam & 0xfff0) != SC_CLOSE) return 0;
ExitWindows( 0, 0 );
ExitWindows( 0, 0 );
case WM_SETCURSOR:
return (LRESULT)SetCursor( LoadCursor( 0, IDC_ARROW ) );
}
return 0;
......
......@@ -84,10 +84,10 @@ typedef struct
#ifdef WINELIB32
#define EDIT_SEND_CTLCOLOR(wndPtr,hdc) \
SendMessage((wndPtr)->parent->hwndSelf, WM_CTLCOLOREDIT, \
SendMessage32A((wndPtr)->parent->hwndSelf, WM_CTLCOLOREDIT, \
(WPARAM)(hdc), (LPARAM)(wndPtr)->hwndSelf)
#define EDIT_NOTIFY_PARENT(wndPtr, wNotifyCode) \
SendMessage((wndPtr)->parent->hwndSelf, WM_COMMAND, \
SendMessage32A((wndPtr)->parent->hwndSelf, WM_COMMAND, \
MAKEWPARAM((wndPtr)->wIDmenu, wNotifyCode), \
(LPARAM)(wndPtr)->hwndSelf )
#define DPRINTF_EDIT_MSG(str) \
......@@ -96,10 +96,10 @@ typedef struct
(UINT)hwnd, (UINT)wParam, (DWORD)lParam)
#else
#define EDIT_SEND_CTLCOLOR(wndPtr,hdc) \
SendMessage((wndPtr)->parent->hwndSelf, WM_CTLCOLOR, \
SendMessage16((wndPtr)->parent->hwndSelf, WM_CTLCOLOR, \
(WPARAM)(hdc), MAKELPARAM((wndPtr)->hwndSelf, CTLCOLOR_EDIT))
#define EDIT_NOTIFY_PARENT(wndPtr, wNotifyCode) \
SendMessage((wndPtr)->parent->hwndSelf, WM_COMMAND, \
SendMessage16((wndPtr)->parent->hwndSelf, WM_COMMAND, \
(wndPtr)->wIDmenu, \
MAKELPARAM((wndPtr)->hwndSelf, wNotifyCode))
#define DPRINTF_EDIT_MSG(str) \
......@@ -491,7 +491,7 @@ LRESULT EditWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
default:
if (msg >= WM_USER)
fprintf(stdnimp, "edit: undocumented message %d >= WM_USER, please report.\n", msg);
lResult = DefWindowProc(hwnd, msg, wParam, lParam);
lResult = DefWindowProc16(hwnd, msg, wParam, lParam);
break;
}
EDIT_ReleasePointer(wndPtr);
......
......@@ -365,11 +365,11 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT16 *rect,
if (nBar == SB_CTL) /* Only scrollbar controls send WM_CTLCOLOR */
{
#ifdef WINELIB32
HBRUSH hbrush = SendMessage( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
HBRUSH hbrush = SendMessage32A( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
hdc, hwnd );
#else
HBRUSH hbrush = SendMessage( GetParent(hwnd), WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_SCROLLBAR) );
HBRUSH hbrush = SendMessage16( GetParent(hwnd), WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_SCROLLBAR) );
#endif
SelectObject( hdc, hbrush );
}
......@@ -525,11 +525,11 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WORD wParam )
return;
}
#ifdef WINELIB32
SendMessage( GetParent(hwnd),
SendMessage32A( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, hwnd );
#else
SendMessage( GetParent(hwnd),
SendMessage16( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, MAKELONG( 0, hwnd ));
#endif
......@@ -620,10 +620,10 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
......@@ -643,10 +643,10 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEUP, hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEUP, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
......@@ -687,10 +687,10 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
/* Save tracking info */
uTrackingPos = trackThumbPos + pos - lastClickPos;
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM(SB_THUMBTRACK,val), hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_THUMBTRACK, MAKELONG( val, hwndCtl ));
#endif
SCROLL_DrawMovingThumb( hdc, &rect, vertical,
......@@ -708,10 +708,10 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEDOWN, hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEDOWN, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
......@@ -730,10 +730,10 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEDOWN, hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEDOWN, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
......@@ -752,19 +752,19 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
UINT val = SCROLL_GetThumbVal( infoPtr, &rect, vertical,
trackThumbPos + lastMousePos - lastClickPos );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM(SB_THUMBPOSITION,val), hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_THUMBPOSITION, MAKELONG( val, hwndCtl ) );
#endif
}
else
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_ENDSCROLL, hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_ENDSCROLL, MAKELONG( 0, hwndCtl ) );
#endif
trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */
......@@ -851,7 +851,7 @@ LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
fprintf(stdnimp,"ScrollBarWndProc: undocumented message %04x, please report\n", message );
default:
return DefWindowProc( hwnd, message, wParam, lParam );
return DefWindowProc16( hwnd, message, wParam, lParam );
}
return 0;
}
......
......@@ -11,8 +11,6 @@
#include "user.h"
#include "static.h"
extern void DEFWND_SetText( WND *wndPtr, LPSTR text ); /* windows/defwnd.c */
static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc );
static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc );
static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc );
......@@ -70,14 +68,15 @@ static HICON STATIC_SetIcon( WND *wndPtr, HICON hicon )
/***********************************************************************
* StaticWndProc
*/
LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LONG lResult = 0;
WND *wndPtr = WIN_FindWndPtr(hWnd);
LONG style = wndPtr->dwStyle & 0x0000000F;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
LRESULT lResult = 0;
WND *wndPtr = WIN_FindWndPtr(hWnd);
LONG style = wndPtr->dwStyle & 0x0000000F;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
switch (uMsg) {
switch (uMsg)
{
case WM_ENABLE:
InvalidateRect32( hWnd, NULL, FALSE );
break;
......@@ -95,7 +94,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return 1;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
return DefWindowProc16(hWnd, uMsg, wParam, lParam);
case WM_CREATE:
if (style < 0L || style > LAST_STATIC_TYPE)
......@@ -114,7 +113,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (style == SS_ICON)
DestroyIcon( STATIC_SetIcon( wndPtr, 0 ) );
else
lResult = DefWindowProc(hWnd, uMsg, wParam, lParam);
lResult = DefWindowProc16(hWnd, uMsg, wParam, lParam);
break;
case WM_PAINT:
......@@ -174,7 +173,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
default:
lResult = DefWindowProc(hWnd, uMsg, wParam, lParam);
lResult = DefWindowProc16(hWnd, uMsg, wParam, lParam);
break;
}
......@@ -186,14 +185,12 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
{
RECT16 rc;
HBRUSH hBrush;
char *text;
WORD wFormat;
LONG style = wndPtr->dwStyle;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect16( wndPtr->hwndSelf, &rc);
text = USER_HEAP_LIN_ADDR( wndPtr->hText );
switch (style & 0x0000000F)
{
......@@ -226,15 +223,15 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont );
#ifdef WINELIB32
hBrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
hBrush = SendMessage32A( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
#else
hBrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, (WORD)hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
hBrush = SendMessage16( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, (WORD)hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif
if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
FillRect16(hdc, &rc, hBrush);
if (text) DrawText16( hdc, text, -1, &rc, wFormat );
if (wndPtr->text) DrawText16( hdc, wndPtr->text, -1, &rc, wFormat );
}
static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc )
......@@ -285,11 +282,11 @@ static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc )
GetClientRect16( wndPtr->hwndSelf, &rc);
#ifdef WINELIB32
hbrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
hbrush = SendMessage32A( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
#else
hbrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
hbrush = SendMessage16( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif
FillRect16( hdc, &rc, hbrush );
if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon );
......
......@@ -15,11 +15,8 @@
#include "module.h"
#include "heap.h"
static WNDCLASS16 WIDGETS_BuiltinClasses[] =
static WNDCLASS16 WIDGETS_BuiltinClasses16[] =
{
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
(WNDPROC16)"ButtonWndProc", 0, sizeof(BUTTONINFO),
0, 0, 0, 0, 0, (SEGPTR)"BUTTON" },
{ CS_GLOBALCLASS | CS_PARENTDC,
(WNDPROC16)"StaticWndProc", 0, sizeof(STATICINFO),
0, 0, 0, 0, 0, (SEGPTR)"STATIC" },
......@@ -40,16 +37,25 @@ static WNDCLASS16 WIDGETS_BuiltinClasses[] =
0, 0, 0, 0, 0, (SEGPTR)"EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC16)"PopupMenuWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC16)"DesktopWndProc", 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, 0, (SEGPTR)DESKTOP_CLASS_NAME },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC16)"DefDlgProc", 0, DLGWINDOWEXTRA,
0, 0, 0, 0, 0, (SEGPTR)DIALOG_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC16)"MDIClientWndProc", 0, sizeof(MDICLIENTINFO),
0, 0, 0, STOCK_LTGRAY_BRUSH, 0, (SEGPTR)"MDICLIENT" }
};
#define NB_BUILTIN_CLASSES \
(sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
#define NB_BUILTIN_CLASSES16 \
(sizeof(WIDGETS_BuiltinClasses16)/sizeof(WIDGETS_BuiltinClasses16[0]))
static WNDCLASS32A WIDGETS_BuiltinClasses32[] =
{
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, 0, 0, 0, "BUTTON" },
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, 0, DESKTOP_CLASS_NAME }
};
#define NB_BUILTIN_CLASSES32 \
(sizeof(WIDGETS_BuiltinClasses32)/sizeof(WIDGETS_BuiltinClasses32[0]))
/***********************************************************************
......@@ -61,17 +67,33 @@ BOOL WIDGETS_Init(void)
{
int i;
char *name;
WNDCLASS16 *class = WIDGETS_BuiltinClasses;
WNDCLASS16 *class16 = WIDGETS_BuiltinClasses16;
WNDCLASS32A *class32 = WIDGETS_BuiltinClasses32;
if (!(name = SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE;
for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
/* Create 16-bit classes */
for (i = 0; i < NB_BUILTIN_CLASSES16; i++, class16++)
{
strcpy( name, (char *)class16->lpszClassName );
class16->lpszClassName = SEGPTR_GET(name);
class16->hCursor = LoadCursor( 0, IDC_ARROW );
class16->lpfnWndProc = MODULE_GetWndProcEntry16( (char *)class16->lpfnWndProc );
if (!RegisterClass16( class16 )) return FALSE;
}
/* Create 32-bit classes */
for (i = 0; i < NB_BUILTIN_CLASSES32; i++, class32++)
{
strcpy( name, (char *)class->lpszClassName );
class->lpszClassName = SEGPTR_GET(name);
class->hCursor = LoadCursor( 0, IDC_ARROW );
class->lpfnWndProc = MODULE_GetWndProcEntry16( (char *)class->lpfnWndProc );
if (!RegisterClass16( class )) return FALSE;
/* Just to make sure the string is > 0x10000 */
strcpy( name, (char *)class32->lpszClassName );
class32->lpszClassName = name;
class32->hCursor = LoadCursor( 0, IDC_ARROW );
if (!RegisterClass32A( class32 )) return FALSE;
}
SEGPTR_FREE(name);
return TRUE;
}
......@@ -5,6 +5,7 @@
* Copyright 1996 Alexandre Julliard
*/
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
......@@ -477,6 +478,29 @@ WORD GetDriveType( INT drive )
/***********************************************************************
* GetDriveType32A (KERNEL32.)
*/
WORD GetDriveType32A( LPCSTR root )
{
dprintf_dosfs( stddeb, "GetDriveType32A(%s)\n", root );
if ((root[1] != ':') || (root[2] != '\\'))
{
fprintf( stderr, "GetDriveType32A: invalid root '%s'\n", root );
return DRIVE_DOESNOTEXIST;
}
switch(DRIVE_GetType(toupper(root[0]) - 'A'))
{
case TYPE_FLOPPY: return DRIVE_REMOVABLE;
case TYPE_HD: return DRIVE_FIXED;
case TYPE_CDROM: return DRIVE_REMOVABLE;
case TYPE_NETWORK: return DRIVE_REMOTE;
case TYPE_INVALID:
default: return DRIVE_CANNOTDETERMINE;
}
}
/***********************************************************************
* GetCurrentDirectory (KERNEL.411)
*/
UINT32 GetCurrentDirectory( UINT32 buflen, LPSTR buf )
......@@ -499,3 +523,69 @@ BOOL32 SetCurrentDirectory( LPCSTR dir )
{
return DRIVE_Chdir( DRIVE_GetCurrentDrive(), dir );
}
/***********************************************************************
* GetLogicalDriveStrings32A (KERNEL32.231)
*/
UINT32 GetLogicalDriveStrings32A( UINT32 len, LPSTR buffer )
{
int drive, count;
for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++)
if (DRIVE_IsValid(drive)) count++;
if (count * 4 * sizeof(char) <= len)
{
LPSTR p = buffer;
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
if (DRIVE_IsValid(drive))
{
*p++ = 'a' + drive;
*p++ = ':';
*p++ = '\\';
*p++ = '\0';
}
*p = '\0';
}
return count * 4 * sizeof(char);
}
/***********************************************************************
* GetLogicalDriveStrings32W (KERNEL32.232)
*/
UINT32 GetLogicalDriveStrings32W( UINT32 len, LPWSTR buffer )
{
int drive, count;
for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++)
if (DRIVE_IsValid(drive)) count++;
if (count * 4 * sizeof(WCHAR) <= len)
{
LPWSTR p = buffer;
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
if (DRIVE_IsValid(drive))
{
*p++ = (WCHAR)('a' + drive);
*p++ = (WCHAR)':';
*p++ = (WCHAR)'\\';
*p++ = (WCHAR)'\0';
}
*p = (WCHAR)'\0';
}
return count * 4 * sizeof(WCHAR);
}
/***********************************************************************
* GetLogicalDrives (KERNEL32.233)
*/
DWORD GetLogicalDrives(void)
{
DWORD ret = 0;
int drive;
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
if (DRIVE_IsValid(drive)) ret |= (1 << drive);
return ret;
}
......@@ -48,7 +48,6 @@ DLLS = \
SPEC_FILES = $(DLLS:.spec=.S)
C_SRCS = \
callback.c \
dummy.c \
relay.c
......
......@@ -13,55 +13,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "debug.h"
/**********************************************************************
* Catch (KERNEL.55)
*/
INT Catch( LPCATCHBUF lpbuf )
{
STACK16FRAME *pFrame = CURRENT_STACK16;
dprintf_catch( stddeb, "Catch: buf=%p ss:sp=%04x:%04x\n",
lpbuf, IF1632_Saved16_ss, IF1632_Saved16_sp );
/* Note: we don't save the current ss, as the catch buffer is */
/* only 9 words long. Hopefully no one will have the silly */
/* idea to change the current stack before calling Throw()... */
lpbuf[0] = IF1632_Saved16_sp;
lpbuf[1] = LOWORD(IF1632_Saved32_esp);
lpbuf[2] = HIWORD(IF1632_Saved32_esp);
lpbuf[3] = pFrame->saved_ss;
lpbuf[4] = pFrame->saved_sp;
lpbuf[5] = pFrame->ds;
lpbuf[6] = pFrame->bp;
lpbuf[7] = pFrame->ip;
lpbuf[8] = pFrame->cs;
return 0;
}
/**********************************************************************
* Throw (KERNEL.56)
*/
int Throw( LPCATCHBUF lpbuf, int retval )
{
STACK16FRAME *pFrame;
dprintf_catch( stddeb, "Throw: buf=%p val=%04x ss:sp=%04x:%04x\n",
lpbuf, retval, IF1632_Saved16_ss, IF1632_Saved16_sp );
IF1632_Saved16_sp = lpbuf[0] - sizeof(WORD);
IF1632_Saved32_esp = MAKELONG( lpbuf[1], lpbuf[2] );
pFrame = CURRENT_STACK16;
pFrame->saved_ss = lpbuf[3];
pFrame->saved_sp = lpbuf[4];
pFrame->ds = lpbuf[5];
pFrame->bp = lpbuf[6];
pFrame->ip = lpbuf[7];
pFrame->cs = lpbuf[8];
pFrame->es = 0;
return retval;
}
#endif /* !WINELIB */
......@@ -36,7 +36,7 @@ type win16
33 pascal16 LockCurrentTask(word) LockCurrentTask
34 pascal SetTaskQueue(word word) SetTaskQueue
35 pascal16 GetTaskQueue(word) GetTaskQueue
36 pascal GetCurrentTask() GetCurrentTask
36 pascal GetCurrentTask() WIN16_GetCurrentTask
37 pascal GetCurrentPDB() GetCurrentPDB
38 stub SetTaskSignalProc
41 return EnableDos 0 0
......
......@@ -210,7 +210,7 @@ base 1
0205 stub GetDefaultCommConfigW
0206 stub GetDiskFreeSpaceA
0207 stub GetDiskFreeSpaceW
0208 stub GetDriveTypeA
0208 stdcall GetDriveTypeA(ptr) GetDriveType32A
0209 stub GetDriveTypeW
0210 stdcall GetEnvironmentStrings() GetEnvironmentStrings
0211 stub GetEnvironmentStringsA
......@@ -233,9 +233,9 @@ base 1
0228 stdcall GetLocalTime(ptr) GetLocalTime
0229 stdcall GetLocaleInfoA(long long ptr long) GetLocaleInfoA
0230 stub GetLocaleInfoW
0231 stub GetLogicalDriveStringsA
0232 stub GetLogicalDriveStringsW
0233 stub GetLogicalDrives
0231 stdcall GetLogicalDriveStringsA(long ptr) GetLogicalDriveStrings32A
0232 stdcall GetLogicalDriveStringsW(long ptr) GetLogicalDriveStrings32W
0233 stdcall GetLogicalDrives() GetLogicalDrives
0234 stub GetMailslotInfo
0235 stdcall GetModuleFileNameA(long ptr long) GetModuleFileNameA
0236 stub GetModuleFileNameW
......@@ -361,7 +361,7 @@ base 1
0355 stub IsBadStringPtrA
0356 stub IsBadStringPtrW
0357 stdcall IsBadWritePtr(ptr long) WIN32_IsBadWritePtr
0358 stub IsDBCSLeadByte
0358 return IsDBCSLeadByte 4 0
0359 stub IsDBCSLeadByteEx
0360 stub IsValidCodePage
0361 stub IsValidLocale
......
......@@ -286,3 +286,48 @@ void RELAY_DebugCallTo32( unsigned int func, int nbargs, unsigned int arg1 )
printf( ",%08x", *argptr );
printf( ")\n" );
}
/**********************************************************************
* Catch (KERNEL.55)
*/
INT Catch( LPCATCHBUF lpbuf )
{
STACK16FRAME *pFrame = CURRENT_STACK16;
/* Note: we don't save the current ss, as the catch buffer is */
/* only 9 words long. Hopefully no one will have the silly */
/* idea to change the current stack before calling Throw()... */
lpbuf[0] = IF1632_Saved16_sp;
lpbuf[1] = LOWORD(IF1632_Saved32_esp);
lpbuf[2] = HIWORD(IF1632_Saved32_esp);
lpbuf[3] = pFrame->saved_ss;
lpbuf[4] = pFrame->saved_sp;
lpbuf[5] = pFrame->ds;
lpbuf[6] = pFrame->bp;
lpbuf[7] = pFrame->ip;
lpbuf[8] = pFrame->cs;
return 0;
}
/**********************************************************************
* Throw (KERNEL.56)
*/
int Throw( LPCATCHBUF lpbuf, int retval )
{
STACK16FRAME *pFrame;
IF1632_Saved16_sp = lpbuf[0] - sizeof(WORD);
IF1632_Saved32_esp = MAKELONG( lpbuf[1], lpbuf[2] );
pFrame = CURRENT_STACK16;
pFrame->saved_ss = lpbuf[3];
pFrame->saved_sp = lpbuf[4];
pFrame->ds = lpbuf[5];
pFrame->bp = lpbuf[6];
pFrame->ip = lpbuf[7];
pFrame->cs = lpbuf[8];
pFrame->es = 0;
return retval;
}
......@@ -35,8 +35,8 @@ heap 65520
33 pascal16 GetClientRect(word ptr) GetClientRect16
34 pascal16 EnableWindow(word word) EnableWindow
35 pascal16 IsWindowEnabled(word) IsWindowEnabled
36 pascal16 GetWindowText(word segptr word) WIN16_GetWindowText
37 pascal16 SetWindowText(word segptr) WIN16_SetWindowText
36 pascal16 GetWindowText(word segptr word) GetWindowText16
37 pascal16 SetWindowText(word segptr) SetWindowText16
38 pascal16 GetWindowTextLength(word) GetWindowTextLength
39 pascal16 BeginPaint(word ptr) BeginPaint16
40 pascal16 EndPaint(word ptr) EndPaint16
......@@ -91,26 +91,26 @@ heap 65520
89 pascal16 CreateDialog(word segptr word segptr) CreateDialog
90 pascal16 IsDialogMessage(word ptr) IsDialogMessage
91 pascal16 GetDlgItem(word word) GetDlgItem
92 pascal16 SetDlgItemText(word word segptr) SetDlgItemText
93 pascal16 GetDlgItemText(word word segptr word) GetDlgItemText
94 pascal16 SetDlgItemInt(word word word word) SetDlgItemInt
92 pascal16 SetDlgItemText(word word segptr) SetDlgItemText16
93 pascal16 GetDlgItemText(word word segptr word) GetDlgItemText16
94 pascal16 SetDlgItemInt(word word word word) SetDlgItemInt16
95 pascal16 GetDlgItemInt(word word ptr word) GetDlgItemInt
96 pascal16 CheckRadioButton(word word word word) CheckRadioButton
97 pascal16 CheckDlgButton(word word word) CheckDlgButton
98 pascal16 IsDlgButtonChecked(word word) IsDlgButtonChecked
99 pascal16 DlgDirSelect(word ptr word) DlgDirSelect
100 pascal16 DlgDirList(word segptr word word word) DlgDirList
101 pascal SendDlgItemMessage(word word word word long) SendDlgItemMessage
101 pascal SendDlgItemMessage(word word word word long) SendDlgItemMessage16
102 pascal16 AdjustWindowRect(ptr long word) AdjustWindowRect16
103 pascal16 MapDialogRect(word ptr) MapDialogRect16
104 pascal16 MessageBeep(word) MessageBeep
105 pascal16 FlashWindow(word word) FlashWindow
106 pascal16 GetKeyState(word) GetKeyState
107 pascal DefWindowProc(word word word long) DefWindowProc
107 pascal DefWindowProc(word word word long) DefWindowProc16
108 pascal16 GetMessage(segptr word word word) GetMessage
109 pascal16 PeekMessage(ptr word word word word) PeekMessage
110 pascal16 PostMessage(word word word long) PostMessage
111 pascal SendMessage(word word word long) SendMessage
111 pascal SendMessage(word word word long) SendMessage16
112 pascal16 WaitMessage() WaitMessage
113 pascal16 TranslateMessage(ptr) TranslateMessage
114 pascal DispatchMessage(ptr) DispatchMessage
......@@ -135,7 +135,7 @@ heap 65520
133 pascal16 GetWindowWord(word s_word) GetWindowWord
134 pascal16 SetWindowWord(word s_word word) SetWindowWord
135 pascal GetWindowLong(word s_word) GetWindowLong
136 pascal SetWindowLong(word s_word long) SetWindowLong
136 pascal SetWindowLong(word s_word long) SetWindowLong16
137 pascal16 OpenClipboard(word) OpenClipboard
138 pascal16 CloseClipboard() CloseClipboard
139 pascal16 EmptyClipboard() EmptyClipboard
......@@ -152,7 +152,7 @@ heap 65520
150 pascal16 LoadMenu(word segptr) LoadMenu
151 pascal16 CreateMenu() CreateMenu
152 pascal16 DestroyMenu(word) DestroyMenu
153 pascal16 ChangeMenu(word word segptr word word) ChangeMenu
153 pascal16 ChangeMenu(word word segptr word word) ChangeMenu16
154 pascal16 CheckMenuItem(word word word) CheckMenuItem
155 pascal16 EnableMenuItem(word word word) EnableMenuItem
156 pascal16 GetSystemMenu(word word) GetSystemMenu
......@@ -194,7 +194,7 @@ heap 65520
192 pascal16 InSendMessage() InSendMessage
193 pascal16 IsClipboardFormatAvailable(word) IsClipboardFormatAvailable
194 pascal16 DlgDirSelectComboBox(word ptr word) DlgDirSelectComboBox
195 pascal16 DlgDirListComboBox(word segptr word word word) DlgDirListComboBox
195 pascal16 DlgDirListComboBox(word ptr word word word) DlgDirListComboBox16
196 pascal TabbedTextOut(word s_word s_word ptr s_word s_word ptr s_word)
TabbedTextOut
197 pascal GetTabbedTextExtent(word ptr word word ptr) GetTabbedTextExtent
......@@ -220,7 +220,7 @@ heap 65520
217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle
218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect
219 pascal16 CreateDialogIndirect(word segptr word segptr) CreateDialogIndirect
220 pascal16 LoadMenuIndirect(segptr) LoadMenuIndirect
220 pascal16 LoadMenuIndirect(ptr) LoadMenuIndirect16
221 pascal16 ScrollDC(word s_word s_word ptr ptr word ptr) ScrollDC
222 pascal16 GetKeyboardState(ptr) GetKeyboardState
223 pascal16 SetKeyboardState(ptr) SetKeyboardState
......@@ -363,11 +363,11 @@ heap 65520
408 pascal16 CreateCursorIconIndirect(word ptr ptr ptr)
CreateCursorIconIndirect
409 stub InitThreadInput
410 pascal16 InsertMenu(word word word word segptr) InsertMenu
411 pascal16 AppendMenu(word word word segptr) AppendMenu
410 pascal16 InsertMenu(word word word word segptr) InsertMenu16
411 pascal16 AppendMenu(word word word segptr) AppendMenu16
412 pascal16 RemoveMenu(word word word) RemoveMenu
413 pascal16 DeleteMenu(word word word) DeleteMenu
414 pascal16 ModifyMenu(word word word word segptr) ModifyMenu
414 pascal16 ModifyMenu(word word word word segptr) ModifyMenu16
415 pascal16 CreatePopupMenu() CreatePopupMenu
416 pascal16 TrackPopupMenu(word word s_word s_word s_word word ptr) TrackPopupMenu16
417 pascal GetMenuCheckMarkDimensions() GetMenuCheckMarkDimensions
......@@ -390,9 +390,9 @@ heap 65520
438 pascal16 AnsiLowerBuff(ptr word) AnsiLowerBuff
441 stub InsertMenuItem
443 stub GetMenuItemInfo
445 pascal DefFrameProc(word word word word long) DefFrameProc
445 pascal DefFrameProc(word word word word long) DefFrameProc16
446 stub SetMenuItemInfo
447 pascal DefMDIChildProc(word word word long) DefMDIChildProc
447 pascal DefMDIChildProc(word word word long) DefMDIChildProc16
448 stub DrawAnimatedRects
449 stub DrawState
450 stub CreateIconFromResourceEx
......
......@@ -6,8 +6,8 @@ base 1
0001 stdcall AdjustWindowRect(ptr long long) AdjustWindowRect32
0002 stdcall AdjustWindowRectEx(ptr long long long) AdjustWindowRectEx32
0003 stub AnyPopup
0004 stub AppendMenuA
0005 stub AppendMenuW
0004 stdcall AppendMenuA(long long long ptr) AppendMenu32A
0005 stdcall AppendMenuW(long long long ptr) AppendMenu32W
0006 stub ArrangeIconicWindows
0007 stub AttachThreadInput
0008 stub BeginDeferWindowPos
......@@ -24,8 +24,8 @@ base 1
0019 stub CascadeChildWindows
0020 stub CascadeWindows
0021 stub ChangeClipboardChain
0022 stub ChangeMenuA
0023 stub ChangeMenuW
0022 stdcall ChangeMenuA(long long ptr long long) ChangeMenu32A
0023 stdcall ChangeMenuW(long long ptr long long) ChangeMenu32W
0024 stub CharLowerA
0025 stub CharLowerBuffA
0026 stub CharLowerBuffW
......@@ -90,7 +90,8 @@ base 1
0081 stub CreatePopupMenu
0082 stdcall CreateWindowExA(long ptr ptr long long long long long
long long long ptr) CreateWindowEx32A
0083 stub CreateWindowExW
0083 stdcall CreateWindowExW(long ptr ptr long long long long long
long long long ptr) CreateWindowEx32W
0084 stub CreateWindowStationA
0085 stub CreateWindowStationW
0086 stub DdeAbandonTransaction
......@@ -128,12 +129,12 @@ base 1
0118 stub DdeUninitialize
0119 stub DefDlgProcA
0120 stub DefDlgProcW
0121 stub DefFrameProcA
0122 stub DefFrameProcW
0123 stub DefMDIChildProcA
0124 stub DefMDIChildProcW
0125 stdcall DefWindowProcA(long long long long) USER32_DefWindowProcA
0126 stub DefWindowProcW
0121 stdcall DefFrameProcA(long long long long long) DefFrameProc32A
0122 stdcall DefFrameProcW(long long long long long) DefFrameProc32W
0123 stdcall DefMDIChildProcA(long long long long) DefMDIChildProc32A
0124 stdcall DefMDIChildProcW(long long long long) DefMDIChildProc32W
0125 stdcall DefWindowProcA(long long long long) DefWindowProc32A
0126 stdcall DefWindowProcW(long long long long) DefWindowProc32W
0127 stub DeferWindowPos
0128 stub DeleteMenu
0129 stub DestroyAcceleratorTable
......@@ -152,8 +153,8 @@ base 1
0140 stdcall DispatchMessageA(ptr) USER32_DispatchMessageA
0141 stub DispatchMessageW
0142 stub DlgDirListA
0143 stub DlgDirListComboBoxA
0144 stub DlgDirListComboBoxW
0143 stdcall DlgDirListComboBoxA(long ptr long long long) DlgDirListComboBox32A
0144 stdcall DlgDirListComboBoxW(long ptr long long long) DlgDirListComboBox32W
0145 stub DlgDirListW
0146 stub DlgDirSelectComboBoxExA
0147 stub DlgDirSelectComboBoxExW
......@@ -245,8 +246,8 @@ base 1
0233 stub GetDlgCtrlID
0234 stdcall GetDlgItem(long long) GetDlgItem
0235 stdcall GetDlgItemInt(long long long long) GetDlgItemInt
0236 stub GetDlgItemTextA
0237 stub GetDlgItemTextW
0236 stdcall GetDlgItemTextA(long long ptr long) GetDlgItemText32A
0237 stdcall GetDlgItemTextW(long long ptr long) GetDlgItemText32W
0238 stub GetDoubleClickTime
0239 stub GetFocus
0240 stub GetForegroundWindow
......@@ -317,12 +318,12 @@ base 1
0305 stub GetWindowLongW
0306 stdcall GetWindowPlacement(long ptr) GetWindowPlacement32
0307 stdcall GetWindowRect(long ptr) GetWindowRect32
0308 stdcall GetWindowTextA(long segptr long) WIN16_GetWindowText
0308 stdcall GetWindowTextA(long ptr long) GetWindowText32A
0309 stub GetWindowTextLengthA
0310 stub GetWindowTextLengthW
0311 stub GetWindowTextW
0311 stdcall GetWindowTextW(long ptr long) GetWindowText32W
0312 stub GetWindowThreadProcessId
0313 stub GetWindowWord
0313 stdcall GetWindowWord(long long) GetWindowWord
0314 stub GrayStringA
0315 stub GrayStringW
0316 stub HideCaret
......@@ -330,10 +331,10 @@ base 1
0318 stub ImpersonateDdeClientWindow
0319 stub InSendMessage
0320 stdcall InflateRect(ptr long long) InflateRect32
0321 stub InsertMenuA
0321 stdcall InsertMenuA(long long long long ptr) InsertMenu32A
0322 stub InsertMenuItemA
0323 stub InsertMenuItemW
0324 stub InsertMenuW
0324 stdcall InsertMenuW(long long long long ptr) InsertMenu32W
0325 stub InternalGetWindowText
0326 stdcall IntersectRect(ptr ptr ptr) IntersectRect32
0327 stdcall InvalidateRect(long ptr long) InvalidateRect32
......@@ -379,8 +380,8 @@ base 1
0367 stub LoadKeyboardLayoutW
0368 stub LoadLocalFonts
0369 stdcall LoadMenuA(long ptr) WIN32_LoadMenuA
0370 stdcall LoadMenuIndirectA(long ptr) WIN32_LoadMenuIndirectA
0371 stdcall LoadMenuIndirectW(long ptr) WIN32_LoadMenuIndirectW
0370 stdcall LoadMenuIndirectA(ptr) LoadMenuIndirect32A
0371 stdcall LoadMenuIndirectW(ptr) LoadMenuIndirect32W
0372 stdcall LoadMenuW(long ptr) WIN32_LoadMenuW
0373 stub LoadRemoteFonts
0374 stdcall LoadStringA(long long ptr long) WIN32_LoadStringA
......@@ -405,8 +406,8 @@ base 1
0393 stub MessageBoxIndirectA
0394 stub MessageBoxIndirectW
0395 stub MessageBoxW
0396 stub ModifyMenuA
0397 stub ModifyMenuW
0396 stdcall ModifyMenuA(long long long long ptr) ModifyMenu32A
0397 stdcall ModifyMenuW(long long long long ptr) ModifyMenu32W
0398 stdcall MoveWindow(long long long long long long) MoveWindow
0399 stub MsgWaitForMultipleObjects
0400 stub OemKeyScan
......@@ -460,14 +461,14 @@ base 1
0448 stub ScrollDC
0449 stub ScrollWindow
0450 stub ScrollWindowEx
0451 stub SendDlgItemMessageA
0452 stub SendDlgItemMessageW
0453 stdcall SendMessageA(long long long long) SendMessage
0451 stdcall SendDlgItemMessageA(long long long long long) SendDlgItemMessage32A
0452 stdcall SendDlgItemMessageW(long long long long long) SendDlgItemMessage32W
0453 stdcall SendMessageA(long long long long) SendMessage32A
0454 stub SendMessageCallbackA
0455 stub SendMessageCallbackW
0456 stub SendMessageTimeoutA
0457 stub SendMessageTimeoutW
0458 stub SendMessageW
0458 stdcall SendMessageW(long long long long) SendMessage32W
0459 stub SendNotifyMessageA
0460 stub SendNotifyMessageW
0461 stub ServerSetFunctionPointers
......@@ -485,9 +486,9 @@ base 1
0473 stub SetCursorPos
0474 stub SetDebugErrorLevel
0475 stub SetDeskWallpaper
0476 stdcall SetDlgItemInt(long long long long) SetDlgItemInt
0477 stub SetDlgItemTextA
0478 stub SetDlgItemTextW
0476 stdcall SetDlgItemInt(long long long long) SetDlgItemInt32
0477 stdcall SetDlgItemTextA(long long ptr) SetDlgItemText32A
0478 stdcall SetDlgItemTextW(long long ptr) SetDlgItemText32W
0479 stub SetDoubleClickTime
0480 stub SetFocus
0481 stub SetForegroundWindow
......@@ -525,14 +526,14 @@ base 1
0513 stub SetUserObjectSecurity
0514 stub SetWindowContextHelpId
0515 stub SetWindowFullScreenState
0516 stub SetWindowLongA
0517 stub SetWindowLongW
0516 stdcall SetWindowLongA(long long long) SetWindowLong32A
0517 stdcall SetWindowLongW(long long long) SetWindowLong32W
0518 stdcall SetWindowPlacement(long ptr) SetWindowPlacement32
0519 stub SetWindowPos
0520 stub SetWindowStationUser
0521 stdcall SetWindowTextA(long ptr) SetWindowText
0522 stub SetWindowTextW
0523 stub SetWindowWord
0521 stdcall SetWindowTextA(long ptr) SetWindowText32A
0522 stdcall SetWindowTextW(long ptr) SetWindowText32W
0523 stdcall SetWindowWord(long long long) SetWindowWord
0524 stub SetWindowsHookA
0525 stdcall SetWindowsHookExA(long long long long) SetWindowsHookEx32A
0526 stub SetWindowsHookExW
......
name wprocs
type win16
1 pascal ButtonWndProc(word word word long) ButtonWndProc
2 pascal StaticWndProc(word word word long) StaticWndProc
3 pascal ScrollBarWndProc(word word word long) ScrollBarWndProc
4 pascal ListBoxWndProc(word word word long) ListBoxWndProc
5 pascal ComboBoxWndProc(word word word long) ComboBoxWndProc
6 pascal EditWndProc(word word word long) EditWndProc
7 pascal PopupMenuWndProc(word word word long) PopupMenuWndProc
8 pascal DesktopWndProc(word word word long) DesktopWndProc
9 pascal DefDlgProc(word word word long) DefDlgProc
10 pascal MDIClientWndProc(word word word long) MDIClientWndProc
11 pascal DefWindowProc(word word word long) DefWindowProc
12 pascal DefMDIChildProc(word word word long) DefMDIChildProc
13 pascal SystemMessageBoxProc(word word word long) SystemMessageBoxProc
14 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
15 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
......
name wprocs32
type win32
1 stdcall ButtonWndProc(long long long long) ButtonWndProc32
2 stdcall StaticWndProc(long long long long) StaticWndProc32
3 stdcall ScrollBarWndProc(long long long long) ScrollBarWndProc32
4 stdcall ListBoxWndProc(long long long long) ListBoxWndProc32
5 stdcall ComboBoxWndProc(long long long long) ComboBoxWndProc32
6 stdcall EditWndProc(long long long long) EditWndProc32
7 stdcall PopupMenuWndProc(long long long long) PopupMenuWndProc32
8 stdcall DesktopWndProc(long long long long) DesktopWndProc32
9 stdcall DefDlgProc(long long long long) DefDlgProc32
10 stdcall MDIClientWndProc(long long long long) MDIClientWndProc32
11 stdcall DefWindowProc(long long long long) DefWindowProc32
12 stdcall DefMDIChildProc(long long long long) DefMDIChildProc32
11 stdcall DefWindowProc(long long long long) DefWindowProc32A
13 stdcall SystemMessageBoxProc(long long long long) SystemMessageBoxProc32
14 stdcall FileOpenDlgProc(long long long long) FileOpenDlgProc32
15 stdcall FileSaveDlgProc(long long long long) FileSaveDlgProc32
......
/*
* structure definitions for aliases
*
* Copyright 1995 Martin von Loewis
*
*/
#ifndef __WINE_ALIAS_H
#define __WINE_ALIAS_H
#include "wintypes.h"
typedef struct
{
DWORD wine;
DWORD win16;
DWORD win32;
} FUNCTIONALIAS;
extern int ALIAS_UseAliases;
typedef struct _ALIASHASH{
DWORD used;
int recno;
} ALIASHASH;
extern BOOL ALIAS_Init(void);
extern void ALIAS_RegisterAlias( DWORD Wine, DWORD Win16Proc, DWORD Win32Proc);
extern FUNCTIONALIAS* ALIAS_LookupAlias(DWORD);
#endif /* __WINE_ALIAS_H */
......@@ -24,6 +24,9 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
#define BITMAP_WIDTH_BYTES(width,bpp) \
(((bpp) == 24) ? (width) * 4 : ((width) * (bpp) + 15) / 16 * 2)
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = DIB_GetImageWidthBytes( (width), (bpp) ); \
......
......@@ -28,7 +28,7 @@ typedef struct
#define BUTTON_STATE(hwnd) ((WIN_FindWndPtr(hwnd))->wExtra[0])
extern LRESULT ButtonWndProc( HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam );
extern LRESULT ButtonWndProc( HWND32 hWnd, UINT32 uMsg,
WPARAM32 wParam, LPARAM lParam );
#endif /* BUTTON_H */
......@@ -36,6 +36,9 @@ extern LONG CallTo16_long_wwwl ( FARPROC, WORD, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_lwww ( FARPROC, WORD, LONG, WORD, WORD, WORD );
extern WORD CallTo16_word_wllwl( FARPROC, WORD, WORD, LONG, LONG, WORD, LONG );
extern WORD CallTo16_word_wwlll( FARPROC, WORD, WORD, WORD, LONG, LONG, LONG );
extern LONG CallTo16_long_lllllllwlwwwl( FARPROC, WORD, LONG, LONG, LONG,
LONG, LONG, LONG, LONG, WORD, LONG,
WORD, WORD, WORD, LONG );
extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
WORD bx, WORD cx, WORD dx, WORD si, WORD di );
......@@ -68,7 +71,13 @@ extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
CallTo16_long_wwwl( func, ds, hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
CallTo16_word_lwww( func, CURRENT_DS, lpch, ichCurrent, cch, code )
#define CallWndProcNCCREATE16( func, ds, exStyle, clsName, winName, style, \
x, y, cx, cy, hparent, hmenu, instance, \
params, hwnd, msg, wParam, lParam ) \
CallTo16_long_lllllllwlwwwl( func, ds, exStyle, clsName, winName, style, \
MAKELONG(y,x), MAKELONG(cy,cx), \
MAKELONG(hmenu,hparent), instance, params, \
hwnd, msg, wParam, lParam )
/* List of the 32-bit callback functions. This list is used */
/* by the build program to generate the file if1632/callto32.S */
......
......@@ -17,8 +17,7 @@ typedef struct tagCLASS
UINT32 magic; /* Magic number */
UINT32 cWindows; /* Count of existing windows */
UINT32 style; /* Class style */
UINT32 flags; /* Class flags (see below) */
WNDPROC16 lpfnWndProc; /* 16-bit window procedure */
WNDPROC16 lpfnWndProc; /* Window procedure */
INT32 cbClsExtra; /* Class extra bytes */
INT32 cbWndExtra; /* Window extra bytes */
LPSTR menuNameA; /* Default menu name (ASCII string) */
......@@ -33,9 +32,6 @@ typedef struct tagCLASS
LONG wExtra[1]; /* Class extra bytes */
} CLASS;
/* Class flags */
#define CLASS_FLAG_UNICODE 0x0001 /* Window procedure expects Unicode */
extern void CLASS_DumpClass( CLASS *class );
extern void CLASS_WalkClasses(void);
extern void CLASS_FreeModuleClasses( HMODULE hModule );
......
......@@ -17,9 +17,8 @@ typedef struct
BOOL fTileWallPaper;
} DESKTOPINFO;
extern BOOL DESKTOP_Init();
extern BOOL DESKTOP_SetPattern(char *pattern );
extern LRESULT DesktopWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
extern LRESULT DesktopWndProc( HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam );
#endif /* DESKTOP_H */
......@@ -103,10 +103,6 @@ typedef struct _HEAPITEM_OBJECT{
#define KERNEL_OBJECT_HEAP (KERNEL_OBJECT_UNUSED + 9)
#define KERNEL_OBJECT_HEAPITEM (KERNEL_OBJECT_UNUSED + 10)
/* Define the invalid handle value
*/
#define INVALID_HANDLE_VALUE ((HANDLE32)-1)
/* Functions for checking kernel objects.
*/
int ValidateKernelObject(KERNEL_OBJECT *ptr);
......
......@@ -32,6 +32,7 @@ typedef struct
#define HOOK_MAGIC ((int)'H' | (int)'K' << 8) /* 'HK' */
extern HANDLE HOOK_GetHook( short id , HQUEUE hQueue );
extern DWORD HOOK_CallHooks( short id, short code,
WPARAM wParam, LPARAM lParam );
extern void HOOK_FreeModuleHooks( HMODULE hModule );
......
......@@ -33,7 +33,6 @@ typedef struct {
BOOL OwnerDrawn;
WORD iNumStops;
LPINT16 TabStops;
HANDLE hDrawItemStruct;
BOOL needMeasure;
HANDLE HeapSel;
/* MDESC *Heap; */
......
......@@ -37,11 +37,9 @@ typedef struct
HMENU hWindowMenu;
WORD idFirstChild;
WORD nTotalCreated;
HANDLE hFrameTitle;
LPSTR frameTitle;
WORD sbNeedUpdate;
WORD sbRecalc;
HBITMAP obmClose;
HBITMAP obmRestore;
HWND self;
} MDICLIENTINFO;
......
/* $Id$
*
/*
* Menu definitions
*/
#ifndef MENU_H
#define MENU_H
#define MENU_MAGIC 0x554d /* 'MU' */
#ifndef __WINE_MENU_H
#define __WINE_MENU_H
extern BOOL MENU_Init(void);
extern HMENU MENU_GetDefSysMenu(void);
......@@ -18,49 +15,4 @@ extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT16 lprect,
HWND hwnd, BOOL suppress_draw );
extern LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam );
typedef struct tagMENUITEM
{
WORD item_flags; /* Item flags */
UINT item_id; /* Item or popup id */
RECT16 rect; /* Item area (relative to menu window) */
WORD xTab; /* X position of text after Tab */
HBITMAP hCheckBit; /* Bitmap for checked item */
HBITMAP hUnCheckBit; /* Bitmap for unchecked item */
HANDLE hText; /* Handle to item string or bitmap */
} MENUITEM, *LPMENUITEM;
typedef struct tagPOPUPMENU
{
HMENU hNext; /* Next menu (compatibility only, always 0) */
WORD wFlags; /* Menu flags (MF_POPUP, MF_SYSMENU) */
WORD wMagic; /* Magic number */
HANDLE hTaskQ; /* Task queue for this menu */
WORD Width; /* Width of the whole menu */
WORD Height; /* Height of the whole menu */
WORD nItems; /* Number of items in the menu */
HWND hWnd; /* Window containing the menu */
HANDLE hItems; /* Handle to the items array */
UINT FocusedItem; /* Currently focused item */
} POPUPMENU, *LPPOPUPMENU;
typedef struct
{
WORD version; /* Should be zero */
WORD reserved; /* Must be zero */
} MENU_HEADER;
typedef struct
{
WORD item_flags; /* See windows.h */
char item_text[1]; /* Text for menu item */
} MENU_POPUPITEM;
typedef struct
{
WORD item_flags; /* See windows.h */
WORD item_id; /* Control Id for menu item */
char item_text[1]; /* Text for menu item */
} MENUITEMTEMPLATE;
#endif /* MENU_H */
#endif /* __WINE_MENU_H */
......@@ -14,7 +14,7 @@ extern void NC_GetMinMaxInfo( HWND hwnd, POINT16 *maxSize, POINT16 *maxPos,
extern void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint );
extern LONG NC_HandleNCPaint( HWND hwnd , HRGN clip);
extern LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam );
extern LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS16 *params );
extern LONG NC_HandleNCCalcSize( WND *pWnd, RECT16 *winRect );
extern LONG NC_HandleNCHitTest( HWND hwnd, POINT16 pt );
extern LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam );
extern LONG NC_HandleNCLButtonDblClk( WND *pWnd, WPARAM wParam, LPARAM lParam);
......
/*
* Message Logging functions
* Message Logging functions
*/
#ifndef __WINE_SPY_H
#define __WINE_SPY_H
#define SPY_DISPATCHMESSAGE 0x0100
#define SPY_SENDMESSAGE 0x0101
#define SPY_DEFWNDPROC 0x0102
#include "wintypes.h"
#define SPY_RESULT_OK 0x0000
#define SPY_RESULT_INVALIDHWND 0x0001
#define SPY_DISPATCHMESSAGE16 0x0100
#define SPY_DISPATCHMESSAGE32 0x0101
#define SPY_SENDMESSAGE16 0x0102
#define SPY_SENDMESSAGE32 0x0103
#define SPY_DEFWNDPROC16 0x0104
#define SPY_DEFWNDPROC32 0x0105
extern void SPY_EnterMessage( int iFlag, HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam );
extern void SPY_ExitMessage( int iFlag, HWND hwnd, UINT msg, LRESULT lReturn );
#define SPY_RESULT_OK16 0x0000
#define SPY_RESULT_OK32 0x0001
#define SPY_RESULT_INVALIDHWND16 0x0002
#define SPY_RESULT_INVALIDHWND32 0x0003
extern void SPY_EnterMessage( INT32 iFlag, HWND32 hwnd, UINT32 msg,
WPARAM32 wParam, LPARAM lParam );
extern void SPY_ExitMessage( INT32 iFlag, HWND32 hwnd, UINT32 msg,
LRESULT lReturn );
extern int SPY_Init(void);
#endif /* __WINE_SPY_H */
......@@ -81,7 +81,6 @@
#undef DEBUG_BITBLT
#undef DEBUG_BITMAP
#undef DEBUG_CARET
#undef DEBUG_CATCH
#undef DEBUG_CDAUDIO
#undef DEBUG_CLASS
#undef DEBUG_CLIPBOARD
......@@ -148,7 +147,6 @@
#undef DEBUG_TEXT
#undef DEBUG_TIMER
#undef DEBUG_TOOLHELP
#undef DEBUG_UTILITY
#undef DEBUG_VXD
#undef DEBUG_WIN
#undef DEBUG_WIN32
......@@ -161,7 +159,6 @@
#define DEBUG_BITBLT
#define DEBUG_BITMAP
#define DEBUG_CARET
#define DEBUG_CATCH
#define DEBUG_CDAUDIO
#define DEBUG_CLASS
#define DEBUG_CLIPBOARD
......@@ -228,7 +225,6 @@
#define DEBUG_TEXT
#define DEBUG_TIMER
#define DEBUG_TOOLHELP
#define DEBUG_UTILITY
#define DEBUG_VXD
#define DEBUG_WIN
#define DEBUG_WIN32
......
......@@ -37,22 +37,22 @@ typedef struct tagWND
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND16 hwndSelf; /* Handle of this window */
HINSTANCE16 hInstance; /* Window hInstance (from CreateWindow) */
WNDPROC16 lpfnWndProc; /* Window procedure */
RECT16 rectClient; /* Client area rel. to parent client area */
RECT16 rectWindow; /* Whole window rel. to parent client area */
RECT16 rectNormal; /* Window rect. when in normal state */
POINT16 ptIconPos; /* Icon position */
POINT16 ptMaxPos; /* Maximized window position */
LPSTR text; /* Window text */
HGLOBAL hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HWND hwndLastActive;/* Last active popup hwnd */
WNDPROC lpfnWndProc; /* Window procedure */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HANDLE hVScroll; /* Vertical scroll-bar info */
HANDLE hHScroll; /* Horizontal scroll-bar info */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
HANDLE hText; /* Handle of window text */
WORD flags; /* Misc. flags (see below) */
Window window; /* X window (only for top-level windows) */
HMENU hSysMenu; /* window's copy of System Menu */
......@@ -70,7 +70,6 @@ typedef struct tagWND
#define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
#define WIN_UNICODE 0x0200 /* Window procedure expects Unicode */
/* Window functions */
extern WND *WIN_FindWndPtr( HWND hwnd );
......@@ -87,6 +86,8 @@ extern BOOL WIN_CreateDesktopWindow(void);
extern HWND WIN_GetTopParent( HWND hwnd );
extern HINSTANCE WIN_GetWindowInstance( HWND hwnd );
extern void DEFWND_SetText( WND *wndPtr, LPCSTR text ); /* windows/defwnd.c */
extern Display * display;
extern Screen * screen;
extern Window rootWindow;
......
......@@ -11,7 +11,7 @@
#endif
#define INVALID_HANDLE_VALUE ((HANDLE) -1)
#define INVALID_HANDLE_VALUE ((HANDLE32) -1)
#define WAIT_FAILED 0xffffffff
#define WAIT_OBJECT_0 0
......
......@@ -39,7 +39,8 @@ extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT16 *newWindowRect, RECT16 *oldWindowRect,
RECT16 *oldClientRect, SEGPTR winpos,
RECT16 *newClientRect );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS16 *winpos );
extern LONG WINPOS_HandleWindowPosChanging16(WND *wndPtr, WINDOWPOS16 *winpos);
extern LONG WINPOS_HandleWindowPosChanging32(WND *wndPtr, WINDOWPOS32 *winpos);
extern INT16 WINPOS_WindowFromPoint( POINT16 pt, WND **ppWnd );
#endif /* __WINE_WINPOS_H */
/*
* Window procedure callbacks definitions
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_WINPROC_H
#define __WINE_WINPROC_H
#include "wintypes.h"
typedef enum
{
WIN_PROC_INVALID,
WIN_PROC_16,
WIN_PROC_32A,
WIN_PROC_32W
} WINDOWPROCTYPE;
extern WNDPROC16 WINPROC_AllocWinProc( WNDPROC32 func, WINDOWPROCTYPE type );
extern WINDOWPROCTYPE WINPROC_GetWinProcType( WNDPROC16 func );
extern WNDPROC32 WINPROC_GetWinProcFunc( WNDPROC16 func );
extern void WINPROC_FreeWinProc( WNDPROC16 func );
#endif /* __WINE_WINPROC_H */
......@@ -45,12 +45,10 @@ WORD CallTo16_word_ ( FARPROC func, WORD arg ) { return func(arg); }
extern LRESULT ACTIVATEAPP_callback(HWND,UINT,WPARAM,LPARAM);
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ButtonWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT CARET_Callback(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ColorDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboBoxWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboLBoxWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT DesktopWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT EditWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FileOpenDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FileSaveDlgProc(HWND,UINT,WPARAM,LPARAM);
......@@ -82,13 +80,11 @@ WNDPROC MODULE_GetWndProcEntry16( char *name )
#define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return proc
MAP_STR_TO_PROC("ActivateAppProc",ACTIVATEAPP_callback);
MAP_STR_TO_PROC("AboutDlgProc",AboutDlgProc);
MAP_STR_TO_PROC("ButtonWndProc",ButtonWndProc);
MAP_STR_TO_PROC("CARET_Callback",CARET_Callback);
MAP_STR_TO_PROC("ColorDlgProc",ColorDlgProc);
MAP_STR_TO_PROC("ComboBoxWndProc",ComboBoxWndProc);
MAP_STR_TO_PROC("ComboLBoxWndProc",ComboLBoxWndProc);
MAP_STR_TO_PROC("DefDlgProc",DefDlgProc);
MAP_STR_TO_PROC("DesktopWndProc",DesktopWndProc);
MAP_STR_TO_PROC("EditWndProc",EditWndProc);
MAP_STR_TO_PROC("FileOpenDlgProc",FileOpenDlgProc);
MAP_STR_TO_PROC("FileSaveDlgProc",FileSaveDlgProc);
......
......@@ -148,12 +148,12 @@ static BUILTIN_DLL BuiltinDLLs[] =
{ &OLE32_Descriptor, 0 },
{ &GDI32_Descriptor, 0 },
{ &KERNEL32_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &NTDLL_Descriptor, 0 },
{ &NTDLL_Descriptor, 0 },
{ &SHELL32_Descriptor, 0 },
{ &USER32_Descriptor, 0 },
{ &WPROCS32_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WINSPOOL_Descriptor, 0 },
{ &WSOCK32_Descriptor, 0 },
{ &WSOCK32_Descriptor, 0 },
/* Last entry */
{ NULL, 0 }
};
......@@ -404,6 +404,7 @@ BOOL BUILTIN_ParseDLLOptions( const char *str )
}
if (!dll->descr) return FALSE;
str = p;
while (*str && (isspace(*str) || (*str == ','))) str++;
}
return TRUE;
}
......
......@@ -11,7 +11,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <string.h>
#include <errno.h>
#include "windows.h"
#include "alias.h"
#include "module.h"
#include "selectors.h"
#include "comm.h"
......@@ -112,9 +111,6 @@ int MAIN_Init(void)
/* GDI initialisation */
if (!GDI_Init()) return 0;
/* Initialise window procedures aliases */
if (!ALIAS_Init()) return 0;
/* Initialize system colors and metrics*/
SYSMETRICS_Init();
SYSCOLOR_Init();
......
......@@ -762,11 +762,14 @@ BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset )
FARPROC16 MODULE_GetWndProcEntry16( const char *name )
{
WORD ordinal;
FARPROC16 ret;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
return MODULE_GetEntryPoint( hModule, ordinal );
if (!(ret = MODULE_GetEntryPoint( hModule, ordinal )))
fprintf( stderr, "GetWndProc16: %s not found, please report\n", name );
return ret;
}
#endif
......@@ -779,10 +782,13 @@ FARPROC16 MODULE_GetWndProcEntry16( const char *name )
#ifndef WINELIB
FARPROC32 MODULE_GetWndProcEntry32( const char *name )
{
FARPROC32 ret;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WPROCS32" );
return PE_GetProcAddress( hModule, name );
if (!(ret = PE_GetProcAddress( hModule, name )))
fprintf( stderr, "GetWndProc32: %s not found, please report\n", name );
return ret;
}
#endif
......
......@@ -24,7 +24,6 @@
#include "peexe.h"
#include "pe_image.h"
#include "module.h"
#include "alias.h"
#include "global.h"
#include "task.h"
#include "ldt.h"
......@@ -538,8 +537,6 @@ HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
HINSTANCE hInstance;
struct mz_header_s mz_header;
ALIAS_UseAliases=1;
lseek(fd,0,SEEK_SET);
read( fd, &mz_header, sizeof(mz_header) );
......
......@@ -330,7 +330,7 @@ int TranslateAccelerator(HWND hWnd, HANDLE hAccel, LPMSG msg)
if(GetKeyState(VK_MENU) & 0x8000) mask |= ALT_ACCEL;
if(mask == (lpAccelTbl->tbl[i].type &
(SHIFT_ACCEL | CONTROL_ACCEL | ALT_ACCEL))) {
SendMessage(hWnd, WM_COMMAND, lpAccelTbl->tbl[i].wIDval,
SendMessage16(hWnd, WM_COMMAND, lpAccelTbl->tbl[i].wIDval,
0x00010000L);
GlobalUnlock16(hAccel);
return 1;
......@@ -342,7 +342,7 @@ int TranslateAccelerator(HWND hWnd, HANDLE hAccel, LPMSG msg)
else {
if (msg->wParam == lpAccelTbl->tbl[i].wEvent &&
msg->message == WM_CHAR) {
SendMessage(hWnd, WM_COMMAND, lpAccelTbl->tbl[i].wIDval, 0x00010000L);
SendMessage16(hWnd, WM_COMMAND, lpAccelTbl->tbl[i].wIDval, 0x00010000L);
GlobalUnlock16(hAccel);
return 1;
}
......
......@@ -1064,12 +1064,14 @@ void GetTaskQueueES( struct sigcontext_struct context )
*/
HTASK GetCurrentTask(void)
{
/* Undocumented: first task is returned in high word */
#ifdef WINELIB32
return hCurrentTask;
#else
}
DWORD WIN16_GetCurrentTask(void)
{
/* This is the version used by relay code; the first task is */
/* returned in the high word of the result */
return MAKELONG( hCurrentTask, hFirstTask );
#endif
}
......
......@@ -16,6 +16,8 @@
#include <string.h>
#include "windows.h"
#include "ldt.h"
#include "global.h"
#include "heap.h"
#include "instance.h"
#include "local.h"
#include "module.h"
......@@ -112,7 +114,7 @@ static LOCALHEAPINFO *LOCAL_GetHeap( HANDLE16 ds )
LOCALHEAPINFO *pInfo;
INSTANCEDATA *ptr = (INSTANCEDATA *)PTR_SEG_OFF_TO_LIN( ds, 0 );
dprintf_local( stddeb, "Heap at %p, %04x\n", ptr, ptr->heap );
if (!ptr->heap) return NULL;
if (!ptr || !ptr->heap) return NULL;
if (IsBadReadPtr((SEGPTR)MAKELONG( ptr->heap, ds ), sizeof(LOCALHEAPINFO)))
return NULL;
pInfo = (LOCALHEAPINFO*)((char*)ptr + ptr->heap);
......@@ -1022,7 +1024,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
LOCALHEAPINFO *pInfo;
LOCALARENA *pArena, *pNext;
LOCALHANDLEENTRY *pEntry;
WORD arena, newhandle, blockhandle;
WORD arena, newhandle, blockhandle, oldsize;
LONG nextarena;
if (!handle) return LOCAL_Alloc( ds, size, flags );
......@@ -1104,6 +1106,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
}
size = LALIGN( size );
oldsize = pArena->next - arena - ARENA_HEADER_SIZE;
nextarena = LALIGN(blockhandle + size);
/* Check for size reduction */
......@@ -1154,19 +1157,28 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); /* Reload ptr */
if (!newhandle)
{
/* Check if previous block is free and large enough */
LOCALARENA *pPrev = ARENA_PTR( ptr, pArena->prev & 3 );
if (((pPrev->prev & 3) == LOCAL_ARENA_FREE) &&
(pPrev->size + pArena->next >= nextarena))
/* Remove the block from the heap and try again */
LPSTR buffer = HeapAlloc( SystemHeap, 0, oldsize );
if (!buffer) return 0;
memcpy( buffer, ptr + (arena + ARENA_HEADER_SIZE), oldsize );
LOCAL_FreeArena( ds, arena );
if (!(newhandle = LOCAL_GetBlock( ds, size, flags )))
{
newhandle = (pArena->prev & ~3) + ARENA_HEADER_SIZE;
LOCAL_GrowArenaDownward( ds, arena, size + ARENA_HEADER_SIZE );
if (!(newhandle = LOCAL_GetBlock( ds, oldsize, flags )))
{
fprintf( stderr, "LocalRealloc: can't restore saved block\n" );
HeapFree( SystemHeap, 0, buffer );
return 0;
}
size = oldsize;
}
else return 0; /* Nothing to do, no space left for the block */
ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); /* Reload ptr */
memcpy( ptr + newhandle, buffer, oldsize );
HeapFree( SystemHeap, 0, buffer );
}
else
{
memcpy( ptr + newhandle, ptr + (arena + ARENA_HEADER_SIZE), size );
memcpy( ptr + newhandle, ptr + (arena + ARENA_HEADER_SIZE), oldsize );
LOCAL_FreeArena( ds, arena );
}
if (HANDLE_MOVEABLE( handle ))
......@@ -1177,6 +1189,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
pEntry->lock = 0;
newhandle = handle;
}
if (size == oldsize) newhandle = 0; /* Realloc failed */
dprintf_local( stddeb, "LocalReAlloc: returning %04x\n", newhandle );
return newhandle;
}
......@@ -1541,7 +1554,7 @@ BOOL LocalInfo( LOCALINFO *pLocalInfo, HGLOBAL handle )
*/
BOOL LocalFirst( LOCALENTRY *pLocalEntry, HGLOBAL handle )
{
WORD ds = SELECTOROF( WIN16_GlobalLock16( handle ) );
WORD ds = GlobalHandleToSel( handle );
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
LOCALHEAPINFO *pInfo = LOCAL_GetHeap( ds );
if (!pInfo) return FALSE;
......@@ -1564,7 +1577,7 @@ BOOL LocalFirst( LOCALENTRY *pLocalEntry, HGLOBAL handle )
*/
BOOL LocalNext( LOCALENTRY *pLocalEntry )
{
WORD ds = SELECTOROF( pLocalEntry->hHeap );
WORD ds = GlobalHandleToSel( pLocalEntry->hHeap );
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
LOCALARENA *pArena;
......
......@@ -86,7 +86,7 @@ BOOL ExitWindows( DWORD dwReturnCode, WORD wReserved )
{
/* Make sure that window still exists */
if (!IsWindow(*pWnd)) continue;
if (!SendMessage( *pWnd, WM_QUERYENDSESSION, 0, 0 )) break;
if (!SendMessage16( *pWnd, WM_QUERYENDSESSION, 0, 0 )) break;
}
result = (i == count);
......@@ -95,7 +95,7 @@ BOOL ExitWindows( DWORD dwReturnCode, WORD wReserved )
for (pWnd = list; i > 0; i--, pWnd++)
{
if (!IsWindow(*pWnd)) continue;
SendMessage( *pWnd, WM_ENDSESSION, result, 0 );
SendMessage16( *pWnd, WM_ENDSESSION, result, 0 );
}
free( list );
......@@ -176,5 +176,5 @@ BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
} else
lpwh->ofsData = 0;
GlobalUnlock16(hwh);
return SendMessage(hDest,WM_WINHELP,hWnd,hwh);
return SendMessage16(hDest,WM_WINHELP,hWnd,hwh);
}
......@@ -336,14 +336,14 @@ LRESULT AboutDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch(msg) {
case WM_INITDIALOG:
#ifdef WINELIB32
SendDlgItemMessage(hWnd,stc1,STM_SETICON,lParam,0);
SendDlgItemMessage32A(hWnd,stc1,STM_SETICON,lParam,0);
#else
SendDlgItemMessage(hWnd,stc1,STM_SETICON,LOWORD(lParam),0);
SendDlgItemMessage16(hWnd,stc1,STM_SETICON,LOWORD(lParam),0);
#endif
GetWindowText(hWnd, Template, 511);
GetWindowText32A(hWnd, Template, sizeof(Template));
sprintf(AppTitle, Template, AppName);
SetWindowText(hWnd, AppTitle);
SetWindowText(GetDlgItem(hWnd,100), AppMisc);
SetWindowText32A(hWnd, AppTitle);
SetWindowText32A(GetDlgItem(hWnd,100), AppMisc);
return 1;
case WM_COMMAND:
......
......@@ -430,21 +430,28 @@ static const char *SPY_GetMsgName( UINT msg )
/***********************************************************************
* SPY_EnterMessage
*/
void SPY_EnterMessage( int iFlag, HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam )
void SPY_EnterMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg,
WPARAM32 wParam, LPARAM lParam )
{
if (!debugging_message || SPY_EXCLUDE(msg)) return;
/* each SPY_SENDMESSAGE must be complemented by call to ExitSpyMessage */
/* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
switch(iFlag)
{
case SPY_DISPATCHMESSAGE:
dprintf_message(stddeb,"(%04x) message [%04x] %s dispatched wp=%04x lp=%08lx\n",
hWnd, msg, SPY_GetMsgName( msg ),
case SPY_DISPATCHMESSAGE16:
dprintf_message(stddeb,"%*s(%04x) message [%04x] %s dispatched wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, msg, SPY_GetMsgName( msg ),
wParam, lParam);
break;
case SPY_SENDMESSAGE:
case SPY_DISPATCHMESSAGE32:
dprintf_message(stddeb,"%*s(%08x) message [%04x] %s dispatched wp=%08x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, msg, SPY_GetMsgName( msg ),
wParam, lParam);
break;
case SPY_SENDMESSAGE16:
case SPY_SENDMESSAGE32:
{
char taskName[30];
HTASK hTask = GetWindowTask(hWnd);
......@@ -453,43 +460,66 @@ void SPY_EnterMessage( int iFlag, HWND hWnd, UINT msg,
else sprintf( taskName, "task %04x %s",
hTask, MODULE_GetModuleName( GetExePtr(hTask) ) );
dprintf_message(stddeb,"%*s(%04x) message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ), taskName, wParam, lParam );
SPY_IndentLevel += SPY_INDENT_UNIT;
if (iFlag == SPY_SENDMESSAGE16)
dprintf_message(stddeb,"%*s(%04x) message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ), taskName, wParam,
lParam );
else
dprintf_message(stddeb,"%*s(%08x) message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ), taskName, wParam,
lParam );
}
break;
case SPY_DEFWNDPROC:
case SPY_DEFWNDPROC16:
dprintf_message(stddeb, "%*s(%04x) DefWindowProc: %s [%04x] wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
msg, wParam, lParam );
break;
case SPY_DEFWNDPROC32:
dprintf_message(stddeb, "%*s(%08x) DefWindowProc: %s [%04x] wp=%08x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
msg, wParam, lParam );
break;
}
SPY_IndentLevel += SPY_INDENT_UNIT;
}
/***********************************************************************
* SPY_ExitMessage
*/
void SPY_ExitMessage( int iFlag, HWND hWnd, UINT msg, LRESULT lReturn )
void SPY_ExitMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, LRESULT lReturn )
{
if (!debugging_message || SPY_EXCLUDE(msg)) return;
if (SPY_IndentLevel) SPY_IndentLevel -= SPY_INDENT_UNIT;
switch(iFlag)
{
case SPY_RESULT_INVALIDHWND:
case SPY_RESULT_OK16:
dprintf_message(stddeb,"%*s(%04x) message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ), lReturn );
break;
case SPY_RESULT_OK32:
dprintf_message(stddeb,"%*s(%08x) message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ), lReturn );
break;
case SPY_RESULT_INVALIDHWND16:
dprintf_message(stddeb,"%*s(%04x) message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ) );
break;
case SPY_RESULT_OK:
dprintf_message(stddeb,"%*s(%04x) message [%04x] %s returned %08lx\n",
case SPY_RESULT_INVALIDHWND32:
dprintf_message(stddeb,"%*s(%08x) message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, msg,
SPY_GetMsgName( msg ), lReturn );
SPY_GetMsgName( msg ) );
break;
}
}
}
......
......@@ -101,7 +101,7 @@ HBITMAP CreateBitmap( INT width, INT height, UINT planes, UINT bpp, LPVOID bits
bmpObjPtr->bitmap.bmHeight = height;
bmpObjPtr->bitmap.bmPlanes = planes;
bmpObjPtr->bitmap.bmBitsPixel = bpp;
bmpObjPtr->bitmap.bmWidthBytes = (width * bpp + 15) / 16 * 2;
bmpObjPtr->bitmap.bmWidthBytes = BITMAP_WIDTH_BYTES( width, bpp );
bmpObjPtr->bitmap.bmBits = NULL;
/* Create the pixmap */
......
......@@ -536,9 +536,9 @@ HANDLE CreateCursorIconIndirect( HANDLE hInstance, CURSORICONINFO *info,
hInstance = GetExePtr( hInstance ); /* Make it a module handle */
if (!hInstance || !lpXORbits || !lpANDbits || info->bPlanes != 1) return 0;
info->nWidthBytes = (info->nWidth * info->bBitsPerPixel + 15) / 16 * 2;
info->nWidthBytes = BITMAP_WIDTH_BYTES(info->nWidth,info->bBitsPerPixel);
sizeXor = info->nHeight * info->nWidthBytes;
sizeAnd = info->nHeight * ((info->nWidth + 15) / 16 * 2);
sizeAnd = info->nHeight * BITMAP_WIDTH_BYTES( info->nWidth, 1 );
if (!(handle = DirectResAlloc(hInstance, 0x10,
sizeof(CURSORICONINFO) + sizeXor + sizeAnd)))
return 0;
......@@ -624,7 +624,7 @@ BOOL DrawIcon( HDC hdc, INT x, INT y, HICON hIcon )
hAndBits = CreateBitmap( ptr->nWidth, ptr->nHeight, 1, 1, (char *)(ptr+1));
hXorBits = CreateBitmap( ptr->nWidth, ptr->nHeight, ptr->bPlanes,
ptr->bBitsPerPixel, (char *)(ptr + 1)
+ ptr->nHeight * ((ptr->nWidth + 15) / 16 * 2) );
+ ptr->nHeight * BITMAP_WIDTH_BYTES(ptr->nWidth,1) );
oldFg = SetTextColor( hdc, RGB(0,0,0) );
oldBg = SetBkColor( hdc, RGB(255,255,255) );
......@@ -657,7 +657,7 @@ DWORD DumpIcon( SEGPTR pInfo, WORD *lpLen,
if (!info) return 0;
sizeXor = info->nHeight * info->nWidthBytes;
sizeAnd = info->nHeight * ((info->nWidth + 15) / 16 * 2);
sizeAnd = info->nHeight * BITMAP_WIDTH_BYTES( info->nWidth, 1 );
if (lpAndBits) *lpAndBits = pInfo + sizeof(CURSORICONINFO);
if (lpXorBits) *lpXorBits = pInfo + sizeof(CURSORICONINFO) + sizeAnd;
if (lpLen) *lpLen = sizeof(CURSORICONINFO) + sizeAnd + sizeXor;
......
......@@ -317,7 +317,7 @@ static HBITMAP OBM_MakeBitmap( WORD width, WORD height,
bmpObjPtr->bitmap.bmType = 0;
bmpObjPtr->bitmap.bmWidth = width;
bmpObjPtr->bitmap.bmHeight = height;
bmpObjPtr->bitmap.bmWidthBytes = (width * bpp + 15) / 16 * 2;
bmpObjPtr->bitmap.bmWidthBytes = BITMAP_WIDTH_BYTES( width, bpp );
bmpObjPtr->bitmap.bmPlanes = 1;
bmpObjPtr->bitmap.bmBitsPixel = bpp;
bmpObjPtr->bitmap.bmBits = NULL;
......@@ -440,7 +440,7 @@ HANDLE OBM_LoadCursorIcon( WORD id, BOOL fCursor )
bmpXor = (BITMAPOBJ *) GDI_GetObjPtr( hXorBits, BITMAP_MAGIC );
bmpAnd = (BITMAPOBJ *) GDI_GetObjPtr( hAndBits, BITMAP_MAGIC );
sizeXor = bmpXor->bitmap.bmHeight * bmpXor->bitmap.bmWidthBytes;
sizeAnd = bmpXor->bitmap.bmHeight * ((bmpXor->bitmap.bmWidth+15) / 16 * 2);
sizeAnd = bmpXor->bitmap.bmHeight * BITMAP_WIDTH_BYTES( bmpXor->bitmap.bmWidth, 1 );
if (!(handle = GlobalAlloc16( GMEM_MOVEABLE,
sizeof(CURSORICONINFO) + sizeXor + sizeAnd)))
......
......@@ -250,20 +250,19 @@ INT16 DrawText16( HDC16 hdc, LPCSTR str, INT16 i_count,
{
if (!ExtTextOut16(hdc, x, y, (flags & DT_NOCLIP) ? 0 : ETO_CLIPPED,
rect, line, len, NULL )) return 0;
if (prefix_offset != -1)
{
HPEN16 hpen = CreatePen( PS_SOLID, 1, GetTextColor(hdc) );
HPEN16 oldPen = SelectObject( hdc, hpen );
MoveTo(hdc, x + prefix_x, y + tm.tmAscent + 1 );
LineTo(hdc, x + prefix_end, y + tm.tmAscent + 1 );
SelectObject( hdc, oldPen );
DeleteObject( hpen );
}
}
else if (size.cx > max_width)
max_width = size.cx;
if (prefix_offset != -1)
{
HPEN16 hpen = CreatePen( PS_SOLID, 1, GetTextColor(hdc) );
HPEN16 oldPen = SelectObject( hdc, hpen );
MoveTo(hdc, x + prefix_x, y + tm.tmAscent + 1 );
LineTo(hdc, x + prefix_end, y + tm.tmAscent + 1 );
SelectObject( hdc, oldPen );
DeleteObject( hpen );
}
y += lh;
if (strPtr)
{
......
Sat May 18 11:06:02 1996 Pablo Saratxaga <srtxg@f2219.n293.z2.fidonet.org>
* [Fr.rc] (new)
Added French language support.
Thu May 16 19:24:19 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [macro.lex.l] [macro.yacc.y]
Support older versions of Flex.
Mon Apr 29 19:48:15 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [winhelp.c] [winhelp.h] [hlpfile.c] [hlpfile.h]
......
/*
* Help Viewer
*
* Copyright 1996 Ulrich Schmid
* French language by Pablo Saratxaga <srtxg@f2219.n293.z2.fidonet.org>
*/
/* This file is not yet complete !! */
/* Alors peut-être ceci aidera (so maybe this will help) :) */
/* #include ../progman/Fr.rc */
#define LANGUAGE_ID Fr
#define LANGUAGE_NUMBER 4
/* Menu */
#define MENU_FILE "&Fichier"
#define MENU_FILE_OPEN "O&uvrir..."
#define MENU_FILE_PRINT "&Imprimer la rubrique"
#define MENU_FILE_PRINTER_SETUP "&Configuration de l'impression..."
#define MENU_FILE_EXIT "&Quitter"
#define MENU_EDIT "&Edition"
#define MENU_EDIT_COPY_DIALOG "&Copier..."
#define MENU_EDIT_ANNOTATE "&Annotation..."
#define MENU_BOOKMARK "&Signet"
#define MENU_BOOKMARK_DEFINE "&Définir..."
#define MENU_HELP "&?"
#define MENU_HELP_ON_HELP "&Utiliser l'aide"
#define MENU_HELP_ON_TOP "&Toujours visible"
#define MENU_HELP_INFO "&Info..."
#define MENU_HELP_ABOUT_WINE "&A propos de WINE"
/*
Configuration de l'imprimante
*/
/* Strings */
#define STRING_WINE_HELP "Aide de WINE"
#define STRING_ERROR "ERREUR"
#define STRING_WARNING "WARNING"
#define STRING_INFO "Information"
#define STRING_NOT_IMPLEMENTED "Non implementé"
#define STRING_HLPFILE_ERROR_s "Une erreur est survenue en lisant le fichier d'aide `%s'"
#define STRING_CONTENTS "&Index"
#define STRING_SEARCH "&Rechercher"
#define STRING_BACK "&Précédent"
#define STRING_HISTORY "&Historique"
#define STRING_ALL_FILES "Tout fichier (*.*)"
#define STRING_HELP_FILES_HLP "Fichiers d'aide (*.hlp)"
#include "Xx.rc"
......@@ -3,7 +3,7 @@ MODULE = none
PROGRAMS = winhelp hlp2sgml
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
LANGUAGES = En De
LANGUAGES = En De Fr
# Installation infos
......@@ -54,7 +54,7 @@ y.tab.c y.tab.h: macro.yacc.y
$(YACC) -d -t macro.yacc.y
lex.yy.c: macro.lex.l
$(LEX) -8 -I macro.lex.l
$(LEX) -8 -i macro.lex.l
$(LANGUAGES:%=%.c) $(LANGUAGES:%=%.h): $(WINERC) Xx.rc
......
......@@ -250,29 +250,26 @@ int main(int argc, char **argv)
* Substitutions for some WINELIB functions
*/
static FILE *file = 0;
HFILE OpenFile( LPCSTR path, OFSTRUCT *ofs, UINT mode )
{
FILE *file;
if (!*path) return (HFILE) stdin;
file = fopen(path, "r");
if (!file) return HFILE_ERROR;
return (HFILE) file;
file = *path ? fopen(path, "r") : stdin;
return file ? 1 : HFILE_ERROR;
}
HFILE _lclose( HFILE hFile )
{
fclose((FILE*) hFile);
fclose(file);
return 0;
}
LONG _hread( HFILE hFile, SEGPTR buffer, LONG count )
{
return fread(buffer, 1, count, (FILE*) hFile);
return fread(buffer, 1, count, file);
}
HGLOBAL GlobalAlloc( WORD flags, DWORD size )
HGLOBAL GlobalAlloc( UINT flags, DWORD size )
{
return (HGLOBAL) malloc(size);
}
......
......@@ -968,8 +968,8 @@ VOID HLPFILE_FreeHlpFile(HLPFILE* hlpfile)
HLPFILE_DeletePage(hlpfile->first_page);
HLPFILE_DeleteMacro(hlpfile->first_macro);
GlobalFree(hlpfile->hContext);
GlobalFree(hlpfile->hTitle);
if (hlpfile->hContext) GlobalFree(hlpfile->hContext);
if (hlpfile->hTitle) GlobalFree(hlpfile->hTitle);
GlobalFree(hlpfile->hSelf);
}
......
......@@ -11,7 +11,6 @@ VOID MACRO_ExecuteMacro(LPCSTR);
INT yyparse(VOID);
INT yylex(VOID);
VOID yyerror(LPCSTR);
extern CHAR MACRO_extra_separator;
VOID MACRO_About(VOID);
VOID MACRO_AddAccelerator(LONG, LONG, LPCSTR);
......
......@@ -6,25 +6,19 @@
*/
%}
%x quote dquote
%x null_string
%{
#include "macro.h"
#include "y.tab.h"
static LPCSTR macroptr, firsttoken, thistoken, nexttoken, current_string;
static LPCSTR macroptr;
static LPSTR strptr;
static HGLOBAL hStringBuffer = 0;
CHAR MACRO_extra_separator = 0;
static INT nested_quotes = 0;
#define YY_INPUT(buf,result,max_size)\
if ((result = *macroptr ? 1 : 0)) buf[0] = *macroptr++;
#define YY_USER_ACTION\
if (YY_START == INITIAL) thistoken = nexttoken, nexttoken = macroptr;
#define YY_NO_UNPUT
#define YY_NO_TOP_STATE
%}
%%
About yylval = MACRO_About; return VOID_FUNCTION_VOID;
......@@ -130,56 +124,35 @@ UpdateWindow|UW yylval = MACRO_UpdateWindow; return VOID_FUNCTION_2STRING;
hStringBuffer = GlobalAlloc(GMEM_FIXED, strlen(macroptr));
strptr = GlobalLock(hStringBuffer);
}
current_string = strptr;
yy_push_state(yytext[0] == '`' ? quote : dquote);
yylval = strptr;
BEGIN (yytext[0] == '`' ? quote : dquote);
}
<quote>\` {
*strptr++ = yytext[0];
yy_push_state(quote);
nested_quotes++;
}
<quote>\' |
<dquote>\" {
yy_pop_state();
if (YY_START == INITIAL)
if (nested_quotes)
{
*strptr++ = '\0';
if (MACRO_extra_separator)
{
yy_push_state(null_string);
MACRO_extra_separator = 0;
}
yylval = current_string;
return STRING;
nested_quotes--;
*strptr++ = yytext[0];
}
else *strptr++ = yytext[0];
}
<quote,dquote>{
. {
if (MACRO_extra_separator == (CHAR) yytext[0])
else
{
BEGIN INITIAL;
*strptr++ = '\0';
MACRO_extra_separator = 0;
yylval = current_string;
current_string = strptr;
return STRING;
}
else *strptr++ = yytext[0];
}
\\. *strptr++ = yytext[1];
<quote,dquote>. *strptr++ = yytext[0];
<quote,dquote>\\. *strptr++ = yytext[1];
<<EOF>> return 0;
}
<quote,dquote><<EOF>> return 0;
<null_string>"" {
yy_pop_state();
yylval = (LPCSTR) 0;
return STRING;
}
" "
......@@ -193,7 +166,7 @@ static LRESULT MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
if (msg == WM_COMMAND && wParam == IDOK)
{
GetDlgItemText(hDlg, 99, szTestMacro, sizeof(szTestMacro));
EndDialog(hDlg, IDCANCEL);
EndDialog(hDlg, IDOK);
return TRUE;
}
return FALSE;
......@@ -201,16 +174,6 @@ static LRESULT MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
VOID MACRO_ExecuteMacro(LPCSTR macro)
{
static BOOL init = TRUE;
if (init) init = FALSE;
else
{
YY_FLUSH_BUFFER;
while (YY_START != INITIAL)
yy_pop_state();
}
if (!lstrcmpi(macro, "MacroTest"))
{
WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance);
......@@ -219,7 +182,7 @@ VOID MACRO_ExecuteMacro(LPCSTR macro)
macro = szTestMacro;
}
macroptr = firsttoken = thistoken = nexttoken = macro;
macroptr = macro;
yyparse();
......@@ -229,7 +192,12 @@ VOID MACRO_ExecuteMacro(LPCSTR macro)
void yyerror (const char *s)
{
fprintf(stderr, "%s\n%.*s\n%*s%s\n", s,
thistoken - firsttoken, firsttoken,
thistoken - firsttoken, "", thistoken);
fprintf(stderr, "%s\n", s);
nested_quotes = 0;
BEGIN INITIAL;
yyrestart(yyin);
}
#ifndef yywrap
int yywrap(void) { return 1; }
#endif
......@@ -6,75 +6,73 @@
*/
#include "macro.h"
static int skip = 0;
static int skip = 0;
static LPSTR filename;
static LPSTR windowname;
%}
%union
{
BOOL bool;
LPCSTR string;
LONG integer;
VOID (*void_function_void)(VOID);
LPSTR string;
BOOL (*bool_function_void)(VOID);
VOID (*void_function_string)(LPCSTR);
BOOL (*bool_function_string)(LPCSTR);
BOOL (*bool_funktion_string)(LPCSTR);
BOOL (*bool_funktion_void)(VOID);
VOID (*void_funktion_2int_3uint_string)(LONG,LONG,LONG,LONG,LONG,LPCSTR);
VOID (*void_funktion_2string)(LPCSTR,LPCSTR);
VOID (*void_funktion_2string_2uint_2string)(LPCSTR,LPCSTR,LONG,LONG,LPCSTR,LPCSTR);
VOID (*void_funktion_2string_uint)(LPCSTR,LPCSTR,LONG);
VOID (*void_funktion_2string_uint_string)(LPCSTR,LPCSTR,LONG,LPCSTR);
VOID (*void_funktion_2string_wparam_lparam_string)(LPCSTR,LPCSTR,WPARAM,LPARAM,LPCSTR);
VOID (*void_funktion_2uint)(LONG,LONG);
VOID (*void_funktion_2uint_string)(LONG,LONG,LPCSTR);
VOID (*void_funktion_3string)(LPCSTR,LPCSTR,LPCSTR);
VOID (*void_funktion_3string_2uint)(LPCSTR,LPCSTR,LPCSTR,LONG,LONG);
VOID (*void_funktion_3uint)(LONG,LONG,LONG);
VOID (*void_funktion_4string)(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
VOID (*void_funktion_4string_2uint)(LPCSTR,LPCSTR,LPCSTR,LPCSTR,LONG,LONG);
VOID (*void_funktion_4string_uint)(LPCSTR,LPCSTR,LPCSTR,LPCSTR,LONG);
VOID (*void_funktion_string)(LPCSTR);
VOID (*void_funktion_string_uint)(LPCSTR,LONG);
VOID (*void_funktion_string_uint_2string)(LPCSTR,LONG,LPCSTR,LPCSTR);
VOID (*void_funktion_string_uint_string)(LPCSTR,LONG,LPCSTR);
VOID (*void_funktion_string_wparam_lparam)(LPCSTR,WPARAM,LPARAM);
VOID (*void_funktion_uint)(LONG);
VOID (*void_funktion_void)(VOID);
VOID (*void_function_void)(VOID);
VOID (*void_function_uint)(LONG);
VOID (*void_function_string)(LPCSTR);
VOID (*void_function_2int_3uint_string)(LONG,LONG,LONG,LONG,LONG,LPCSTR);
VOID (*void_function_2string)(LPCSTR,LPCSTR);
VOID (*void_function_2string_2uint_2string)(LPCSTR,LPCSTR,LONG,LONG,LPCSTR,LPCSTR);
VOID (*void_function_2string_uint)(LPCSTR,LPCSTR,LONG);
VOID (*void_function_2string_uint_string)(LPCSTR,LPCSTR,LONG,LPCSTR);
VOID (*void_function_2string_wparam_lparam_string)(LPCSTR,LPCSTR,WPARAM,LPARAM,LPCSTR);
VOID (*void_function_2uint)(LONG,LONG);
VOID (*void_function_2uint_string)(LONG,LONG,LPCSTR);
VOID (*void_function_3string)(LPCSTR,LPCSTR,LPCSTR);
VOID (*void_function_3string_2uint)(LPCSTR,LPCSTR,LPCSTR,LONG,LONG);
VOID (*void_function_3uint)(LONG,LONG,LONG);
VOID (*void_function_4string)(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
VOID (*void_function_4string_2uint)(LPCSTR,LPCSTR,LPCSTR,LPCSTR,LONG,LONG);
VOID (*void_function_4string_uint)(LPCSTR,LPCSTR,LPCSTR,LPCSTR,LONG);
VOID (*void_function_string_uint)(LPCSTR,LONG);
VOID (*void_function_string_uint_2string)(LPCSTR,LONG,LPCSTR,LPCSTR);
VOID (*void_function_string_uint_string)(LPCSTR,LONG,LPCSTR);
VOID (*void_function_string_wparam_lparam)(LPCSTR,WPARAM,LPARAM);
}
%token NOT
%token IF_THEN
%token IF_THEN_ELSE
%token <string> STRING
%token <integer> INTEGER
%token <bool_funktion_string> BOOL_FUNCTION_STRING
%token <bool_funktion_void> BOOL_FUNCTION_VOID
%token <void_funktion_2int_3uint_string> VOID_FUNCTION_2INT_3UINT_STRING
%token <void_funktion_2string> VOID_FUNCTION_2STRING
%token <void_funktion_2string_2uint_2string> VOID_FUNCTION_2STRING_2UINT_2STRING
%token <void_funktion_2string_uint> VOID_FUNCTION_2STRING_UINT
%token <void_funktion_2string_uint_string> VOID_FUNCTION_2STRING_UINT_STRING
%token <void_funktion_2string_wparam_lparam_string> VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING
%token <void_funktion_2uint> VOID_FUNCTION_2UINT
%token <void_funktion_2uint_string> VOID_FUNCTION_2UINT_STRING
%token <void_funktion_3string> VOID_FUNCTION_3STRING
%token <void_funktion_3string_2uint> VOID_FUNCTION_3STRING_2UINT
%token <void_funktion_3uint> VOID_FUNCTION_3UINT
%token <void_funktion_4string> VOID_FUNCTION_4STRING
%token <void_funktion_4string_2uint> VOID_FUNCTION_4STRING_2UINT
%token <void_funktion_4string_uint> VOID_FUNCTION_4STRING_UINT
%token <void_funktion_string> VOID_FUNCTION_STRING
%token <void_funktion_string_uint> VOID_FUNCTION_STRING_UINT
%token <void_funktion_string_uint_2string> VOID_FUNCTION_STRING_UINT_2STRING
%token <void_funktion_string_uint_string> VOID_FUNCTION_STRING_UINT_STRING
%token <void_funktion_string_wparam_lparam> VOID_FUNCTION_STRING_WPARAM_LPARAM
%token <void_funktion_uint> VOID_FUNCTION_UINT
%token <void_funktion_void> VOID_FUNCTION_VOID
%token <void_funktion_2string> VOID_FUNCTION_FILE_WIN
%token <void_funktion_3string> VOID_FUNCTION_FILE_WIN_STRING
%token <void_funktion_2string_uint> VOID_FUNCTION_FILE_WIN_UINT
%token <bool_function_string> BOOL_FUNCTION_STRING
%token <bool_function_void> BOOL_FUNCTION_VOID
%token <void_function_2int_3uint_string> VOID_FUNCTION_2INT_3UINT_STRING
%token <void_function_2string> VOID_FUNCTION_2STRING
%token <void_function_2string_2uint_2string> VOID_FUNCTION_2STRING_2UINT_2STRING
%token <void_function_2string_uint> VOID_FUNCTION_2STRING_UINT
%token <void_function_2string_uint_string> VOID_FUNCTION_2STRING_UINT_STRING
%token <void_function_2string_wparam_lparam_string> VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING
%token <void_function_2uint> VOID_FUNCTION_2UINT
%token <void_function_2uint_string> VOID_FUNCTION_2UINT_STRING
%token <void_function_3string> VOID_FUNCTION_3STRING
%token <void_function_3string_2uint> VOID_FUNCTION_3STRING_2UINT
%token <void_function_3uint> VOID_FUNCTION_3UINT
%token <void_function_4string> VOID_FUNCTION_4STRING
%token <void_function_4string_2uint> VOID_FUNCTION_4STRING_2UINT
%token <void_function_4string_uint> VOID_FUNCTION_4STRING_UINT
%token <void_function_string> VOID_FUNCTION_STRING
%token <void_function_string_uint> VOID_FUNCTION_STRING_UINT
%token <void_function_string_uint_2string> VOID_FUNCTION_STRING_UINT_2STRING
%token <void_function_string_uint_string> VOID_FUNCTION_STRING_UINT_STRING
%token <void_function_string_wparam_lparam> VOID_FUNCTION_STRING_WPARAM_LPARAM
%token <void_function_uint> VOID_FUNCTION_UINT
%token <void_function_void> VOID_FUNCTION_VOID
%token <void_function_2string> VOID_FUNCTION_FILE_WIN
%token <void_function_3string> VOID_FUNCTION_FILE_WIN_STRING
%token <void_function_2string_uint> VOID_FUNCTION_FILE_WIN_UINT
%type <bool> bool_macro
%type <string> filename
%%
macrostring: macro |
......@@ -153,16 +151,21 @@ macro: /* Empty */ |
'(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ',' STRING ')'
{if (! skip) (*$1)($3, $5, $7, $9, $11, $13);} |
VOID_FUNCTION_FILE_WIN
'(' filename STRING ')'
{if (! skip) (*$1)($3, $4);} |
'(' file_win ')'
{if (! skip) (*$1)(filename, windowname);} |
VOID_FUNCTION_FILE_WIN_STRING
'(' filename STRING ',' STRING ')'
{if (! skip) (*$1)($3, $4, $6);} |
'(' file_win ',' STRING ')'
{if (! skip) (*$1)(filename, windowname, $5);} |
VOID_FUNCTION_FILE_WIN_UINT
'(' filename STRING ',' INTEGER ')'
{if (! skip) (*$1)($3, $4, $6);} ;
'(' file_win ',' INTEGER ')'
{if (! skip) (*$1)(filename, windowname, $5);} ;
filename: {MACRO_extra_separator = '>'} STRING {$$ = $2;} ;
file_win: STRING
{
filename = windowname = $1;
while (*windowname && *windowname != '>') windowname++;
if (*windowname) *windowname++ = 0;
} ;
bool_macro: NOT '(' bool_macro ')' {$$ = ! $3;} |
STRING {$$ = MACRO_IsMark($1);} |
......
......@@ -16,6 +16,7 @@ extern const char people[];
VOID LIBWINE_Register_De(void);
VOID LIBWINE_Register_En(void);
VOID LIBWINE_Register_Fr(void);
static BOOL WINHELP_RegisterWinClasses();
static LRESULT WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM);
......@@ -52,6 +53,7 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show)
/* Register resources */
LIBWINE_Register_De();
LIBWINE_Register_En();
LIBWINE_Register_Fr();
#endif
Globals.hInstance = hInstance;
......@@ -196,7 +198,7 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
if (bPopup)
lpszWindow = NULL;
else if (!lpszWindow)
else if (!lpszWindow || !lpszWindow[0])
lpszWindow = Globals.active_win->lpszName;
bPrimary = lpszWindow && !lstrcmpi(lpszWindow, "main");
......@@ -586,10 +588,10 @@ static LRESULT WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
case WM_VSCROLL:
{
BOOL update = TRUE;
RECT rect;
INT Min, Max;
INT CurPos = GetScrollPos(hWnd, SB_VERT);
BOOL update = TRUE;
RECT rect;
INT16 Min, Max;
INT CurPos = GetScrollPos(hWnd, SB_VERT);
GetScrollRange(hWnd, SB_VERT, &Min, &Max);
GetClientRect(hWnd, &rect);
......@@ -775,7 +777,7 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
while (len)
{
INT free_width = rect.right - (part ? (*line)->rect.right : rect.left) - space.cx;
UINT low = 0, curr = len, high = len, textlen;
UINT low = 0, curr = len, high = len, textlen = 0;
if (free_width > 0)
{
......@@ -789,7 +791,7 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
if (high <= low + 1) break;
if (textsize.cx) curr = (curr * free_width) / textsize.cx;
if (curr <= low) curr = low + 1;
if (curr <= low) curr = low + 1;
else if (curr >= high) curr = high - 1;
}
textlen = low;
......
......@@ -14,6 +14,7 @@
#include <string.h>
#include <time.h>
#include "windows.h"
#include "winbase.h"
#include "winerror.h"
#include "kernel32.h"
#include "handle32.h"
......
......@@ -381,60 +381,6 @@ HBITMAP WIN32_LoadBitmapA( HANDLE instance, LPCSTR name )
return res;
}
/**********************************************************************
* WIN32_ParseMenu
* LoadMenu helper function
*/
BYTE* WIN32_ParseMenu(HMENU hMenu,BYTE *it)
{
char entry[200]; /* buffer for ANSI names */
int bufsize=100;
int len;
WORD flags;
WORD wMenuID;
WCHAR *utext;
do{
flags=*(WORD*)it;
it+=sizeof(WORD);
/* POPUP entries have no ID, but a sub menu */
if(flags & MF_POPUP)
{
wMenuID = CreatePopupMenu();
len = STRING32_lstrlenW((LPWSTR)it);
utext = (WCHAR*)it;
it += sizeof(WCHAR)*(len+1);
it = WIN32_ParseMenu(wMenuID,it);
} else {
wMenuID=*(WORD*)it;
it+=sizeof(WORD);
utext = (LPWSTR)it;
len = STRING32_lstrlenW((LPWSTR)it);
it += sizeof(WCHAR)*(len+1);
if(!wMenuID && !*utext)
flags |= MF_SEPARATOR;
}
if(len>=bufsize) continue; /* hack hack */
STRING32_UniToAnsi(entry,utext);
AppendMenu(hMenu,flags,wMenuID,MAKE_SEGPTR(entry));
}while(!(flags & MF_END));
return it;
}
/*****************************************************************
* LoadMenuIndirectW (USER32.371)
*/
HMENU WIN32_LoadMenuIndirectW(void *menu)
{
BYTE *it=menu;
HMENU hMenu = CreateMenu();
/*skip menu header*/
if(*(DWORD*)it)
fprintf(stderr,"Unknown menu header\n");
it+=2*sizeof(WORD);
WIN32_ParseMenu(hMenu,it);
return hMenu;
}
/*****************************************************************
* LoadMenuW (USER32.372)
*/
......@@ -443,16 +389,7 @@ HMENU WIN32_LoadMenuW(HANDLE instance, LPCWSTR name)
HANDLE32 hrsrc;
hrsrc=FindResource32(instance,name,(LPWSTR)RT_MENU);
if(!hrsrc)return 0;
return WIN32_LoadMenuIndirectW(LoadResource32(instance, hrsrc));
}
/*****************************************************************
* LoadMenuIndirectA (USER32.370)
*/
HMENU WIN32_LoadMenuIndirectA(void *menu)
{
fprintf(stderr,"WIN32_LoadMenuIndirectA not implemented\n");
return 0;
return LoadMenuIndirect32W( LoadResource32(instance, hrsrc) );
}
/*****************************************************************
......
......@@ -12,7 +12,6 @@
#include <stdarg.h>
#include "windows.h"
#include "winerror.h"
#include "alias.h"
#include "stackframe.h"
#include "xmalloc.h"
#include "handle32.h"
......@@ -21,6 +20,7 @@
#include "string32.h"
#include "dialog.h"
#include "win.h"
#include "winproc.h"
#include "debug.h"
#include "stddebug.h"
......@@ -59,73 +59,6 @@ BOOL USER32_TranslateMessage(MSG32* lpmsg)
return TranslateMessage(&msg);
}
#if 0
/***********************************************************************
* CreateWindowEx32A (USER32.82)
*/
HWND32 CreateWindowEx32A( DWORD flags, LPCSTR class, LPCSTR title,
DWORD style, INT32 x, INT32 y, INT32 width,
INT32 height, HWND32 parent, HMENU32 menu,
HINSTANCE32 instance, LPVOID param )
{
HWND32 retval;
HANDLE classh=0, titleh=0;
SEGPTR classsegp=0, titlesegp=0;
char *classbuf, *titlebuf;
int usec,uset;
/*Have to translate CW_USEDEFAULT */
if(x==CW_USEDEFAULT32)x=CW_USEDEFAULT16;
if(y==CW_USEDEFAULT32)y=CW_USEDEFAULT16;
if(width==CW_USEDEFAULT32)width=CW_USEDEFAULT16;
if(height==CW_USEDEFAULT32)height=CW_USEDEFAULT16;
/* FIXME: There has to be a better way of doing this - but neither
malloc nor alloca will work */
usec = HIWORD(class);
uset = HIWORD(title);
if(usec){
classh = GlobalAlloc16(0, strlen(class)+1);
classsegp = WIN16_GlobalLock16(classh);
classbuf = PTR_SEG_TO_LIN(classsegp);
strcpy( classbuf, class );
}
if(uset){
titleh = GlobalAlloc16(0, strlen(title)+1);
titlesegp = WIN16_GlobalLock16(titleh);
titlebuf = PTR_SEG_TO_LIN(titlesegp);
strcpy( titlebuf, title );
}
retval = (HWND32)CreateWindowEx16(flags,(usec ? classsegp : (SEGPTR)class),
(uset ? titlesegp : (SEGPTR)title),style,x,y,width,height,
(HWND)parent,(HMENU)menu,(HINSTANCE)instance,
(DWORD)param);
if(usec)GlobalFree16(classh);
if(uset)GlobalFree16(titleh);
return retval;
}
#endif
HWND32 CreateWindowEx32W( DWORD flags, LPCWSTR class, LPCWSTR title,
DWORD style, INT32 x, INT32 y, INT32 width,
INT32 height, HWND32 parent, HMENU32 menu,
HINSTANCE32 instance, LPVOID param )
{
HWND32 hwnd;
LPSTR c,t;
int usec,uset;
usec=HIWORD(class);
uset=HIWORD(title);
c = usec ? STRING32_DupUniToAnsi(class) : (LPSTR)class;
t = uset ? STRING32_DupUniToAnsi(title) : (LPSTR)title;
hwnd=CreateWindowEx32A(flags,c,t,style,x,y,width,height,parent,menu,
instance,param);
if(usec)free(c);
if(uset)free(t);
return hwnd;
}
UINT USER32_SetTimer(HWND hwnd, UINT id, UINT timeout, void *proc)
......@@ -296,13 +229,13 @@ HWND USER32_CreateDialogIndirectParamAorW(HINSTANCE hInst,LPVOID templ,
SetWindowPos( hwndCtrl, HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
/* Send initialisation messages to the control */
if (hFont) SendMessage( hwndCtrl, WM_SETFONT, (WPARAM)hFont, 0 );
if (SendMessage( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
if (hFont) SendMessage32A( hwndCtrl, WM_SETFONT, (WPARAM)hFont, 0 );
if (SendMessage32A( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
{
/* If there's already a default push-button, set it back */
/* to normal and use this one instead. */
if (hwndDefButton)
SendMessage( hwndDefButton, BM_SETSTYLE32, BS_PUSHBUTTON, FALSE);
SendMessage32A( hwndDefButton, BM_SETSTYLE32, BS_PUSHBUTTON, FALSE);
hwndDefButton = hwndCtrl;
dlgInfo->msgResult = GetWindowWord( hwndCtrl, GWW_ID );
}
......@@ -310,8 +243,7 @@ HWND USER32_CreateDialogIndirectParamAorW(HINSTANCE hInst,LPVOID templ,
dprintf_dialog(stddeb, " END\n" );
/* Initialise dialog extra data */
ALIAS_RegisterAlias(0,0,lpDialogFunc);
dlgInfo->dlgProc = lpDialogFunc;
dlgInfo->dlgProc = WINPROC_AllocWinProc(lpDialogFunc,WIN_PROC_32A);
dlgInfo->hUserFont = hFont;
dlgInfo->hMenu = hMenu;
dlgInfo->xBaseUnit = xUnit;
......@@ -320,8 +252,8 @@ HWND USER32_CreateDialogIndirectParamAorW(HINSTANCE hInst,LPVOID templ,
/* Send initialisation messages and set focus */
if (dlgInfo->hUserFont)
SendMessage( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
if (SendMessage( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, dwInitParam ))
SendMessage32A( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
if (SendMessage32A( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, dwInitParam ))
SetFocus( dlgInfo->hwndFocus );
if (dlgTempl->style & WS_VISIBLE) ShowWindow(hwnd, SW_SHOW);
return hwnd;
......
......@@ -102,10 +102,8 @@ BOOL WIN32_CallWindowProcTo16(LRESULT(*func)(HWND,UINT,WPARAM,LPARAM),
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ButtonWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ColorDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboBoxWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT DesktopWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT EditWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FileOpenDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FileSaveDlgProc(HWND,UINT,WPARAM,LPARAM);
......@@ -121,18 +119,6 @@ extern LRESULT StaticWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT SystemMessageBoxProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboLBoxWndProc(HWND,UINT,WPARAM,LPARAM);
LRESULT USER32_DefWindowProcA(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(DefWindowProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ButtonWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ButtonWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT StaticWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
......@@ -169,12 +155,6 @@ LRESULT PopupMenuWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
return WIN32_CallWindowProcTo16(PopupMenuWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT DesktopWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(DesktopWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT DefDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
......@@ -187,18 +167,6 @@ LRESULT MDIClientWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
return WIN32_CallWindowProcTo16(MDIClientWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT DefWindowProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(DefWindowProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT DefMDIChildProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(DefMDIChildProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT SystemMessageBoxProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
......
......@@ -2,7 +2,6 @@ TOPSRC = @top_srcdir@
MODULE = windows
C_SRCS = \
alias.c \
caret.c \
class.c \
dce.c \
......
/*
* Function alias support
*
* Copyright 1995 Martin von Loewis
*
*/
#include "windows.h"
#include "alias.h"
#include "module.h"
#include "stddebug.h"
#include "debug.h"
/* some large prime */
#define TABLESIZE 2677
static ALIASHASH AliasTable[TABLESIZE];
/* this could be a bit smaller */
static FUNCTIONALIAS AliasRecord[TABLESIZE];
/* record 0 is always empty */
static int LastRecord;
int ALIAS_UseAliases;
/* Aliased window procedures */
extern LRESULT ButtonWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT StaticWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT ScrollBarWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT ListBoxWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT ComboBoxWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT ComboLBoxWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT EditWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT PopupMenuWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT DesktopWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT DefDlgProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT MDIClientWndProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT AboutDlgProc( HWND, UINT, WPARAM, LPARAM );
extern LRESULT CARET_Callback( HWND, UINT, WPARAM, LPARAM );
extern LRESULT SystemMessageBoxProc( HWND, UINT, WPARAM, LPARAM );
/* closed hashing */
static int ALIAS_LocateHash(DWORD value)
{
int hash,start;
start=hash=value%TABLESIZE;
while(AliasTable[hash].used && AliasTable[hash].used!=value)
{
hash++;
if(hash==TABLESIZE)
hash=0;
if(hash==start)
{
fprintf(stderr,"Hash table full, increase size in alias.c\n");
exit(0);
}
}
return hash;
}
/***********************************************************************
* ALIAS_RegisterWndProcAlias
*/
static void ALIAS_RegisterWndProcAlias( DWORD Wine, const char *name )
{
FARPROC Win16Proc, Win32Proc;
Win16Proc = MODULE_GetWndProcEntry16( name );
Win32Proc = MODULE_GetWndProcEntry32( name );
ALIAS_RegisterAlias( Wine, (DWORD)Win16Proc, (DWORD)Win32Proc );
}
/***********************************************************************
* ALIAS_Init
*
* Create aliases for the standard window procedures.
*/
BOOL ALIAS_Init(void)
{
ALIAS_RegisterWndProcAlias( (DWORD)ButtonWndProc, "ButtonWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)StaticWndProc, "StaticWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)ScrollBarWndProc, "ScrollBarWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)ListBoxWndProc, "ListBoxWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)ComboBoxWndProc, "ComboBoxWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)ComboLBoxWndProc, "ComboLBoxWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)EditWndProc, "EditWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)PopupMenuWndProc, "PopupMenuWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)DesktopWndProc, "DesktopWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)DefDlgProc, "DefDlgProc" );
ALIAS_RegisterWndProcAlias( (DWORD)MDIClientWndProc, "MDIClientWndProc" );
ALIAS_RegisterWndProcAlias( (DWORD)AboutDlgProc, "AboutDlgProc" );
ALIAS_RegisterWndProcAlias( (DWORD)CARET_Callback, "CARET_Callback" );
ALIAS_RegisterWndProcAlias( (DWORD)SystemMessageBoxProc, "SystemMessageBoxProc" );
return TRUE;
}
/***********************************************************************
* ALIAS_RegisterAlias
*/
void ALIAS_RegisterAlias(DWORD Wine,DWORD Win16, DWORD Win32)
{
int whash = 0, w16hash = 0, w32hash = 0, recno=0;
if (!Wine && !Win16 && !Win32) return;
if (Wine)
{
whash=ALIAS_LocateHash(Wine);
recno=AliasTable[whash].used?AliasTable[whash].recno:0;
}
if (Win16)
{
w16hash=ALIAS_LocateHash(Win16);
recno=AliasTable[w16hash].used?AliasTable[w16hash].recno:0;
}
if (Win32)
{
w32hash=ALIAS_LocateHash(Win32);
recno=AliasTable[w32hash].used?AliasTable[w32hash].recno:0;
}
if (!recno)
{
recno=LastRecord;
LastRecord++;
}
if (Wine)
{
AliasTable[whash].used=Wine;
AliasTable[whash].recno=recno;
AliasRecord[recno].wine=Wine;
}
if (Win16)
{
AliasTable[w16hash].used=Win16;
AliasTable[w16hash].recno=recno;
AliasRecord[recno].win16=Win16;
}
if (Win32)
{
AliasTable[w32hash].used=Win32;
AliasTable[w32hash].recno=recno;
AliasRecord[recno].win32=Win32;
}
}
FUNCTIONALIAS* ALIAS_LookupAlias(DWORD fn)
{
int index;
index=ALIAS_LocateHash(fn);
if(AliasTable[index].used==fn)
return &AliasRecord[AliasTable[index].recno];
return 0;
}
......@@ -24,11 +24,11 @@ static void DEFDLG_SetFocus( HWND hwndDlg, HWND hwndCtrl )
if (IsChild( hwndDlg, hwndPrev ))
{
if (SendMessage( hwndPrev, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
SendMessage( hwndPrev, EM_SETSEL, TRUE, MAKELONG( -1, 0 ) );
if (SendMessage16( hwndPrev, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
SendMessage16( hwndPrev, EM_SETSEL, TRUE, MAKELONG( -1, 0 ) );
}
if (SendMessage( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
SendMessage( hwndCtrl, EM_SETSEL, FALSE, MAKELONG( 0, -1 ) );
if (SendMessage16( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
SendMessage16( hwndCtrl, EM_SETSEL, FALSE, MAKELONG( 0, -1 ) );
SetFocus( hwndCtrl );
}
......@@ -72,7 +72,7 @@ static HWND DEFDLG_FindDefButton( HWND hwndDlg )
HWND hwndChild = GetWindow( hwndDlg, GW_CHILD );
while (hwndChild)
{
if (SendMessage( hwndChild, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
if (SendMessage16( hwndChild, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
break;
hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
}
......@@ -90,18 +90,18 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
HWND hwndNew )
{
if (hwndNew &&
!(SendMessage( hwndNew, WM_GETDLGCODE, 0, 0 ) & DLGC_UNDEFPUSHBUTTON))
!(SendMessage16(hwndNew, WM_GETDLGCODE, 0, 0 ) & DLGC_UNDEFPUSHBUTTON))
return FALSE; /* Destination is not a push button */
if (dlgInfo->msgResult) /* There's already a default pushbutton */
{
HWND hwndOld = GetDlgItem( hwndDlg, dlgInfo->msgResult );
if (SendMessage( hwndOld, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
SendMessage( hwndOld, BM_SETSTYLE16, BS_PUSHBUTTON, TRUE );
if (SendMessage32A( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
SendMessage32A( hwndOld, BM_SETSTYLE32, BS_PUSHBUTTON, TRUE );
}
if (hwndNew)
{
SendMessage( hwndNew, BM_SETSTYLE16, BS_DEFPUSHBUTTON, TRUE );
SendMessage32A( hwndNew, BM_SETSTYLE32, BS_DEFPUSHBUTTON, TRUE );
dlgInfo->msgResult = GetDlgCtrlID( hwndNew );
}
else dlgInfo->msgResult = 0;
......@@ -167,12 +167,12 @@ LRESULT DefDlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
}
/* Window clean-up */
DefWindowProc( hwnd, msg, wParam, lParam );
DefWindowProc16( hwnd, msg, wParam, lParam );
break;
case WM_SHOWWINDOW:
if (!wParam) DEFDLG_SaveFocus( hwnd, dlgInfo );
return DefWindowProc( hwnd, msg, wParam, lParam );
return DefWindowProc16( hwnd, msg, wParam, lParam );
case WM_ACTIVATE:
if (wParam) DEFDLG_RestoreFocus( hwnd, dlgInfo );
......@@ -215,7 +215,7 @@ LRESULT DefDlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
return 0;
default:
return DefWindowProc( hwnd, msg, wParam, lParam );
return DefWindowProc16( hwnd, msg, wParam, lParam );
}
return result;
......
......@@ -564,8 +564,8 @@ static void EVENT_ConfigureNotify( HWND hwnd, XConfigureEvent *event )
if (!(winpos = SEGPTR_NEW(WINDOWPOS16))) return;
/* Artificial messages - what is this for? */
SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0);
SendMessage(hwnd, WM_EXITSIZEMOVE, 0, 0);
SendMessage16(hwnd, WM_ENTERSIZEMOVE, 0, 0);
SendMessage16(hwnd, WM_EXITSIZEMOVE, 0, 0);
/* Fill WINDOWPOS struct */
winpos->flags = SWP_NOACTIVATE | SWP_NOZORDER;
......@@ -584,7 +584,7 @@ static void EVENT_ConfigureNotify( HWND hwnd, XConfigureEvent *event )
winpos->flags |= SWP_NOSIZE;
/* Send WM_WINDOWPOSCHANGING */
SendMessage(hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)SEGPTR_GET(winpos));
SendMessage16(hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)SEGPTR_GET(winpos));
/* Calculate new position and size */
newWindowRect.left = event->x;
......@@ -603,7 +603,7 @@ static void EVENT_ConfigureNotify( HWND hwnd, XConfigureEvent *event )
/* Set new size and position */
wndPtr->rectWindow = newWindowRect;
wndPtr->rectClient = newClientRect;
SendMessage( hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)SEGPTR_GET(winpos));
SendMessage16( hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)SEGPTR_GET(winpos));
SEGPTR_FREE(winpos);
/* full window drag leaves unrepainted garbage without this */
......@@ -697,7 +697,7 @@ static void EVENT_ClientMessage (HWND hwnd, XClientMessageEvent *event )
dprintf_event( stddeb, "unrecognized ClientMessage\n" );
return;
}
SendMessage( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
SendMessage16( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
}
......
......@@ -54,11 +54,11 @@ void FOCUS_SwitchFocus(HWND hFocusFrom, HWND hFocusTo)
{
hwndFocus = hFocusTo;
if (hFocusFrom) SendMessage( hFocusFrom, WM_KILLFOCUS, (WPARAM)hFocusTo, 0L);
if (hFocusFrom) SendMessage16( hFocusFrom, WM_KILLFOCUS, (WPARAM)hFocusTo, 0L);
if( !hFocusTo || hFocusTo != hwndFocus )
return;
SendMessage( hFocusTo, WM_SETFOCUS, (WPARAM)hFocusFrom, 0L);
SendMessage16( hFocusTo, WM_SETFOCUS, (WPARAM)hFocusFrom, 0L);
FOCUS_SetXFocus( hFocusTo );
}
......
......@@ -45,7 +45,7 @@ static HANDLE HOOK_GetNextHook( HANDLE hook )
*
* Get the first hook for a given type.
*/
static HANDLE HOOK_GetHook( short id , HQUEUE hQueue )
HANDLE HOOK_GetHook( short id , HQUEUE hQueue )
{
MESSAGEQUEUE *queue;
HANDLE hook = 0;
......
......@@ -25,7 +25,8 @@
/* #define DEBUG_MSG */
#include "debug.h"
#define HWND_BROADCAST ((HWND)0xffff)
#define HWND_BROADCAST16 ((HWND16)0xffff)
#define HWND_BROADCAST32 ((HWND32)0xffffffff)
extern BYTE* KeyStateTable; /* event.c */
extern WPARAM lastEventChar; /* event.c */
......@@ -95,7 +96,7 @@ static BOOL MSG_TranslateMouseMsg( MSG *msg, BOOL remove )
if (msg->hwnd != GetActiveWindow() && msg->hwnd != GetDesktopWindow())
{
LONG ret = SendMessage( msg->hwnd, WM_MOUSEACTIVATE, hwndTop,
LONG ret = SendMessage16( msg->hwnd, WM_MOUSEACTIVATE, hwndTop,
MAKELONG( hittest, msg->message ) );
if ((ret == MA_ACTIVATEANDEAT) || (ret == MA_NOACTIVATEANDEAT))
......@@ -109,8 +110,8 @@ static BOOL MSG_TranslateMouseMsg( MSG *msg, BOOL remove )
/* Send the WM_SETCURSOR message */
SendMessage( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd,
MAKELONG( hittest, msg->message ));
SendMessage16( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd,
MAKELONG( hittest, msg->message ));
if (eatMsg) return FALSE;
/* Check for double-click */
......@@ -533,7 +534,7 @@ BOOL MSG_InternalGetMessage( SEGPTR msg, HWND hwnd, HWND hwndOwner, short code,
0, 0, 0, flags, TRUE ))
{
/* No message present -> send ENTERIDLE and wait */
SendMessage( hwndOwner, WM_ENTERIDLE, code, (LPARAM)hwnd );
SendMessage16( hwndOwner, WM_ENTERIDLE, code, (LPARAM)hwnd );
MSG_PeekMessage( (MSG *)PTR_SEG_TO_LIN(msg),
0, 0, 0, flags, FALSE );
}
......@@ -579,7 +580,6 @@ BOOL GetMessage( SEGPTR msg, HWND hwnd, UINT first, UINT last )
}
/***********************************************************************
* PostMessage (USER.110)
*/
......@@ -601,7 +601,7 @@ BOOL PostMessage( HWND hwnd, WORD message, WORD wParam, LONG lParam )
return TRUE;
#endif /* CONFIG_IPC */
if (hwnd == HWND_BROADCAST)
if (hwnd == HWND_BROADCAST16)
{
dprintf_msg(stddeb,"PostMessage // HWND_BROADCAST !\n");
for (wndPtr = WIN_GetDesktop()->child; wndPtr; wndPtr = wndPtr->next)
......@@ -644,18 +644,18 @@ BOOL PostAppMessage( HTASK hTask, WORD message, WORD wParam, LONG lParam )
/***********************************************************************
* SendMessage (USER.111)
* SendMessage16 (USER.111)
*/
LRESULT SendMessage( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
LRESULT SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam)
{
WND * wndPtr;
LONG ret;
LRESULT ret;
struct
{
LPARAM lParam;
WPARAM wParam;
UINT wMsg;
HWND hWnd;
LPARAM lParam;
WPARAM16 wParam;
UINT16 wMsg;
HWND16 hWnd;
} msgstruct = { lParam, wParam, msg, hwnd };
#ifdef CONFIG_IPC
......@@ -663,7 +663,7 @@ LRESULT SendMessage( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
if (DDE_SendMessage(&DDE_msg)) return TRUE;
#endif /* CONFIG_IPC */
if (hwnd == HWND_BROADCAST)
if (hwnd == HWND_BROADCAST16)
{
dprintf_msg(stddeb,"SendMessage // HWND_BROADCAST !\n");
for (wndPtr = WIN_GetDesktop()->child; wndPtr; wndPtr = wndPtr->next)
......@@ -672,24 +672,96 @@ LRESULT SendMessage( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
dprintf_msg(stddeb,"BROADCAST Message to hWnd=%04x m=%04X w=%04lX l=%08lX !\n",
wndPtr->hwndSelf, msg, (DWORD)wParam, lParam);
ret |= SendMessage( wndPtr->hwndSelf, msg, wParam, lParam );
SendMessage16( wndPtr->hwndSelf, msg, wParam, lParam );
}
}
dprintf_msg(stddeb,"SendMessage // End of HWND_BROADCAST !\n");
return TRUE;
}
SPY_EnterMessage( SPY_SENDMESSAGE, hwnd, msg, wParam, lParam );
HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 1,
(LPARAM)MAKE_SEGPTR(&msgstruct) );
hwnd = msgstruct.hWnd;
msg = msgstruct.wMsg;
wParam = msgstruct.wParam;
lParam = msgstruct.lParam;
SPY_EnterMessage( SPY_SENDMESSAGE16, hwnd, msg, wParam, lParam );
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
{
SPY_ExitMessage( SPY_RESULT_INVALIDHWND16, hwnd, msg, 0 );
return 0;
}
ret = CallWindowProc16( wndPtr->lpfnWndProc, hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK16, hwnd, msg, ret );
return ret;
}
/***********************************************************************
* SendMessage32A (USER32.453)
*/
LRESULT SendMessage32A(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
{
WND * wndPtr;
LRESULT ret;
if (hwnd == HWND_BROADCAST32)
{
for (wndPtr = WIN_GetDesktop()->child; wndPtr; wndPtr = wndPtr->next)
{
/* FIXME: should use something like EnumWindows here */
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
SendMessage32A( wndPtr->hwndSelf, msg, wParam, lParam );
}
return TRUE;
}
/* FIXME: call hooks */
SPY_EnterMessage( SPY_SENDMESSAGE32, hwnd, msg, wParam, lParam );
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
{
SPY_ExitMessage( SPY_RESULT_INVALIDHWND32, hwnd, msg, 0 );
return 0;
}
ret = CallWindowProc32A( (WNDPROC32)wndPtr->lpfnWndProc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK32, hwnd, msg, ret );
return ret;
}
/***********************************************************************
* SendMessage32W (USER32.458)
*/
LRESULT SendMessage32W(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
{
WND * wndPtr;
LRESULT ret;
if (hwnd == HWND_BROADCAST32)
{
for (wndPtr = WIN_GetDesktop()->child; wndPtr; wndPtr = wndPtr->next)
{
/* FIXME: should use something like EnumWindows here */
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION)
SendMessage32W( wndPtr->hwndSelf, msg, wParam, lParam );
}
return TRUE;
}
/* FIXME: call hooks */
HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)MAKE_SEGPTR(&msgstruct) );
SPY_EnterMessage( SPY_SENDMESSAGE32, hwnd, msg, wParam, lParam );
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
{
SPY_ExitMessage( SPY_RESULT_INVALIDHWND, hwnd, msg, 0 );
SPY_ExitMessage( SPY_RESULT_INVALIDHWND32, hwnd, msg, 0 );
return 0;
}
ret = CallWindowProc16(wndPtr->lpfnWndProc, msgstruct.hWnd, msgstruct.wMsg,
msgstruct.wParam, msgstruct.lParam );
SPY_ExitMessage( SPY_RESULT_OK, hwnd, msg, ret );
ret = CallWindowProc32W( (WNDPROC32)wndPtr->lpfnWndProc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK32, hwnd, msg, ret );
return ret;
}
......@@ -765,9 +837,6 @@ LONG DispatchMessage( const MSG* msg )
LONG retval;
int painting;
SPY_EnterMessage( SPY_DISPATCHMESSAGE, msg->hwnd, msg->message,
msg->wParam, msg->lParam );
/* Process timer messages */
if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
{
......@@ -785,8 +854,13 @@ LONG DispatchMessage( const MSG* msg )
painting = (msg->message == WM_PAINT);
if (painting) wndPtr->flags |= WIN_NEEDS_BEGINPAINT;
/* HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, msg->hwnd, msg->message,
msg->wParam, msg->lParam );
retval = CallWindowProc16( wndPtr->lpfnWndProc, msg->hwnd, msg->message,
msg->wParam, msg->lParam );
SPY_ExitMessage( SPY_RESULT_OK16, msg->hwnd, msg->message, retval );
if (painting && (wndPtr = WIN_FindWndPtr( msg->hwnd )) &&
(wndPtr->flags & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate)
{
......
......@@ -31,10 +31,8 @@ LRESULT SystemMessageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
switch(message) {
case WM_INITDIALOG:
lpmb = (LPMSGBOX)lParam;
if (lpmb->title != NULL) {
SetWindowText(hwnd, lpmb->title);
}
SetWindowText(GetDlgItem(hwnd, 100), lpmb->text);
if (lpmb->title) SetWindowText32A(hwnd, lpmb->title);
SetWindowText32A(GetDlgItem(hwnd, 100), lpmb->text);
/* Hide not selected buttons */
switch(lpmb->type & MB_TYPEMASK) {
case MB_OK:
......@@ -66,21 +64,21 @@ LRESULT SystemMessageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
/* Set the icon */
switch(lpmb->type & MB_ICONMASK) {
case MB_ICONEXCLAMATION:
SendDlgItemMessage(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_EXCLAMATION), 0);
SendDlgItemMessage16(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_EXCLAMATION), 0);
break;
case MB_ICONQUESTION:
SendDlgItemMessage(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_QUESTION), 0);
SendDlgItemMessage16(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_QUESTION), 0);
break;
case MB_ICONASTERISK:
SendDlgItemMessage(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_ASTERISK), 0);
SendDlgItemMessage16(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_ASTERISK), 0);
break;
case MB_ICONHAND:
default:
SendDlgItemMessage(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_HAND), 0);
SendDlgItemMessage16(hwnd, stc1, STM_SETICON,
(WPARAM)LoadIcon(0, IDI_HAND), 0);
break;
}
......@@ -146,7 +144,7 @@ LRESULT SystemMessageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
if (GetWindowLong(hItem, GWL_STYLE) & WS_VISIBLE) {
if (buttons++ == ((lpmb->type & MB_DEFMASK) >> 8)) {
SetFocus(hItem);
SendMessage(hItem, BM_SETSTYLE16, BS_DEFPUSHBUTTON, TRUE);
SendMessage32A( hItem, BM_SETSTYLE32, BS_DEFPUSHBUTTON, TRUE );
}
SetWindowPos(hItem, 0, bpos, tiheight, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
......
......@@ -202,7 +202,7 @@ void NC_GetMinMaxInfo( HWND hwnd, POINT16 *maxSize, POINT16 *maxPos,
MinMax->ptMaxPosition.y = -yinc;
}
SendMessage( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)SEGPTR_GET(MinMax) );
SendMessage16( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)SEGPTR_GET(MinMax) );
/* Some sanity checks */
......@@ -230,23 +230,21 @@ void NC_GetMinMaxInfo( HWND hwnd, POINT16 *maxSize, POINT16 *maxPos,
*
* Handle a WM_NCCALCSIZE message. Called from DefWindowProc().
*/
LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS16 *params )
LONG NC_HandleNCCalcSize( WND *pWnd, RECT16 *winRect )
{
RECT16 tmpRect = { 0, 0, 0, 0 };
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
NC_AdjustRect( &tmpRect, wndPtr->dwStyle, FALSE, wndPtr->dwExStyle );
params->rgrc[0].left -= tmpRect.left;
params->rgrc[0].top -= tmpRect.top;
params->rgrc[0].right -= tmpRect.right;
params->rgrc[0].bottom -= tmpRect.bottom;
NC_AdjustRect( &tmpRect, pWnd->dwStyle, FALSE, pWnd->dwExStyle );
winRect->left -= tmpRect.left;
winRect->top -= tmpRect.top;
winRect->right -= tmpRect.right;
winRect->bottom -= tmpRect.bottom;
if (HAS_MENU(wndPtr))
if (HAS_MENU(pWnd))
{
params->rgrc[0].top += MENU_GetMenuBarHeight( hwnd,
params->rgrc[0].right - params->rgrc[0].left,
-tmpRect.left, -tmpRect.top ) + 1;
winRect->top += MENU_GetMenuBarHeight( pWnd->hwndSelf,
winRect->right - winRect->left,
-tmpRect.left, -tmpRect.top ) + 1;
}
return 0;
}
......@@ -635,7 +633,7 @@ static void NC_DrawCaption( HDC hdc, RECT16 *rect, HWND hwnd,
FillRect16( hdc, &r, active ? sysColorObjects.hbrushActiveCaption :
sysColorObjects.hbrushInactiveCaption );
if (GetWindowText( hwnd, buffer, 256 ))
if (GetWindowText32A( hwnd, buffer, sizeof(buffer) ))
{
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
......@@ -676,7 +674,7 @@ void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint )
{
if (wndPtr->class->hIcon)
{
SendMessage(hwnd, WM_ICONERASEBKGND, (WPARAM)hdc, 0);
SendMessage16(hwnd, WM_ICONERASEBKGND, (WPARAM)hdc, 0);
DrawIcon( hdc, 0, 0, wndPtr->class->hIcon );
}
ReleaseDC(hwnd, hdc);
......@@ -1028,7 +1026,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam, POINT16 pt )
mouseRect.top = MAX( mouseRect.top, sizingRect.top+minTrack.y );
mouseRect.bottom = MIN( mouseRect.bottom, sizingRect.top+maxTrack.y );
}
SendMessage( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
SendMessage16( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
if (GetCapture() != hwnd) SetCapture( hwnd );
......@@ -1108,8 +1106,8 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam, POINT16 pt )
ReleaseDC( 0, hdc );
if (rootWindow == DefaultRootWindow(display)) XUngrabServer( display );
}
SendMessage( hwnd, WM_EXITSIZEMOVE, 0, 0 );
SendMessage( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
SendMessage16( hwnd, WM_EXITSIZEMOVE, 0, 0 );
SendMessage16( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
/* Single click brings up the system menu when iconized */
......@@ -1168,9 +1166,9 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
if (!pressed) return;
if (wParam == HTMINBUTTON)
SendMessage( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, *(LONG*)&msg.pt );
SendMessage16( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, *(LONG*)&msg.pt );
else
SendMessage( hwnd, WM_SYSCOMMAND,
SendMessage16( hwnd, WM_SYSCOMMAND,
IsZoomed(hwnd) ? SC_RESTORE : SC_MAXIMIZE, *(LONG*)&msg.pt );
}
......@@ -1243,7 +1241,7 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
switch(wParam) /* Hit test */
{
case HTCAPTION:
SendMessage( hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam );
SendMessage16( hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam );
break;
case HTSYSMENU:
......@@ -1251,15 +1249,15 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
break;
case HTMENU:
SendMessage( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
SendMessage16( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
break;
case HTHSCROLL:
SendMessage( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
SendMessage16( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
break;
case HTVSCROLL:
SendMessage( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
SendMessage16( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
break;
case HTMINBUTTON:
......@@ -1275,7 +1273,7 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
case HTBOTTOM:
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
SendMessage( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - HTLEFT+1, lParam);
SendMessage16( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - HTLEFT+1, lParam);
break;
case HTBORDER:
......@@ -1300,7 +1298,7 @@ LONG NC_HandleNCLButtonDblClk( WND *pWnd, WPARAM wParam, LPARAM lParam )
*/
if (pWnd->dwStyle & WS_MINIMIZE)
{
SendMessage( pWnd->hwndSelf, WM_SYSCOMMAND, SC_RESTORE, lParam );
SendMessage16( pWnd->hwndSelf, WM_SYSCOMMAND, SC_RESTORE, lParam );
return 0;
}
......@@ -1309,14 +1307,14 @@ LONG NC_HandleNCLButtonDblClk( WND *pWnd, WPARAM wParam, LPARAM lParam )
case HTCAPTION:
/* stop processing if WS_MAXIMIZEBOX is missing */
if (pWnd->dwStyle & WS_MAXIMIZEBOX)
SendMessage( pWnd->hwndSelf, WM_SYSCOMMAND,
SendMessage16( pWnd->hwndSelf, WM_SYSCOMMAND,
(pWnd->dwStyle & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE,
lParam );
break;
case HTSYSMENU:
if (!(pWnd->class->style & CS_NOCLOSE))
SendMessage( pWnd->hwndSelf, WM_SYSCOMMAND, SC_CLOSE, lParam );
SendMessage16( pWnd->hwndSelf, WM_SYSCOMMAND, SC_CLOSE, lParam );
break;
}
return 0;
......@@ -1362,7 +1360,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT16 pt )
break;
case SC_CLOSE:
return SendMessage( hwnd, WM_CLOSE, 0, 0 );
return SendMessage16( hwnd, WM_CLOSE, 0, 0 );
case SC_VSCROLL:
case SC_HSCROLL:
......
......@@ -76,7 +76,7 @@ void WIN_UpdateNCArea(WND* wnd, BOOL bUpdate)
hClip = 1;
}
if (hClip) SendMessage( wnd->hwndSelf, WM_NCPAINT, hClip, 0L );
if (hClip) SendMessage16( wnd->hwndSelf, WM_NCPAINT, hClip, 0L );
if (hClip > 1) DeleteObject( hClip );
}
......@@ -119,7 +119,7 @@ HDC16 BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
{
wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
lps->fErase = !SendMessage( hwnd, WM_ERASEBKGND, (WPARAM)lps->hdc, 0 );
lps->fErase = !SendMessage16(hwnd, WM_ERASEBKGND, (WPARAM)lps->hdc, 0);
}
else lps->fErase = TRUE;
......@@ -193,12 +193,12 @@ void PaintRect( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
{
if (!hwndParent) return;
#ifdef WINELIB32
hbrush = (HBRUSH)SendMessage( hwndParent,
WM_CTLCOLORMSGBOX+(DWORD)hbrush,
(WPARAM)hdc, (LPARAM)hwnd );
hbrush = (HBRUSH)SendMessage32A( hwndParent,
WM_CTLCOLORMSGBOX+(DWORD)hbrush,
(WPARAM)hdc, (LPARAM)hwnd );
#else
hbrush = (HBRUSH)SendMessage( hwndParent, WM_CTLCOLOR,
hdc, MAKELONG( hwnd, hbrush ) );
hbrush = (HBRUSH)SendMessage16( hwndParent, WM_CTLCOLOR,
hdc, MAKELONG( hwnd, hbrush ) );
#endif
}
if (hbrush) FillRect16( hdc, rect, hbrush );
......@@ -211,11 +211,11 @@ void PaintRect( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
HBRUSH GetControlBrush( HWND hwnd, HDC hdc, WORD control )
{
#ifdef WINELIB32
return (HBRUSH)SendMessage( GetParent(hwnd), WM_CTLCOLOR+control,
(WPARAM)hdc, (LPARAM)hwnd );
return (HBRUSH)SendMessage32A( GetParent(hwnd), WM_CTLCOLOR+control,
(WPARAM)hdc, (LPARAM)hwnd );
#else
return (HBRUSH)SendMessage( GetParent(hwnd), WM_CTLCOLOR,
hdc, MAKELONG( hwnd, control ) );
return (HBRUSH)SendMessage16( GetParent(hwnd), WM_CTLCOLOR,
hdc, MAKELONG( hwnd, control ) );
#endif
}
......@@ -338,7 +338,7 @@ BOOL32 RedrawWindow32( HWND32 hwnd, const RECT32 *rectUpdate,
if (flags & RDW_UPDATENOW)
{
if (wndPtr->hrgnUpdate) SendMessage( hwnd, WM_PAINT, 0, 0 );
if (wndPtr->hrgnUpdate) SendMessage16( hwnd, WM_PAINT, 0, 0 );
}
else if (flags & RDW_ERASENOW)
{
......@@ -356,7 +356,7 @@ BOOL32 RedrawWindow32( HWND32 hwnd, const RECT32 *rectUpdate,
if (!(wndPtr->dwStyle & WS_MINIMIZE) ||
!wndPtr->class->hIcon)
{
if (SendMessage( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0 ))
if (SendMessage16( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0 ))
wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
}
ReleaseDC( hwnd, hdc );
......
......@@ -278,7 +278,7 @@ INT16 WINPOS_WindowFromPoint( POINT16 pt, WND **ppWnd )
/* Send the WM_NCHITTEST message (only if to the same task) */
if ((*ppWnd)->hmemTaskQ != GetTaskQueue(0)) return HTCLIENT;
hittest = (INT)SendMessage( (*ppWnd)->hwndSelf, WM_NCHITTEST, 0,
hittest = (INT)SendMessage16( (*ppWnd)->hwndSelf, WM_NCHITTEST, 0,
MAKELONG( pt.x, pt.y ) );
if (hittest != HTTRANSPARENT) return hittest; /* Found the window */
......@@ -582,7 +582,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
y = wndPtr->ptMaxPos.y;
if( wndPtr->dwStyle & WS_MINIMIZE )
if( !SendMessage( hwnd, WM_QUERYOPEN, 0, 0L ) )
if( !SendMessage16( hwnd, WM_QUERYOPEN, 0, 0L ) )
{
swpflags |= SWP_NOSIZE;
break;
......@@ -614,7 +614,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
if (wndPtr->dwStyle & WS_MINIMIZE)
{
if( !SendMessage( hwnd, WM_QUERYOPEN, 0, 0L) )
if( !SendMessage16( hwnd, WM_QUERYOPEN, 0, 0L) )
{
swpflags |= SWP_NOSIZE;
break;
......@@ -655,7 +655,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
break;
}
SendMessage( hwnd, WM_SHOWWINDOW, (cmd != SW_HIDE), 0 );
SendMessage16( hwnd, WM_SHOWWINDOW, (cmd != SW_HIDE), 0 );
SetWindowPos( hwnd, HWND_TOP, x, y, cx, cy, swpflags );
if (wndPtr->flags & WIN_NEED_SIZE)
......@@ -665,10 +665,10 @@ BOOL ShowWindow( HWND hwnd, int cmd )
wndPtr->flags &= ~WIN_NEED_SIZE;
if (wndPtr->dwStyle & WS_MAXIMIZE) wParam = SIZE_MAXIMIZED;
else if (wndPtr->dwStyle & WS_MINIMIZE) wParam = SIZE_MINIMIZED;
SendMessage( hwnd, WM_SIZE, wParam,
SendMessage16( hwnd, WM_SIZE, wParam,
MAKELONG(wndPtr->rectClient.right-wndPtr->rectClient.left,
wndPtr->rectClient.bottom-wndPtr->rectClient.top));
SendMessage( hwnd, WM_MOVE, 0,
SendMessage16( hwnd, WM_MOVE, 0,
MAKELONG(wndPtr->rectClient.left, wndPtr->rectClient.top) );
}
......@@ -832,7 +832,7 @@ BOOL ACTIVATEAPP_callback(HWND hWnd, LPARAM lParam)
if (GetWindowTask(hWnd) != lpActStruct->hTaskSendTo) return 1;
SendMessage( hWnd, WM_ACTIVATEAPP, lpActStruct->wFlag,
SendMessage16( hWnd, WM_ACTIVATEAPP, lpActStruct->wFlag,
(LPARAM)((lpActStruct->hWindowTask)?lpActStruct->hWindowTask:0));
return 1;
}
......@@ -886,18 +886,18 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus )
if( (hwndPrevActive = hwndActive) )
{
/* FIXME: need a Win32 translation for WINELIB32 */
if( !SendMessage(hwndPrevActive, WM_NCACTIVATE, 0, MAKELONG(hWnd,wIconized)) )
if( !SendMessage16(hwndPrevActive, WM_NCACTIVATE, 0, MAKELONG(hWnd,wIconized)) )
{
if (GetSysModalWindow() != hWnd) return 0;
/* disregard refusal if hWnd is sysmodal */
}
#ifdef WINELIB32
SendMessage( hwndActive, WM_ACTIVATE,
SendMessage32A( hwndActive, WM_ACTIVATE,
MAKEWPARAM( WA_INACTIVE, wIconized ),
(LPARAM)hWnd );
#else
SendMessage(hwndPrevActive, WM_ACTIVATE, WA_INACTIVE,
SendMessage16(hwndPrevActive, WM_ACTIVATE, WA_INACTIVE,
MAKELONG(hWnd,wIconized));
#endif
......@@ -909,8 +909,8 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus )
hwndActive = hWnd;
/* send palette messages */
if( SendMessage( hWnd, WM_QUERYNEWPALETTE, 0, 0L) )
SendMessage((HWND)-1, WM_PALETTEISCHANGING, (WPARAM)hWnd, 0L );
if( SendMessage16( hWnd, WM_QUERYNEWPALETTE, 0, 0L) )
SendMessage16((HWND16)-1, WM_PALETTEISCHANGING, (WPARAM)hWnd, 0L );
/* if prev wnd is minimized redraw icon title
if( hwndPrevActive )
......@@ -973,14 +973,14 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus )
wIconized = HIWORD(wndTemp->dwStyle & WS_MINIMIZE);
/* FIXME: Needs a Win32 translation for WINELIB32 */
SendMessage( hWnd, WM_NCACTIVATE, 1,
SendMessage16( hWnd, WM_NCACTIVATE, 1,
MAKELONG(hwndPrevActive,wIconized));
#ifdef WINELIB32
SendMessage( hWnd, WM_ACTIVATE,
SendMessage32A( hWnd, WM_ACTIVATE,
MAKEWPARAM( (fMouse)?WA_CLICKACTIVE:WA_ACTIVE, wIconized),
(LPARAM)hwndPrevActive );
#else
SendMessage( hWnd, WM_ACTIVATE, (fMouse)? WA_CLICKACTIVE : WA_ACTIVE,
SendMessage16( hWnd, WM_ACTIVATE, (fMouse)? WA_CLICKACTIVE : WA_ACTIVE,
MAKELONG(hwndPrevActive,wIconized));
#endif
......@@ -1016,7 +1016,7 @@ BOOL WINPOS_ChangeActiveWindow( HWND hWnd, BOOL mouseMsg )
/* child windows get WM_CHILDACTIVATE message */
if( (wndPtr->dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD )
return SendMessage(hWnd, WM_CHILDACTIVATE, 0, 0L);
return SendMessage16(hWnd, WM_CHILDACTIVATE, 0, 0L);
/* owned popups imply owner activation - not sure */
if ((wndPtr->dwStyle & WS_POPUP) && wndPtr->owner &&
......@@ -1063,7 +1063,7 @@ LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
params->rgrc[2] = *oldClientRect;
params->lppos = winpos;
}
result = SendMessage( hwnd, WM_NCCALCSIZE, calcValidRect,
result = SendMessage16( hwnd, WM_NCCALCSIZE, calcValidRect,
(LPARAM)SEGPTR_GET( params ) );
dprintf_win(stddeb, "WINPOS_SendNCCalcSize: %d %d %d %d\n",
(int)params->rgrc[0].top, (int)params->rgrc[0].left,
......@@ -1075,15 +1075,34 @@ LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
/***********************************************************************
* WINPOS_HandleWindowPosChanging
* WINPOS_HandleWindowPosChanging16
*
* Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
*/
LONG WINPOS_HandleWindowPosChanging( WINDOWPOS16 *winpos )
LONG WINPOS_HandleWindowPosChanging16( WND *wndPtr, WINDOWPOS16 *winpos )
{
POINT16 maxSize;
WND *wndPtr = WIN_FindWndPtr( winpos->hwnd );
if (!wndPtr || (winpos->flags & SWP_NOSIZE)) return 0;
if (winpos->flags & SWP_NOSIZE) return 0;
if ((wndPtr->dwStyle & WS_THICKFRAME) ||
((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) == 0))
{
NC_GetMinMaxInfo( winpos->hwnd, &maxSize, NULL, NULL, NULL );
winpos->cx = MIN( winpos->cx, maxSize.x );
winpos->cy = MIN( winpos->cy, maxSize.y );
}
return 0;
}
/***********************************************************************
* WINPOS_HandleWindowPosChanging32
*
* Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
*/
LONG WINPOS_HandleWindowPosChanging32( WND *wndPtr, WINDOWPOS32 *winpos )
{
POINT16 maxSize;
if (winpos->flags & SWP_NOSIZE) return 0;
if ((wndPtr->dwStyle & WS_THICKFRAME) ||
((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) == 0))
{
......@@ -1481,7 +1500,7 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, INT x, INT y,
/* Send WM_WINDOWPOSCHANGING message */
if (!(flags & SWP_NOSENDCHANGING))
SendMessage( hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)MAKE_SEGPTR(&winpos) );
SendMessage16( hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)MAKE_SEGPTR(&winpos) );
/* Calculate new position and size */
......@@ -1696,8 +1715,8 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, INT x, INT y,
/* And last, send the WM_WINDOWPOSCHANGED message */
if (!(winpos.flags & SWP_NOSENDCHANGING))
SendMessage( winpos.hwnd, WM_WINDOWPOSCHANGED,
0, (LPARAM)MAKE_SEGPTR(&winpos) );
SendMessage16( winpos.hwnd, WM_WINDOWPOSCHANGED,
0, (LPARAM)MAKE_SEGPTR(&winpos) );
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment