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.
diff --git a/controls/listbox.c b/controls/listbox.c
index 9e40cba..25d4bfb 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -84,7 +84,7 @@
HDC hdc;
lphl = (LPHEADLIST)xmalloc(sizeof(HEADLIST));
- SetWindowLong(hwnd, 0, (LONG)lphl);
+ SetWindowLong32A(hwnd, 0, (LONG)lphl);
ListBoxInitialize(lphl);
lphl->DrawCtlType = CtlType;
lphl->CtlID = GetWindowWord(hwnd,GWW_ID);
@@ -114,10 +114,10 @@
ReleaseDC( 0, hdc );
}
- if (lphl->OwnerDrawn) {
+ if (lphl->OwnerDrawn)
+ {
LISTSTRUCT dummyls;
- lphl->hDrawItemStruct = USER_HEAP_ALLOC(sizeof(DRAWITEMSTRUCT16));
lphl->needMeasure = TRUE;
dummyls.mis.CtlType = lphl->DrawCtlType;
dummyls.mis.CtlID = lphl->CtlID;
@@ -126,8 +126,6 @@
dummyls.mis.itemData = 0;
ListBoxAskMeasure(lphl,&dummyls);
- } else {
- lphl->hDrawItemStruct = 0;
}
/* WINELIBS list boxes do not operate on local heaps */
@@ -141,9 +139,6 @@
void DestroyListBoxStruct(LPHEADLIST lphl)
{
- if (lphl->hDrawItemStruct)
- USER_HEAP_FREE(lphl->hDrawItemStruct);
-
/* XXX need to free lphl->Heap */
GlobalFree16(lphl->HeapSel);
free(lphl);
@@ -160,11 +155,11 @@
{
if (lphl->dwStyle & LBS_NOTIFY)
#ifdef WINELIB32
- SendMessage(lphl->hParent, WM_COMMAND,
- MAKEWPARAM(lphl->CtlID,code), (LPARAM)lphl->hSelf);
+ SendMessage32A(lphl->hParent, WM_COMMAND,
+ MAKEWPARAM(lphl->CtlID,code), (LPARAM)lphl->hSelf);
#else
- SendMessage(lphl->hParent, WM_COMMAND,
- lphl->CtlID, MAKELONG(lphl->hSelf, code));
+ SendMessage16(lphl->hParent, WM_COMMAND,
+ lphl->CtlID, MAKELONG(lphl->hSelf, code));
#endif
}
@@ -237,21 +232,22 @@
void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC hdc, LPLISTSTRUCT lpls,
RECT16 *rect, WORD itemAction, WORD itemState)
{
- if (lphl->OwnerDrawn) {
- DRAWITEMSTRUCT16 *dis = USER_HEAP_LIN_ADDR(lphl->hDrawItemStruct);
+ if (lphl->OwnerDrawn)
+ {
+ DRAWITEMSTRUCT32 dis;
- dis->CtlID = lpls->mis.CtlID;
- dis->CtlType = lpls->mis.CtlType;
- dis->itemID = lpls->mis.itemID;
- dis->hDC = hdc;
- dis->hwndItem = hwnd;
- dis->itemData = lpls->mis.itemData;
- dis->itemAction = itemAction;
- dis->itemState = itemState;
- dis->rcItem = *rect;
- SendMessage(lphl->hParent, WM_DRAWITEM,
- 0, (LPARAM)USER_HEAP_SEG_ADDR(lphl->hDrawItemStruct));
- } else {
+ dis.CtlID = lpls->mis.CtlID;
+ dis.CtlType = lpls->mis.CtlType;
+ dis.itemID = lpls->mis.itemID;
+ dis.hDC = hdc;
+ dis.hwndItem = hwnd;
+ dis.itemData = lpls->mis.itemData;
+ dis.itemAction = itemAction;
+ dis.itemState = itemState;
+ CONV_RECT16TO32( rect, &dis.rcItem );
+ SendMessage32A( lphl->hParent, WM_DRAWITEM, 0, (LPARAM)&dis );
+ return;
+ }
if (itemAction == ODA_DRAWENTIRE || itemAction == ODA_SELECT) {
int OldBkMode;
DWORD dwOldTextColor = 0;
@@ -277,10 +273,8 @@
}
SetBkMode(hdc, OldBkMode);
- } else DrawFocusRect16(hdc, rect);
- }
-
- return;
+ }
+ else DrawFocusRect16(hdc, rect);
}
@@ -321,7 +315,7 @@
*lpmeasure = lpls->mis;
lpmeasure->itemHeight = lphl->StdItemHeight;
- SendMessage(lphl->hParent, WM_MEASUREITEM, 0, (LPARAM)USER_HEAP_SEG_ADDR(hTemp));
+ SendMessage16(lphl->hParent, WM_MEASUREITEM, 0, (LPARAM)USER_HEAP_SEG_ADDR(hTemp));
if (lphl->dwStyle & LBS_OWNERDRAWFIXED) {
if (lpmeasure->itemHeight > lphl->StdItemHeight)
@@ -931,7 +925,7 @@
if (y == -1) return 0;
if (lphl->dwStyle & LBS_NOTIFY && y!= LB_ERR )
- if( SendMessage(lphl->hParent, WM_LBTRACKPOINT, y, lParam) )
+ if( SendMessage16(lphl->hParent, WM_LBTRACKPOINT, y, lParam) )
return 0;
@@ -986,7 +980,7 @@
#ifndef WINELIB
if (GetWindowLong(lphl->hSelf,GWL_EXSTYLE) & WS_EX_DRAGDETECT)
if( DragDetect(lphl->hSelf,MAKEPOINT16(lParam)) )
- SendMessage(lphl->hParent, WM_BEGINDRAG,0,0L);
+ SendMessage16(lphl->hParent, WM_BEGINDRAG,0,0L);
#endif
return 0;
}
@@ -1014,11 +1008,11 @@
LPHEADLIST lphl = ListBoxGetStorageHeader(hwnd);
#ifdef WINELIB32
- SendMessage(lphl->hParent, WM_COMMAND,
- MAKEWPARAM(GetWindowWord(hwnd,GWW_ID),LBN_DBLCLK),
- (LPARAM)hwnd);
+ SendMessage32A(lphl->hParent, WM_COMMAND,
+ MAKEWPARAM(GetWindowWord(hwnd,GWW_ID),LBN_DBLCLK),
+ (LPARAM)hwnd);
#else
- SendMessage(lphl->hParent, WM_COMMAND, GetWindowWord(hwnd,GWW_ID),
+ SendMessage16(lphl->hParent, WM_COMMAND, GetWindowWord(hwnd,GWW_ID),
MAKELONG(hwnd, LBN_DBLCLK));
#endif
@@ -1116,8 +1110,8 @@
case VK_NEXT:
if ( lphl->dwStyle & LBS_WANTKEYBOARDINPUT )
{
- newFocused = (WORD)(INT)SendMessage(lphl->hParent,WM_VKEYTOITEM,
- wParam,MAKELPARAM(lphl->ItemFocused,hwnd));
+ newFocused = (WORD)(INT)SendMessage16(lphl->hParent,WM_VKEYTOITEM,
+ wParam,MAKELPARAM(lphl->ItemFocused,hwnd));
if ( newFocused == 0xFFFE ) return 0L;
}
if ( newFocused == 0xFFFF )
@@ -1220,8 +1214,8 @@
if ( (lphl->dwStyle & LBS_WANTKEYBOARDINPUT) && !(lphl->HasStrings))
{
- newFocused = (WORD)(INT)SendMessage(lphl->hParent,WM_CHARTOITEM,
- wParam,MAKELPARAM(lphl->ItemFocused,hwnd));
+ newFocused = (WORD)(INT)SendMessage16(lphl->hParent,WM_CHARTOITEM,
+ wParam,MAKELPARAM(lphl->ItemFocused,hwnd));
if ( newFocused == 0xFFFE ) return 0L;
}
@@ -1320,11 +1314,11 @@
hOldFont = SelectObject(hdc, lphl->hFont);
#ifdef WINELIB32
- hBrush = (HBRUSH) SendMessage(lphl->hParent, WM_CTLCOLORLISTBOX, (WPARAM)hdc,
- (LPARAM)hwnd);
+ hBrush = (HBRUSH) SendMessage16(lphl->hParent, WM_CTLCOLORLISTBOX, (WPARAM)hdc,
+ (LPARAM)hwnd);
#else
- hBrush = SendMessage(lphl->hParent, WM_CTLCOLOR, hdc,
- MAKELONG(hwnd, CTLCOLOR_LISTBOX));
+ hBrush = SendMessage16(lphl->hParent, WM_CTLCOLOR, hdc,
+ MAKELONG(hwnd, CTLCOLOR_LISTBOX));
#endif
if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
@@ -1948,7 +1942,7 @@
if( ptrWnd )
if( /* !(ptrWnd->dwExStyle & WS_EX_NOPARENTNOTIFY) && */
ptrWnd->parent )
- return SendMessage(ptrWnd->parent->hwndSelf,message,wParam,lParam);
+ return SendMessage16(ptrWnd->parent->hwndSelf,message,wParam,lParam);
return 0;
}
@@ -2032,7 +2026,7 @@
}
}
- return DefWindowProc(hwnd, message, wParam, lParam);
+ return DefWindowProc16(hwnd, message, wParam, lParam);
}
@@ -2045,10 +2039,10 @@
INT i;
dprintf_listbox( stddeb, "DlgDirSelect: %04x '%s' %d\n", hDlg, lpStr, id );
- if ((i = SendDlgItemMessage( hDlg, id, LB_GETCURSEL, 0, 0 )) == LB_ERR)
+ if ((i = SendDlgItemMessage16( hDlg, id, LB_GETCURSEL, 0, 0 )) == LB_ERR)
return FALSE;
if (!(buffer = SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE;
- SendDlgItemMessage( hDlg, id, LB_GETTEXT, i, (LPARAM)SEGPTR_GET(buffer) );
+ SendDlgItemMessage16(hDlg, id, LB_GETTEXT, i, (LPARAM)SEGPTR_GET(buffer) );
if (buffer[0] == '[') /* drive or directory */
{
if (buffer[1] == '-') /* drive */
@@ -2084,7 +2078,7 @@
#define SENDMSG(msg,wparam,lparam) \
((attrib & DDL_POSTMSGS) ? PostMessage( hwnd, msg, wparam, lparam ) \
- : SendMessage( hwnd, msg, wparam, lparam ))
+ : SendMessage16( hwnd, msg, wparam, lparam ))
dprintf_listbox( stddeb, "DlgDirList: %04x '%s' %d %d %04x\n",
hDlg, filespec ? filespec : "NULL",
@@ -2135,6 +2129,8 @@
(LPARAM)spec ) == LB_ERR) return FALSE;
if (!(temp = SEGPTR_ALLOC( 4*sizeof(char) ))) return FALSE;
strcpy( temp, "*.*" );
+ /* FIXME: this won't work with PostMessage(), as temp will */
+ /* have been freed by the time we do a DispatchMessage(). */
if (SENDMSG( LB_DIR, (attrib & (DDL_DIRECTORY | DDL_DRIVES)) | DDL_EXCLUSIVE,
(LPARAM)SEGPTR_GET(temp) ) == LB_ERR)
{
@@ -2151,15 +2147,14 @@
if (idStatic && ((hwnd = GetDlgItem( hDlg, idStatic )) != 0))
{
- const char *cwd = DRIVE_GetDosCwd(drive);
- char *temp = SEGPTR_ALLOC( strlen(cwd) + 4 );
- if (!temp) return FALSE;
+ char temp[512];
+ int drive = DRIVE_GetCurrentDrive();
strcpy( temp, "A:\\" );
temp[0] += drive;
- strcpy( temp + 3, cwd );
+ lstrcpyn( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
AnsiLower( temp );
- SENDMSG( WM_SETTEXT, 0, (LPARAM)SEGPTR_GET(temp) );
- SEGPTR_FREE(temp);
+ /* Can't use PostMessage() here, because the string is on the stack */
+ SetDlgItemText32A( hDlg, idStatic, temp );
}
return TRUE;
#undef SENDMSG