Commit a0d77315 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 980913

Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net> * [files/file.c] [include/file.h] Fixed SetFilePointer to allow negative positions as in DOS. * [graphics/ddraw.c] Added some methods to IDirect3D. * [ole/compobj.c] [if1632/compobj.spec] Added/implemented CoCreateStandardMalloc16, CoGetClassObject, CoCreateInstance, LookupETask, SetETask, CoGetState16. * [loader/task.c] MakeProcInstance: return 0 if func == NULL. * [*/*] [tools/winapi-check] Added zillions of missing WINAPI's and __cdecl's. (oops, several caused by myself) Wrote script for automated checking. * [if1632/compobj.spec] Many stub names. * [misc/ddeml.c] [ole/compobj.c] Some stubs. Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu> * [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c] [dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h] Added preliminary tab control support. Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [graphics/psdrv/*] More changes to the PostScript driver: Implemented pens and solid brushes. Colour/greyscale for fonts, pens and brushes. To get coloured output you need to have *ColorDevice set to true in your PPD, otherwise you'll get greyscale. Landscape mode now works, as does non-A4 page sizes. Encoding of fonts to ANSI is better, Symbol works again. * [objects/dc.c] [include/gdi.h] [*/*] Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they belong. Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no> * [include/dosexe.h] [include/miscemu.h] [include/msdos.h] [loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c] [msdos/int2f.c] [msdos/interrupts.c] Fixed portability. Adapted some code to make it easier to integrate the DOS subsystem with the DPMI subsystem, made the DPMI simulated real-mode interrupts be handled the V86 way. Added support for .COM files. Made int2f DPMI check fail, to avoid pkunzip crashing in attempting to use DPMI. Generally moved stuff around a little. It is now technically possible to load several DOS programs into the same memory space. Not tested, though. Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de> * [if1632/kernel.spec] Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe. * [win32/except.c] Fixed one bad program behaviour, (deleting SEH while in first walk). RtlUnwind is broken too I think (it should unwind on success, not while walking the exception chain). * [ole/ole2nls.c] Get*DefaultLCID returns 0x400|id. expected by one application. * [if1632/snoop.c] Handle non-standard SP returns more graceful. * [windows/class.c] hinstances are mostly irrelevant for win32. * [memory/string.c] [misc/registry.c] lstrcmpi32W: use toupper for characters < 0x100. (speedup hack for registry.c) Some small speedup hacks for registry.c Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [Makefile.in][configure][configure.in][dlls/Makefile.in] [dlls/comctl32/Makefile.in] Created dlls/comctl32 and moved the common controls stuff to it. * [misc/version.c] Removed COMCTL32_DllGetVersion. The fixed function is part of the common controls stuff. * [dlls/comctl32/*.c][include/commctrl.h] Added structure size tests. * [dlls/comctl32/toolbar.c] Fixed a bug in TOOLBAR_GetMaxWidth(). * [dlls/comctl32/animate.c][include/animate.h] [dlls/comctl32/comboex.c][include/comboex.h] [dlls/comctl32/hotkey.c][include/hotkey.h] [dlls/comctl32/listview.c][include/listview.h] [dlls/comctl32/commctrl.c][include/commctrl.h] New files. Added Animation, ComboBoxEx, Hotkey and Listview control dummies. * [dlls/comctl32/tooltips.c] Fixed a display bug and font selection. * [dlls/comctl32/comctl32undoc.c][include/commctrl.h] Added missing DPA functions. Fixed bugs and published the function prototypes. * [documentation/common_controls] Updated. Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se> * [AUTHORS] [include/authors.h] Added myself as a Wine author. * [memory/virtual.c] [objects/dc.c] Fixed runtime errors for Solaris. * [misc/ddeml.c] [objects/gdiobj.c] Minor fixes. * [win32/device.c] Added stubs for IFSMgr VxDCall and a partial implementation of IFSMgr DeviceIo. * [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec] [relay32/msnet32.spec] [relay32/oledlg.spec] Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL. * [misc/Makefile.in] [misc/imm.c] [include/imm.h] Added news files for implementation of IMM32.DLL. All functions return 0 as is correct for all Western Languages. * [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h] Added new files for implementation of OLEDLG.DLL. Added stubs with FIXME:s for all functions. Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de> * [dlls/shell32/contmenu.c][dlls/shell32/shellole.c] [dlls/shell32/shlfolder.c][dlls/shell32/shlview.c] [documentation/shell32][include/shell.h] Clean up, bugfixes. * [dlls/shell32/enumidlist.c] Fileattributes implemented. * [dlls/shell32/pidl.c] Class pidlmgr splited into functions, structures changed, some functions rewritten. * [dlls/shell32/shell32_main.c] Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation. * [dlls/shell32/shellord.c][relay32/shell32.spec] Parameter documented, implemented SHCloneSpecialIDList. Stub improved ShellExecuteEx32A. New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup, FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp, SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy, SHGetDataFromIDListA, SHFileOperationA. * [include/winnls.h][include/ole2nls.c] TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented in OLE_GetFormatA, GetTimeFormat32A. * [win32/code_page.c] WideCharToMultiByte: parameter checking and returning of strlen implemented. * [windows/keyboard.c][windows/defwnd.c] Debug messages added. * [windows/win.c] WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented. * [controls/menu.c] Missing line added. * [include/winerror.h] Macros for SUCCEEDED and FAILED added. Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de> * [loader/module.c] Bugfix: LoadModule16 should *not* call LoadModule32. * [files/dos_fs.c] Bugfix: don't crash if given directory doesn't exist. Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net> * [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec] Almost completed implementation of [snd]PlaySound (except flags SND_ALIAS_ID and SND_APPLICATION). * [if1632/user.spec][windows/winpos.c] Added SetWindowRgn16 stub. Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru> * [files/drive.c] GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non existent drive. * [msdos/int21.c] INT21_FindFirstFCB: check drive validity to prevent oops. * [win32/file.c] CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE. * [files/dos_fs.c] Make DOSFS_OpenDir treat "" as "/". DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE. * [windows/dialog.c] GetNextDlgTabItem32: use last/first item instead of first/last when hwndCtrl==0. This fixes initial focus. Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au> * [include/process.h] [include/process.c] Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line with thread constant, and Win32 documentation (which calls it a pseudohandle.) Made GetCurrentProcess actually use this constant instead of the value. * [include/process.h] [include/thread.h] [scheduler/thread.c] [scheduler/process.c] [scheduler/handle.c] Modify HANDLE_GetObjPtr to understand about CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE. This allows DuplicateHandle to do the correct thing with these handles. Removed now duplicate functionality from THREAD_GetPtr and PROCESS_GetPtr. * [loader/ne/segment.c] Fixed two places where HFILE32s were being created and passed to 16-bit code. This should unbreak NE self-loading code. Added two casts to remove compile time warnings. Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com> * [msdos/dosmem.c] [msdos/int2f.c] Added beginnings of DOS error table. * [msdos/int1a.c] Stub for subfunction 0xb0. * [msdos/int10.c] [loader/dos/dosvm.c] INT 10 support completely rewritten and lots of debugging added. Now, DOS apps that use INT 10 to write to the screen will work. (Beyond Zork does, at least. Somewhat.) * [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c] Another shot at getting MS's generic error message facility right. * [msdos/int21.c] Command.Com wanted to set its own PSP address. I let it. Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com> * [include/file.h] [misc/lzexpand.c] Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't convert lzw handles. Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> * [misc/registry.c] In RegEnumvalue, ivalue == 0 is a legal request and should return the first entry. * [msdos/int21.c] Add handling for Int21-48/49 in Win16. Makes blinker demo work. * [windows/winproc.c] Add Msg32A<->Msg32W translation for LB_ADDSTRING. Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk> * [windows/win.c] Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD flag when a child window is reparented to the desktop window. Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com> * [controls/menu.c] Menus created with SetMenuItemInfo and InsertMenuItem should work now. Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu> * [controls/combo.c] Added CB_GETITEMHEIGHT. * [windows/winpos.c] WM_NCHITTEST, SWP_FRAMECHANGED bugfixes. Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl> * [files/profile.c] [include/windows.h] Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW, GetPrivateProfileStructW, GetProfileSectionW, WriteProfileSection[AW], WritePrivateProfileStructW.
parent 85ed45e3
This is release 980822 of Wine, the MS Windows emulator. This is still a
This is release 980913 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 correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-980822: (see ChangeLog for details)
- Improved mmio support.
- VxDCall support.
- More common controls and shell32 stuff.
- Better DOS executables support.
WHAT'S NEW with Wine-980913: (see ChangeLog for details)
- Even more common controls stuff.
- Many PostScript driver improvements.
- More DOS executables support.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -18,10 +17,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:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980822.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980822.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980822.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980822.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980913.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980913.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980913.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980913.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
......@@ -113,6 +113,7 @@ Stephen Simmons,
Rick Sladkey,
William Smith,
Dominik Strasser,
Patrik Stridvall,
Vadim Strizhevsky,
Bertho Stultiens,
Erik Svendsen,
......
......@@ -18,7 +18,7 @@ General:
* Very alpha printing code using win16 drivers.
* Very alpha internal Postscript driver. [h.davies1@physics.ox.ac.uk]
* Very alpha internal PostScript driver. [h.davies1@physics.ox.ac.uk]
* Extremely alpha Win95 interface code.
* No OLE2 and OLE32 support (including OLE2 interfaces etc.).
......
......@@ -27,6 +27,7 @@ LIBSUBDIRS = \
tools \
tools/wrc \
controls \
dlls/comctl32 \
dlls/shell32 \
files \
graphics \
......@@ -77,6 +78,7 @@ INSTALLSUBDIRS = $(DOCSUBDIRS)
LIBOBJS = \
controls/controls.o \
dlls/comctl32/comctl32.o \
dlls/shell32/shell32.o \
files/files.o \
graphics/graphics.o \
......
......@@ -3397,6 +3397,7 @@ Makefile
controls/Makefile
debugger/Makefile
dlls/Makefile
dlls/comctl32/Makefile
dlls/shell32/Makefile
documentation/Makefile
files/Makefile
......@@ -3534,6 +3535,7 @@ Makefile
controls/Makefile
debugger/Makefile
dlls/Makefile
dlls/comctl32/Makefile
dlls/shell32/Makefile
documentation/Makefile
files/Makefile
......
......@@ -461,6 +461,7 @@ Makefile
controls/Makefile
debugger/Makefile
dlls/Makefile
dlls/comctl32/Makefile
dlls/shell32/Makefile
documentation/Makefile
files/Makefile
......
......@@ -8,27 +8,14 @@ MODULE = controls
C_SRCS = \
button.c \
combo.c \
comctl32undoc.c \
commctrl.c \
desktop.c \
edit.c \
header.c \
icontitle.c \
listbox.c \
listview.c \
menu.c \
pager.c \
progress.c \
rebar.c \
scroll.c \
static.c \
status.c \
toolbar.c \
tooltips.c \
trackbar.c \
treeview.c \
uitools.c \
updown.c \
widgets.c
all: $(MODULE).o
......
......@@ -129,6 +129,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
return 0;
}
/***********************************************************************
* CBCalcPlacement
*
......@@ -142,22 +143,6 @@ static void CBCalcPlacement( LPHEADCOMBO lphc, LPRECT32 lprEdit,
/* get combo height and width */
if( lphc->editHeight )
size.cy = lphc->editHeight;
else
{
HDC32 hDC = GetDC32( lphc->self->hwndSelf );
HFONT32 hPrevFont = 0;
if( lphc->hFont ) hPrevFont = SelectObject32( hDC, lphc->hFont );
GetTextExtentPoint32A( hDC, "0", 1, &size);
size.cy += size.cy / 4 + 4 * SYSMETRICS_CYBORDER;
if( hPrevFont ) SelectObject32( hDC, hPrevFont );
ReleaseDC32( lphc->self->hwndSelf, hDC );
}
size.cx = rect.right - rect.left;
if( CB_OWNERDRAWN(lphc) )
......@@ -181,6 +166,23 @@ static void CBCalcPlacement( LPHEADCOMBO lphc, LPRECT32 lprEdit,
}
size.cy = u;
}
else if( lphc->editHeight ) /* explicitly set height */
size.cy = lphc->editHeight;
else
{
HDC32 hDC = GetDC32( lphc->self->hwndSelf );
HFONT32 hPrevFont = 0;
if( lphc->hFont ) hPrevFont = SelectObject32( hDC, lphc->hFont );
GetTextExtentPoint32A( hDC, "0", 1, &size);
size.cy += size.cy / 4 + 4 * SYSMETRICS_CYBORDER;
if( hPrevFont ) SelectObject32( hDC, hPrevFont );
ReleaseDC32( lphc->self->hwndSelf, hDC );
}
/* calculate text and button placement */
......@@ -1419,10 +1421,17 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message,
return SendMessage32A( lphc->hWndLBox, LB_FINDSTRINGEXACT32,
wParam, lParam );
case CB_SETITEMHEIGHT16:
wParam = (INT32)(INT16)wParam;
wParam = (INT32)(INT16)wParam; /* signed integer */
case CB_SETITEMHEIGHT32:
return COMBO_SetItemHeight( lphc, (INT32)wParam, (INT32)lParam);
case CB_GETITEMHEIGHT16:
wParam = (INT32)(INT16)wParam;
case CB_GETITEMHEIGHT32:
if( (INT32)wParam >= 0 )
return SendMessage32A( lphc->hWndLBox, LB_GETITEMHEIGHT32, wParam, 0);
return (lphc->RectEdit.bottom - lphc->RectEdit.top);
case CB_RESETCONTENT16:
case CB_RESETCONTENT32:
SendMessage32A( lphc->hWndLBox, LB_RESETCONTENT32, 0, 0 );
......
......@@ -514,6 +514,7 @@ LRESULT WINAPI EditWndProc( HWND32 hwnd, UINT32 msg,
case EM_REPLACESEL32:
DPRINTF_EDIT_MSG32("EM_REPLACESEL");
EDIT_EM_ReplaceSel(wnd, es, (BOOL32)wParam, (LPCSTR)lParam);
result = 1;
break;
/* message 0x00c3 missing from specs */
......
......@@ -312,7 +312,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
GetClientRect32( wnd->hwndSelf, &rect );
descr->width = rect.right - rect.left;
descr->height = rect.bottom - rect.top;
if (!(descr->style & LBS_NOINTEGRALHEIGHT))
if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !IS_OWNERDRAW(descr))
{
if ((descr->height > descr->item_height) &&
(descr->height % descr->item_height))
......
/*
* Listview control
*
* Copyright 1998 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
* I will only improve this control once in a while.
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - All messages.
* - All notifications.
*/
#include "windows.h"
#include "commctrl.h"
#include "listview.h"
#include "heap.h"
#include "win.h"
#include "debug.h"
#define LISTVIEW_GetInfoPtr(wndPtr) ((LISTVIEW_INFO *)wndPtr->wExtra[0])
static VOID
LISTVIEW_Refresh (WND *wndPtr, HDC32 hdc)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
}
static LRESULT
LISTVIEW_SetBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
if (!(infoPtr)) return FALSE;
/* set background color */
infoPtr->clrBk = (COLORREF)lParam;
return TRUE;
}
static LRESULT
LISTVIEW_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
FIXME (listview, "(0x%08x 0x%08lx)\n", wParam, lParam);
return 0;
}
static LRESULT
LISTVIEW_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
/* initialize info structure */
infoPtr->clrBk = CLR_NONE;
return 0;
}
static LRESULT
LISTVIEW_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
return 0;
}
static LRESULT
LISTVIEW_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
if (infoPtr->clrBk == CLR_NONE) {
return SendMessage32A (GetParent32 (wndPtr->hwndSelf),
WM_ERASEBKGND, wParam, lParam);
}
else {
RECT32 rect;
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
GetClientRect32 (wndPtr->hwndSelf, &rect);
FillRect32 ((HDC32)wParam, &rect, hBrush);
DeleteObject32 (hBrush);
return FALSE;
}
return FALSE;
}
static LRESULT
LISTVIEW_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (LISTVIEW_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(LISTVIEW_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (listview, "could not allocate info memory!\n");
return 0;
}
if ((LISTVIEW_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (listview, "pointer assignment error!\n");
return 0;
}
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
}
static LRESULT
LISTVIEW_NCDestroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
/* free list view info data */
HeapFree (GetProcessHeap (), 0, infoPtr);
return 0;
}
static LRESULT
LISTVIEW_Paint (WND *wndPtr, WPARAM32 wParam)
{
HDC32 hdc;
PAINTSTRUCT32 ps;
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
LISTVIEW_Refresh (wndPtr, hdc);
if (!wParam)
EndPaint32 (wndPtr->hwndSelf, &ps);
return 0;
}
LRESULT WINAPI
ListviewWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case LVM_SETBKCOLOR:
return LISTVIEW_SetBkColor (wndPtr, wParam, lParam);
case LVM_SETIMAGELIST:
return LISTVIEW_SetImageList (wndPtr, wParam, lParam);
// case WM_CHAR:
// case WM_COMMAND:
case WM_CREATE:
return LISTVIEW_Create (wndPtr, wParam, lParam);
case WM_DESTROY:
return LISTVIEW_Destroy (wndPtr, wParam, lParam);
case WM_ERASEBKGND:
return LISTVIEW_EraseBackground (wndPtr, wParam, lParam);
// case WM_GETDLGCODE:
// case WM_GETFONT:
// case WM_HSCROLL:
// case WM_MOUSEMOVE:
// return LISTVIEW_MouseMove (wndPtr, wParam, lParam);
case WM_NCCREATE:
return LISTVIEW_NCCreate (wndPtr, wParam, lParam);
case WM_NCDESTROY:
return LISTVIEW_NCDestroy (wndPtr, wParam, lParam);
// case WM_NOTIFY:
case WM_PAINT:
return LISTVIEW_Paint (wndPtr, wParam);
// case WM_RBUTTONDOWN:
// case WM_SETFOCUS:
// case WM_SETFONT:
// case WM_SETREDRAW:
// case WM_TIMER:
// case WM_VSCROLL:
// case WM_WINDOWPOSCHANGED:
// case WM_WININICHANGE:
default:
if (uMsg >= WM_USER)
ERR (listview, "unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
}
void
LISTVIEW_Register (void)
{
WNDCLASS32A wndClass;
if (GlobalFindAtom32A (WC_LISTVIEW32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
wndClass.lpfnWndProc = (WNDPROC32)ListviewWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(LISTVIEW_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
wndClass.lpszClassName = WC_LISTVIEW32A;
RegisterClass32A (&wndClass);
}
......@@ -760,7 +760,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
if ((lprect == NULL) || (lppop == NULL)) return;
if (lppop->nItems == 0) return;
TRACE(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n",
TRACE(menu,"left=%d top=%d right=%d bottom=%d\n",
lprect->left, lprect->top, lprect->right, lprect->bottom);
lppop->Width = lprect->right - lprect->left;
lppop->Height = 0;
......@@ -1102,7 +1102,7 @@ static void MENU_DrawPopupMenu( HWND32 hwnd, HDC32 hdc, HMENU32 hmenu )
SetROP232( hdc, ropPrev );
}
else
TWEAK_DrawReliefRect95(hdc, &rect);
DrawEdge32 (hdc, &rect, EDGE_RAISED, BF_RECT);
/* draw menu items */
......@@ -2968,6 +2968,7 @@ UINT32 WINAPI GetMenuItemID32( HMENU32 hMenu, INT32 nPos )
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return -1;
if ((nPos < 0) || (nPos >= menu->nItems)) return -1;
if (menu->items[nPos].fType & MF_POPUP) return -1;
return menu->items[nPos].wID;
}
......@@ -3814,8 +3815,21 @@ static BOOL32 SetMenuItemInfo32_common(MENUITEM * menu,
if (lpmii->fMask & MIIM_ID)
menu->wID = lpmii->wID;
if (lpmii->fMask & MIIM_SUBMENU)
if (lpmii->fMask & MIIM_SUBMENU) {
menu->hSubMenu = lpmii->hSubMenu;
if (menu->hSubMenu) {
POPUPMENU *subMenu = (POPUPMENU *)USER_HEAP_LIN_ADDR((UINT16)menu->hSubMenu);
if (IS_A_MENU(subMenu)) {
subMenu->wFlags |= MF_POPUP;
menu->fType |= MF_POPUP;
}
else
/* FIXME: Return an error ? */
menu->fType &= ~MF_POPUP;
}
else
menu->fType &= ~MF_POPUP;
}
if (lpmii->fMask & MIIM_CHECKMARKS)
{
......
......@@ -271,7 +271,6 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
case WM_GETDLGCODE:
return DLGC_STATIC;
return infoPtr->hIcon;
case STM_GETIMAGE:
case STM_GETICON16:
case STM_GETICON32:
......@@ -283,6 +282,7 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
InvalidateRect32( hWnd, NULL, FALSE );
UpdateWindow32( hWnd );
break;
case STM_SETICON16:
case STM_SETICON32:
lResult = STATIC_SetIcon( wndPtr, (HICON16)wParam );
......
/*
* Trackbar control
*
* Copyright 1998 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
* I will only improve this control once in a while.
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - All messages.
* - All notifications.
*/
#include "windows.h"
#include "commctrl.h"
#include "trackbar.h"
#include "heap.h"
#include "win.h"
#include "debug.h"
#define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)wndPtr->wExtra[0])
static VOID
TRACKBAR_Refresh (WND *wndPtr, HDC32 hdc)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
RECT32 rect;
GetClientRect32 (wndPtr->hwndSelf, &rect);
/* draw channel */
DrawEdge32 (hdc, &infoPtr->rcChannel, EDGE_SUNKEN, BF_RECT);
/* draw thumb */
if (!(wndPtr->dwStyle & TBS_NOTHUMB)) {
}
/* draw ticks */
if (!(wndPtr->dwStyle & TBS_NOTICKS)) {
}
if (infoPtr->bFocus)
DrawFocusRect32 (hdc, &rect);
}
static LRESULT
TRACKBAR_ClearSel (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
infoPtr->nSelMin = 0;
infoPtr->nSelMax = 0;
if ((BOOL32)wParam) {
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
return 0;
}
// << TRACKBAR_ClearTics >>
// << TRACKBAR_GetChannelRect >>
static LRESULT
TRACKBAR_GetLineSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nLineSize;
}
// << TRACKBAR_GetNumTics >>
static LRESULT
TRACKBAR_GetPageSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nPageSize;
}
static LRESULT
TRACKBAR_GetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nPos;
}
// << TRACKBAR_GetPTics >>
static LRESULT
TRACKBAR_GetRangeMax (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nRangeMax;
}
static LRESULT
TRACKBAR_GetRangeMin (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nRangeMin;
}
static LRESULT
TRACKBAR_GetSelEnd (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nSelMax;
}
static LRESULT
TRACKBAR_GetSelStart (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nSelMin;
}
static LRESULT
TRACKBAR_GetThumbLength (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
return infoPtr->nThumbLen;
}
static LRESULT
TRACKBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr;
infoPtr = (TRACKBAR_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(TRACKBAR_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
/* default values */
infoPtr->nRangeMin = 0;
infoPtr->nRangeMax = 100;
infoPtr->nLineSize = 1;
infoPtr->nPageSize = 20;
infoPtr->nSelMin = 0;
infoPtr->nSelMax = 0;
infoPtr->nPos = 0;
infoPtr->nThumbLen = 23; /* initial thumb length */
return 0;
}
static LRESULT
TRACKBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
HeapFree (GetProcessHeap (), 0, infoPtr);
return 0;
}
static LRESULT
TRACKBAR_KillFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
HDC32 hdc;
infoPtr->bFocus = FALSE;
hdc = GetDC32 (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
return 0;
}
static LRESULT
TRACKBAR_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
SetFocus32 (wndPtr->hwndSelf);
return 0;
}
static LRESULT
TRACKBAR_Paint (WND *wndPtr, WPARAM32 wParam)
{
HDC32 hdc;
PAINTSTRUCT32 ps;
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
TRACKBAR_Refresh (wndPtr, hdc);
if(!wParam)
EndPaint32 (wndPtr->hwndSelf, &ps);
return 0;
}
static LRESULT
TRACKBAR_SetFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
HDC32 hdc;
infoPtr->bFocus = TRUE;
hdc = GetDC32 (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
return 0;
}
static LRESULT
TRACKBAR_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
RECT32 rect;
GetClientRect32 (wndPtr->hwndSelf, &rect);
/* calculate channel rect */
if (wndPtr->dwStyle & TBS_VERT) {
infoPtr->rcChannel.top = rect.top + 8;
infoPtr->rcChannel.bottom = rect.bottom - 8;
/* FIXME */
infoPtr->rcChannel.left = rect.left + 10;
infoPtr->rcChannel.right = rect.left + 14;
}
else {
infoPtr->rcChannel.left = rect.left + 8;
infoPtr->rcChannel.right = rect.right - 8;
/* FIXME */
if (wndPtr->dwStyle & TBS_BOTH) {
infoPtr->rcChannel.top = rect.bottom / 2 - 2;
infoPtr->rcChannel.bottom = rect.bottom / 2 + 2;
}
else if (wndPtr->dwStyle & TBS_TOP) {
infoPtr->rcChannel.top = rect.top + 10;
infoPtr->rcChannel.bottom = rect.top + 14;
}
else {
/* TBS_BOTTOM */
infoPtr->rcChannel.top = rect.bottom - 14;
infoPtr->rcChannel.bottom = rect.bottom - 10;
}
}
return 0;
}
// << TRACKBAR_Timer >>
// << TRACKBAR_WinIniChange >>
LRESULT WINAPI
TrackbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case TBM_CLEARSEL:
return TRACKBAR_ClearSel (wndPtr, wParam, lParam);
// case TBM_CLEARTICS:
// case TBM_GETBUDDY:
// case TBM_GETCHANNELRECT:
case TBM_GETLINESIZE:
return TRACKBAR_GetLineSize (wndPtr, wParam, lParam);
// case TBM_GETNUMTICS:
case TBM_GETPAGESIZE:
return TRACKBAR_GetPageSize (wndPtr, wParam, lParam);
case TBM_GETPOS:
return TRACKBAR_GetPos (wndPtr, wParam, lParam);
// case TBM_GETPTICS:
case TBM_GETRANGEMAX:
return TRACKBAR_GetRangeMax (wndPtr, wParam, lParam);
case TBM_GETRANGEMIN:
return TRACKBAR_GetRangeMin (wndPtr, wParam, lParam);
case TBM_GETSELEND:
return TRACKBAR_GetSelEnd (wndPtr, wParam, lParam);
case TBM_GETSELSTART:
return TRACKBAR_GetSelStart (wndPtr, wParam, lParam);
case TBM_GETTHUMBLENGTH:
return TRACKBAR_GetThumbLength (wndPtr, wParam, lParam);
// case TBM_GETTHUMBRECT:
// case TBM_GETTIC:
// case TBM_GETTICPOS:
// case TBM_GETTOOLTIPS:
// case TBM_GETUNICODEFORMAT:
// case TBM_SETBUDDY:
// case TBM_SETPAGESIZE:
// case TBM_SETPOS:
// case TBM_SETRANGE:
// case TBM_SETRANGEMAX:
// case TBM_SETRANGEMIN:
// case TBM_SETSEL:
// case TBM_SETSELEND:
// case TBM_SETSELSTART:
// case TBM_SETTHUMBLENGTH:
// case TBM_SETTIC:
// case TBM_SETTICFREQ:
// case TBM_SETTIPSIDE:
// case TBM_SETTOOLTIPS:
// case TBM_SETUNICODEFORMAT:
// case WM_CAPTURECHANGED:
case WM_CREATE:
return TRACKBAR_Create (wndPtr, wParam, lParam);
case WM_DESTROY:
return TRACKBAR_Destroy (wndPtr, wParam, lParam);
// case WM_ENABLE:
// case WM_ERASEBKGND:
// return 0;
case WM_GETDLGCODE:
return DLGC_WANTARROWS;
// case WM_KEYDOWN:
// case WM_KEYUP:
case WM_KILLFOCUS:
return TRACKBAR_KillFocus (wndPtr, wParam, lParam);
case WM_LBUTTONDOWN:
return TRACKBAR_LButtonDown (wndPtr, wParam, lParam);
// case WM_LBUTTONUP:
// case WM_MOUSEMOVE:
// return TRACKBAR_MouseMove (wndPtr, wParam, lParam);
case WM_PAINT:
return TRACKBAR_Paint (wndPtr, wParam);
case WM_SETFOCUS:
return TRACKBAR_SetFocus (wndPtr, wParam, lParam);
case WM_SIZE:
return TRACKBAR_Size (wndPtr, wParam, lParam);
// case WM_TIMER:
// case WM_WININICHANGE:
default:
if (uMsg >= WM_USER)
ERR (trackbar, "unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
}
void
TRACKBAR_Register (void)
{
WNDCLASS32A wndClass;
if (GlobalFindAtom32A (TRACKBAR_CLASS32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS;
wndClass.lpfnWndProc = (WNDPROC32)TrackbarWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(TRACKBAR_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
wndClass.lpszClassName = TRACKBAR_CLASS32A;
RegisterClass32A (&wndClass);
}
......@@ -7,7 +7,6 @@
#include <assert.h>
#include "win.h"
#include "commctrl.h"
#include "button.h"
#include "static.h"
#include "scroll.h"
......
SUBDIRS = \
comctl32 \
shell32
all: $(SUBDIRS)
......
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = comctl32
C_SRCS = \
animate.c \
comboex.c \
comctl32undoc.c \
commctrl.c \
header.c \
hotkey.c \
imagelist.c \
listview.c \
pager.c \
progress.c \
rebar.c \
status.c \
tab.c \
toolbar.c \
tooltips.c \
trackbar.c \
treeview.c \
updown.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
/*
* Animation control
*
* Copyright 1998 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
* I will only improve this control once in a while.
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - All messages.
* - All notifications.
*/
#include "windows.h"
#include "commctrl.h"
#include "animate.h"
#include "win.h"
#include "debug.h"
#define ANIMATE_GetInfoPtr(wndPtr) ((ANIMATE_INFO *)wndPtr->wExtra[0])
static LRESULT
ANIMATE_Open32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
if (!lParam) {
FIXME (animate, "close avi: empty stub!\n");
return TRUE;
}
if (HIWORD(lParam)) {
FIXME (animate, "(\"%s\") empty stub!\n", (LPSTR)lParam);
}
else {
FIXME (animate, "(%u) empty stub!\n", (WORD)LOWORD(lParam));
}
return TRUE;
}
static LRESULT
ANIMATE_Play (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
INT32 nFrom = (INT32)LOWORD(lParam);
INT32 nTo = (INT32)HIWORD(lParam);
INT32 nRepeat = (INT32)wParam;
#if 0
/* nothing opened */
if (...)
return FALSE;
#endif
if (nRepeat == -1) {
FIXME (animate, "(loop from=%d to=%d) empty stub!\n",
nFrom, nTo);
}
else {
FIXME (animate, "(repeat=%d from=%d to=%d) empty stub!\n",
nRepeat, nFrom, nTo);
}
return TRUE;
}
static LRESULT
ANIMATE_Stop (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
#if 0
/* nothing opened */
if (...)
return FALSE;
#endif
return TRUE;
}
static LRESULT
ANIMATE_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (ANIMATE_INFO *)COMCTL32_Alloc (sizeof(ANIMATE_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (animate, "could not allocate info memory!\n");
return 0;
}
if ((ANIMATE_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (animate, "pointer assignment error!\n");
return 0;
}
/* set default settings */
return 0;
}
static LRESULT
ANIMATE_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
/* free animate info data */
COMCTL32_Free (infoPtr);
return 0;
}
#if 0
static LRESULT
ANIMATE_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
/*
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
RECT32 rect;
GetClientRect32 (wndPtr->hwndSelf, &rect);
FillRect32 ((HDC32)wParam, &rect, hBrush);
DeleteObject32 (hBrush);
*/
return TRUE;
}
#endif
LRESULT WINAPI
ANIMATE_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case ACM_OPEN32A:
return ANIMATE_Open32A (wndPtr, wParam, lParam);
// case ACM_OPEN32W:
// return ANIMATE_Open32W (wndPtr, wParam, lParam);
case ACM_PLAY:
return ANIMATE_Play (wndPtr, wParam, lParam);
case ACM_STOP:
return ANIMATE_Stop (wndPtr, wParam, lParam);
case WM_CREATE:
return ANIMATE_Create (wndPtr, wParam, lParam);
case WM_DESTROY:
return ANIMATE_Destroy (wndPtr, wParam, lParam);
// case WM_ERASEBKGND:
// return ANIMATE_EraseBackground (wndPtr, wParam, lParam);
// case WM_NCCREATE:
// case WM_NCHITTEST:
// case WM_PAINT:
// case WM_SIZE:
// case WM_STYLECHANGED:
// case WM_TIMER:
default:
if (uMsg >= WM_USER)
ERR (animate, "unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
}
void
ANIMATE_Register (void)
{
WNDCLASS32A wndClass;
if (GlobalFindAtom32A (ANIMATE_CLASS32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
wndClass.lpfnWndProc = (WNDPROC32)ANIMATE_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(ANIMATE_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
wndClass.hbrBackground = (HBRUSH32)(COLOR_BTNFACE + 1);
wndClass.lpszClassName = ANIMATE_CLASS32A;
RegisterClass32A (&wndClass);
}
/*
* ComboBoxEx control
*
* Copyright 1998 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
* I will only improve this control once in a while.
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - All messages.
* - All notifications.
*
* FIXME:
* - should include "combo.h"
*/
#include "windows.h"
#include "commctrl.h"
#include "comboex.h"
#include "win.h"
#include "debug.h"
#define ID_CB_EDIT 1001
#define COMBOEX_GetInfoPtr(wndPtr) ((COMBOEX_INFO *)wndPtr->wExtra[0])
// << COMBOEX_DeleteItem >>
__inline__ static LRESULT
COMBOEX_GetComboControl (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
TRACE (comboex, "\n");
return (LRESULT)infoPtr->hwndCombo;
}
__inline__ static LRESULT
COMBOEX_GetEditControl (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
if ((wndPtr->dwStyle & CBS_DROPDOWNLIST) != CBS_DROPDOWN)
return 0;
FIXME (comboex, "-- 0x%x\n", GetDlgItem32 (infoPtr->hwndCombo, ID_CB_EDIT));
return (LRESULT)GetDlgItem32 (infoPtr->hwndCombo, ID_CB_EDIT);
}
__inline__ static LRESULT
COMBOEX_GetExtendedStyle (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
return (LRESULT)infoPtr->dwExtStyle;
}
__inline__ static LRESULT
COMBOEX_GetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
return (LRESULT)infoPtr->himl;
}
static LRESULT
COMBOEX_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
FIXME (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
return -1;
}
static LRESULT
COMBOEX_SetExtendedStyle (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
DWORD dwTemp;
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
dwTemp = infoPtr->dwExtStyle;
if ((DWORD)wParam) {
infoPtr->dwExtStyle = (infoPtr->dwExtStyle & ~(DWORD)wParam) | (DWORD)lParam;
}
else
infoPtr->dwExtStyle = (DWORD)lParam;
/* FIXME: repaint?? */
return (LRESULT)dwTemp;
}
__inline__ static LRESULT
COMBOEX_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
HIMAGELIST himlTemp;
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
himlTemp = infoPtr->himl;
infoPtr->himl = (HIMAGELIST)lParam;
return (LRESULT)himlTemp;
}
static LRESULT
COMBOEX_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr;
DWORD dwComboStyle;
/* allocate memory for info structure */
infoPtr = (COMBOEX_INFO *)COMCTL32_Alloc (sizeof(COMBOEX_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (listview, "could not allocate info memory!\n");
return 0;
}
if ((COMBOEX_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (listview, "pointer assignment error!\n");
return 0;
}
/* initialize info structure */
/* create combo box */
dwComboStyle =
wndPtr->dwStyle & (CBS_SIMPLE|CBS_DROPDOWN|CBS_DROPDOWNLIST|WS_CHILD);
infoPtr->hwndCombo =
CreateWindow32A ("ComboBox", "",
WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | dwComboStyle,
0, 0, 0, 0, wndPtr->hwndSelf, (HMENU32)1,
wndPtr->hInstance, NULL);
return 0;
}
static LRESULT
COMBOEX_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
if (infoPtr->hwndCombo)
DestroyWindow32 (infoPtr->hwndCombo);
/* free comboex info data */
COMCTL32_Free (infoPtr);
return 0;
}
static LRESULT
COMBOEX_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
RECT32 rect;
GetClientRect32 (wndPtr->hwndSelf, &rect);
MoveWindow32 (infoPtr->hwndCombo, 0, 0, rect.right -rect.left,
rect.bottom - rect.top, TRUE);
return 0;
}
LRESULT WINAPI
COMBOEX_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
// case CBEM_DELETEITEM:
case CBEM_GETCOMBOCONTROL:
return COMBOEX_GetComboControl (wndPtr, wParam, lParam);
case CBEM_GETEDITCONTROL:
return COMBOEX_GetEditControl (wndPtr, wParam, lParam);
case CBEM_GETEXTENDEDSTYLE:
return COMBOEX_GetExtendedStyle (wndPtr, wParam, lParam);
case CBEM_GETIMAGELIST:
return COMBOEX_GetImageList (wndPtr, wParam, lParam);
// case CBEM_GETITEM32A:
// case CBEM_GETITEM32W:
// case CBEM_GETUNICODEFORMAT:
// case CBEM_HASEDITCHANGED:
case CBEM_INSERTITEM32A:
return COMBOEX_InsertItem32A (wndPtr, wParam, lParam);
// case CBEM_INSERTITEM32W:
case CBEM_SETEXTENDEDSTYLE:
return COMBOEX_SetExtendedStyle (wndPtr, wParam, lParam);
case CBEM_SETIMAGELIST:
return COMBOEX_SetImageList (wndPtr, wParam, lParam);
// case CBEM_SETITEM32A:
// case CBEM_SETITEM32W:
// case CBEM_SETUNICODEFORMAT:
case WM_CREATE:
return COMBOEX_Create (wndPtr, wParam, lParam);
case WM_DESTROY:
return COMBOEX_Destroy (wndPtr, wParam, lParam);
case WM_SIZE:
return COMBOEX_Size (wndPtr, wParam, lParam);
default:
if (uMsg >= WM_USER)
ERR (comboex, "unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
}
void
COMBOEX_Register (void)
{
WNDCLASS32A wndClass;
if (GlobalFindAtom32A (WC_COMBOBOXEX32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS;
wndClass.lpfnWndProc = (WNDPROC32)COMBOEX_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(COMBOEX_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
wndClass.lpszClassName = WC_COMBOBOXEX32A;
RegisterClass32A (&wndClass);
}
......@@ -447,7 +447,7 @@ HEADER_SendHeaderNotify (WND *wndPtr, UINT32 code, INT32 iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
NMHEADERA nmhdr;
HD_ITEMA nmitem;
HDITEM32A nmitem;
nmhdr.hdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.hdr.idFrom = wndPtr->wIDmenu;
......@@ -565,13 +565,15 @@ static LRESULT
HEADER_GetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HD_ITEMA *phdi;
INT32 iItem;
UINT32 uMask;
HDITEM32A *phdi;
INT32 iItem;
UINT32 uMask;
phdi = (HD_ITEMA*)lParam;
phdi = (HDITEM32A*)lParam;
iItem = (INT32)wParam;
if (phdi == NULL)
return FALSE;
if ((iItem < 0) || (iItem > infoPtr->uNumItem - 1))
return FALSE;
......@@ -668,13 +670,12 @@ static LRESULT
HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HD_ITEMA *phdi;
HDC32 hdc;
INT32 iItem, len;
HDITEM32A *phdi = (HDITEM32A*)lParam;
INT32 iItem = (INT32)wParam;
HDC32 hdc;
INT32 len;
phdi = (HD_ITEMA*)lParam;
iItem = (INT32)wParam;
if (phdi == NULL) return -1;
if (iItem < 0) return -1;
if (iItem > infoPtr->uNumItem)
iItem = infoPtr->uNumItem;
......@@ -796,13 +797,12 @@ static LRESULT
HEADER_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HD_ITEMA *phdi;
INT32 iItem;
HDC32 hdc;
phdi = (HD_ITEMA*)lParam;
iItem = (INT32)wParam;
HDITEM32A *phdi = (HDITEM32A*)lParam;
INT32 iItem = (INT32)wParam;
HDC32 hdc;
if (phdi == NULL)
return FALSE;
if ((iItem < 0) || (iItem > infoPtr->uNumItem - 1))
return FALSE;
......@@ -1221,7 +1221,7 @@ HEADER_SetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
LRESULT WINAPI
HeaderWindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
......@@ -1317,7 +1317,7 @@ void HEADER_Register( void )
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
wndClass.lpfnWndProc = (WNDPROC32)HeaderWindowProc;
wndClass.lpfnWndProc = (WNDPROC32)HEADER_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(HEADER_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
......
/*
* Hotkey control
*
* Copyright 1998 Eric Kohl
*
* NOTES
* Development in progress. An author is needed! Any volunteers?
* I will only improve this control once in a while.
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - Some messages.
* - Display code.
*/
#include "windows.h"
#include "commctrl.h"
#include "hotkey.h"
#include "win.h"
#include "debug.h"
#define HOTKEY_GetInfoPtr(wndPtr) ((HOTKEY_INFO *)wndPtr->wExtra[0])
// << HOTHEY_GetHotKey >>
// << HOTHEY_SetHotKey >>
// << HOTHEY_SetRules >>
// << HOTKEY_Char >>
static LRESULT
HOTKEY_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr;
TEXTMETRIC32A tm;
HDC32 hdc;
/* allocate memory for info structure */
infoPtr = (HOTKEY_INFO *)COMCTL32_Alloc (sizeof(HOTKEY_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (listview, "could not allocate info memory!\n");
return 0;
}
if ((HOTKEY_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (listview, "pointer assignment error!\n");
return 0;
}
/* initialize info structure */
/* get default font height */
hdc = GetDC32 (wndPtr->hwndSelf);
GetTextMetrics32A (hdc, &tm);
infoPtr->nHeight = tm.tmHeight;
ReleaseDC32 (wndPtr->hwndSelf, hdc);
return 0;
}
static LRESULT
HOTKEY_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
/* free hotkey info data */
COMCTL32_Free (infoPtr);
return 0;
}
static LRESULT
HOTKEY_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
HBRUSH32 hBrush;
RECT32 rc;
hBrush =
(HBRUSH32)SendMessage32A (wndPtr->parent->hwndSelf, WM_CTLCOLOREDIT,
wParam, (LPARAM)wndPtr->hwndSelf);
if (hBrush)
hBrush = (HBRUSH32)GetStockObject32 (WHITE_BRUSH);
GetClientRect32 (wndPtr->hwndSelf, &rc);
FillRect32 ((HDC32)wParam, &rc, hBrush);
return -1;
}
__inline__ static LRESULT
HOTKEY_GetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
return infoPtr->hFont;
}
static LRESULT
HOTKEY_KeyDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
switch (wParam) {
case VK_RETURN:
case VK_TAB:
case VK_SPACE:
case VK_DELETE:
case VK_ESCAPE:
case VK_BACK:
return DefWindowProc32A (wndPtr->hwndSelf, WM_KEYDOWN, wParam, lParam);
case VK_SHIFT:
case VK_CONTROL:
case VK_MENU:
FIXME (hotkey, "modifier key pressed!\n");
break;
default:
FIXME (hotkey, " %d\n", wParam);
break;
}
return TRUE;
}
static LRESULT
HOTKEY_KeyUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
FIXME (hotkey, " %d\n", wParam);
return 0;
}
static LRESULT
HOTKEY_KillFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
infoPtr->bFocus = FALSE;
DestroyCaret32 ();
return 0;
}
static LRESULT
HOTKEY_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
// HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
SetFocus32 (wndPtr->hwndSelf);
return 0;
}
__inline__ static LRESULT
HOTKEY_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
wndPtr->dwExStyle |= WS_EX_CLIENTEDGE;
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
}
static LRESULT
HOTKEY_SetFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
infoPtr->bFocus = TRUE;
CreateCaret32 (wndPtr->hwndSelf, (HBITMAP32)0, 1, infoPtr->nHeight);
SetCaretPos32 (1, 1);
ShowCaret32 (wndPtr->hwndSelf);
return 0;
}
__inline__ static LRESULT
HOTKEY_SetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
TEXTMETRIC32A tm;
HDC32 hdc;
HFONT32 hOldFont = 0;
infoPtr->hFont = (HFONT32)wParam;
hdc = GetDC32 (wndPtr->hwndSelf);
if (infoPtr->hFont)
hOldFont = SelectObject32 (hdc, infoPtr->hFont);
GetTextMetrics32A (hdc, &tm);
infoPtr->nHeight = tm.tmHeight;
if (infoPtr->hFont)
SelectObject32 (hdc, hOldFont);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
if (LOWORD(lParam)) {
FIXME (hotkey, "force redraw!\n");
}
return 0;
}
static LRESULT
HOTKEY_SysKeyDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
switch (wParam) {
case VK_RETURN:
case VK_TAB:
case VK_SPACE:
case VK_DELETE:
case VK_ESCAPE:
case VK_BACK:
return DefWindowProc32A (wndPtr->hwndSelf, WM_SYSKEYDOWN, wParam, lParam);
case VK_SHIFT:
case VK_CONTROL:
case VK_MENU:
FIXME (hotkey, "modifier key pressed!\n");
break;
default:
FIXME (hotkey, " %d\n", wParam);
break;
}
return TRUE;
}
static LRESULT
HOTKEY_SysKeyUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
FIXME (hotkey, " %d\n", wParam);
return 0;
}
LRESULT WINAPI
HOTKEY_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
// case HKM_GETHOTKEY:
// case HKM_SETHOTKEY:
// case HKM_SETRULES:
// case WM_CHAR:
case WM_CREATE:
return HOTKEY_Create (wndPtr, wParam, lParam);
case WM_DESTROY:
return HOTKEY_Destroy (wndPtr, wParam, lParam);
case WM_ERASEBKGND:
return HOTKEY_EraseBackground (wndPtr, wParam, lParam);
case WM_GETDLGCODE:
return DLGC_WANTCHARS | DLGC_WANTARROWS;
case WM_GETFONT:
return HOTKEY_GetFont (wndPtr, wParam, lParam);
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
return HOTKEY_KeyDown (wndPtr, wParam, lParam);
case WM_KEYUP:
case WM_SYSKEYUP:
return HOTKEY_KeyUp (wndPtr, wParam, lParam);
case WM_KILLFOCUS:
return HOTKEY_KillFocus (wndPtr, wParam, lParam);
case WM_LBUTTONDOWN:
return HOTKEY_LButtonDown (wndPtr, wParam, lParam);
case WM_NCCREATE:
return HOTKEY_NCCreate (wndPtr, wParam, lParam);
// case WM_PAINT:
case WM_SETFOCUS:
return HOTKEY_SetFocus (wndPtr, wParam, lParam);
case WM_SETFONT:
return HOTKEY_SetFont (wndPtr, wParam, lParam);
// case WM_SYSCHAR:
default:
if (uMsg >= WM_USER)
ERR (hotkey, "unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
}
void
HOTKEY_Register (void)
{
WNDCLASS32A wndClass;
if (GlobalFindAtom32A (HOTKEY_CLASS32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS;
wndClass.lpfnWndProc = (WNDPROC32)HOTKEY_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(HOTKEY_INFO *);
wndClass.hCursor = 0;
wndClass.hbrBackground = 0;
wndClass.lpszClassName = HOTKEY_CLASS32A;
RegisterClass32A (&wndClass);
}
......@@ -1921,8 +1921,10 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT32 i, HICON32 hIcon)
if (hdcImage)
DeleteDC32 (hdcImage);
// FIXME (imagelist, "deleting hbmColor!\n");
if (ii.hbmColor)
DeleteObject32 (ii.hbmColor);
// FIXME (imagelist, "deleted hbmColor!\n");
if (ii.hbmMask)
DeleteObject32 (ii.hbmMask);
......
......@@ -16,7 +16,6 @@
#include "windows.h"
#include "commctrl.h"
#include "pager.h"
#include "heap.h"
#include "win.h"
#include "debug.h"
......@@ -49,7 +48,7 @@ PAGER_GetBorder (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
return (LRESULT)infoPtr->iBorder;
return (LRESULT)infoPtr->nBorder;
}
......@@ -58,11 +57,21 @@ PAGER_GetButtonSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
return (LRESULT)infoPtr->iButtonSize;
return (LRESULT)infoPtr->nButtonSize;
}
static LRESULT
PAGER_GetButtonState (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
FIXME (pager, "empty stub!\n");
return PGF_INVISIBLE;
}
// << PAGER_GetButtonState >>
// << PAGER_GetDropTarget >>
......@@ -71,16 +80,33 @@ PAGER_GetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
return infoPtr->iPos;
return infoPtr->nPos;
}
static LRESULT
PAGER_RecalcSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
// PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
NMPGCALCSIZE nmpgcs;
FIXME (pager, "empty stub!\n");
if (infoPtr->hwndChild) {
nmpgcs.hdr.hwndFrom = wndPtr->hwndSelf;
nmpgcs.hdr.idFrom = wndPtr->wIDmenu;
nmpgcs.hdr.code = PGN_CALCSIZE;
nmpgcs.dwFlag =
(wndPtr->dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&nmpgcs);
infoPtr->nChildSize =
(wndPtr->dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight;
FIXME (pager, "Child size %d\n", infoPtr->nChildSize);
}
return 0;
}
......@@ -104,9 +130,9 @@ static __inline__ LRESULT
PAGER_SetBorder (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
INT32 nTemp = infoPtr->iBorder;
INT32 nTemp = infoPtr->nBorder;
infoPtr->iBorder = (INT32)lParam;
infoPtr->nBorder = (INT32)lParam;
/* FIXME: redraw */
......@@ -118,9 +144,11 @@ static __inline__ LRESULT
PAGER_SetButtonSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
INT32 nTemp = infoPtr->iButtonSize;
INT32 nTemp = infoPtr->nButtonSize;
infoPtr->nButtonSize = (INT32)lParam;
infoPtr->iButtonSize = (INT32)lParam;
FIXME (pager, "size=%d\n", infoPtr->nButtonSize);
/* FIXME: redraw */
......@@ -133,9 +161,15 @@ PAGER_SetChild (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
infoPtr->hwndChild = (HWND32)lParam;
infoPtr->hwndChild = IsWindow32 ((HWND32)lParam) ? (HWND32)lParam : 0;
FIXME (pager, "hwnd=%x\n", infoPtr->hwndChild);
/* FIXME: redraw */
SetParent32 (infoPtr->hwndChild, wndPtr->hwndSelf);
SetWindowPos32 (infoPtr->hwndChild, wndPtr->hwndSelf,
0, 0, 40, 40, SWP_SHOWWINDOW);
RedrawWindow32 (wndPtr->hwndSelf, NULL, 0, RDW_INVALIDATE);
return 0;
}
......@@ -146,9 +180,13 @@ PAGER_SetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
infoPtr->iPos = (INT32)lParam;
infoPtr->nPos = (INT32)lParam;
FIXME (pager, "pos=%d\n", infoPtr->nPos);
/* FIXME: redraw */
SetWindowPos32 (infoPtr->hwndChild, wndPtr->hwndSelf,
0, 0, 0, 0, SWP_NOSIZE);
return 0;
}
......@@ -160,8 +198,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
PAGER_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (PAGER_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(PAGER_INFO));
infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
......@@ -177,9 +214,9 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* set default settings */
infoPtr->hwndChild = 0;
infoPtr->clrBk = GetSysColor32 (COLOR_BTNFACE);
infoPtr->iBorder = 0;
infoPtr->iButtonSize = 0;
infoPtr->iPos = 0;
infoPtr->nBorder = 0;
infoPtr->nButtonSize = 0;
infoPtr->nPos = 0;
return 0;
......@@ -195,7 +232,7 @@ PAGER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* free pager info data */
HeapFree (GetProcessHeap (), 0, infoPtr);
COMCTL32_Free (infoPtr);
return 0;
}
......@@ -208,9 +245,9 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
RECT32 rect;
GetClientRect32 (wndPtr->hwndSelf, &rect);
FillRect32 ((HDC32)wParam, &rect, hBrush);
DeleteObject32 (hBrush);
// GetClientRect32 (wndPtr->hwndSelf, &rect);
// FillRect32 ((HDC32)wParam, &rect, hBrush);
// DeleteObject32 (hBrush);
return TRUE;
}
......@@ -238,7 +275,9 @@ PAGER_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case PGM_GETBUTTONSIZE:
return PAGER_GetButtonSize (wndPtr, wParam, lParam);
// case PGM_GETBUTTONSTATE:
case PGM_GETBUTTONSTATE:
return PAGER_GetButtonState (wndPtr, wParam, lParam);
// case PGM_GETDROPTARGET:
case PGM_GETPOS:
......
/*
* Tab control
*
* Copyright 1998 Anders Carlsson
*
* TODO:
* Image list support
* Multiline support
* Unicode support
* Updown control support
* Look and feel
* Messages to be added in commctrl.h
* ...
*/
#include "windows.h"
#include "commctrl.h"
#include "tab.h"
#include "heap.h"
#include "win.h"
#include "debug.h"
#define TAB_GetInfoPtr(wndPtr) ((TAB_INFO *)wndPtr->wExtra[0])
static BOOL32
TAB_SendSimpleNotify (WND *wndPtr, UINT32 code)
{
NMHDR nmhdr;
nmhdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.idFrom = wndPtr->wIDmenu;
nmhdr.code = code;
return (BOOL32) SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM32) nmhdr.idFrom, (LPARAM) &nmhdr);
}
static LRESULT
TAB_GetCurSel (WND *wndPtr)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
return infoPtr->iSelected;
}
static LRESULT
TAB_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
POINT32 pt;
RECT32 rect;
INT32 iCount;
pt.x = (INT32)LOWORD(lParam);
pt.y = (INT32)HIWORD(lParam);
GetClientRect32 (wndPtr->hwndSelf, &rect);
if (PtInRect32 (&rect, pt))
{
for (iCount = 0; iCount < infoPtr->uNumItem; iCount++) {
rect = infoPtr->items[iCount].rect;
if (PtInRect32 (&rect, pt)) {
TRACE(tab, "On Tab, item %d\n", iCount);
if (infoPtr->iSelected != iCount) {
infoPtr->iSelected = iCount;
TAB_SendSimpleNotify(wndPtr, TCN_SELCHANGE);
}
return 0;
}
}
}
return 0;
}
static void
TAB_SetItemBounds (WND *wndPtr)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
RECT32 rect;
HFONT32 hFont, hOldFont;
INT32 i, left;
SIZE32 size;
HDC32 hdc;
/* FIXME: Is this needed? */
GetClientRect32 (wndPtr->hwndSelf, &rect);
hdc = GetDC32(wndPtr->hwndSelf);
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject32 (SYSTEM_FONT);
hOldFont = SelectObject32 (hdc, hFont);
left = rect.left;
for (i = 0; i < infoPtr->uNumItem; i++)
{
infoPtr->items[i].rect.left = left;
infoPtr->items[i].rect.top = infoPtr->rect.top;
GetTextExtentPoint32A(hdc,
infoPtr->items[i].pszText,
lstrlen32A(infoPtr->items[i].pszText), &size);
infoPtr->items[i].rect.right = left + size.cx+2*5;
infoPtr->items[i].rect.bottom = infoPtr->rect.top + 20;
TRACE(tab, "TextSize: %i - ", size.cx);
TRACE(tab, "Rect: T %i, L %i, B %i, R %i\n",
infoPtr->items[i].rect.top,
infoPtr->items[i].rect.left,
infoPtr->items[i].rect.bottom,
infoPtr->items[i].rect.right);
left += (size.cx + 11);
}
SelectObject32 (hdc, hOldFont);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
static void
TAB_DrawItem (WND *wndPtr, HDC32 hdc, INT32 iItem)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
TAB_ITEM *pti = &infoPtr->items[iItem];
RECT32 r;
INT32 oldBkMode;
HPEN32 hwPen = CreatePen32 (PS_SOLID, 1, RGB (255, 255, 255 ));
HPEN32 hbPen = CreatePen32 (PS_SOLID, 1, GetSysColor32 (COLOR_BTNSHADOW));
HPEN32 hsdPen = CreatePen32(PS_SOLID, 1, GetSysColor32 (COLOR_BTNTEXT));
HPEN32 htmpPen = (HPEN32)NULL;
CopyRect32(&r, &pti->rect);
htmpPen = hwPen;
htmpPen = SelectObject32 (hdc, htmpPen);
MoveToEx32 (hdc, r.left, r.bottom, NULL);
LineTo32 (hdc, r.left, r.top + 2);
LineTo32 (hdc, r.left +2, r.top);
LineTo32 (hdc, r.right -1, r.top);
htmpPen = SelectObject32 (hdc, htmpPen);
htmpPen = SelectObject32 (hdc, hbPen);
MoveToEx32 (hdc, r.right-1, r.top, NULL);
LineTo32 (hdc,r.right-1, r.bottom-1);
hbPen = SelectObject32 (hdc, hsdPen);
MoveToEx32 (hdc, r.right, r.top+1, NULL);
LineTo32(hdc, r.right,r.bottom);
hsdPen = SelectObject32(hdc,htmpPen);
DeleteObject32(hwPen);
DeleteObject32(hbPen);
DeleteObject32(hsdPen);
oldBkMode = SetBkMode32(hdc, TRANSPARENT);
r.left += 3;
r.right -= 3;
SetTextColor32 (hdc, COLOR_BTNTEXT);
DrawText32A(hdc, pti->pszText, lstrlen32A(pti->pszText),
&r, DT_LEFT|DT_SINGLELINE|DT_VCENTER);
if (oldBkMode != TRANSPARENT)
SetBkMode32(hdc, oldBkMode);
}
static void
TAB_DrawBorder (WND *wndPtr, HDC32 hdc)
{
HPEN32 htmPen;
HPEN32 hwPen = GetStockObject32(WHITE_PEN);
HPEN32 hbPen = GetStockObject32(BLACK_PEN);
HPEN32 hShade = CreatePen32 ( PS_SOLID, 1, GetSysColor32 (COLOR_BTNSHADOW));
RECT32 rect;
htmPen = SelectObject32 (hdc, hwPen);
GetClientRect32 (wndPtr->hwndSelf, &rect);
MoveToEx32 (hdc, rect.left, rect.bottom, NULL);
LineTo32 (hdc, rect.left, rect.top+20);
LineTo32 (hdc, rect.right, rect.top+20);
hwPen = SelectObject32 (hdc, htmPen);
LineTo32 (hdc, rect.right, rect.bottom );
LineTo32 (hdc, rect.left, rect.bottom);
hbPen = SelectObject32 (hdc, hShade );
MoveToEx32 (hdc, rect.right-1, rect.top+20, NULL);
LineTo32 (hdc, rect.right-1, rect.bottom-1);
LineTo32 (hdc, rect.left, rect.bottom-1);
hShade = SelectObject32(hdc, hShade);
DeleteObject32 (hShade);
}
static void
TAB_Refresh (WND *wndPtr, HDC32 hdc)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
HFONT32 hFont, hOldFont;
RECT32 rect;
HBRUSH32 hbrBk;
INT32 i;
TAB_DrawBorder (wndPtr, hdc);
for (i = 0; i < infoPtr->uNumItem; i++) {
TAB_DrawItem (wndPtr, hdc, i);
}
}
static LRESULT
TAB_Paint (WND *wndPtr, WPARAM32 wParam)
{
HDC32 hdc;
PAINTSTRUCT32 ps;
hdc = wParam== 0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
TAB_Refresh (wndPtr, hdc);
if(!wParam)
EndPaint32 (wndPtr->hwndSelf, &ps);
return 0;
}
static LRESULT
TAB_InsertItem (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
TCITEM *pti;
HDC32 hdc;
INT32 iItem, len;
pti = (TCITEM*)lParam;
iItem = (INT32)wParam;
if (iItem < 0) return -1;
if (iItem > infoPtr->uNumItem)
iItem = infoPtr->uNumItem;
if (infoPtr->uNumItem == 0) {
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (TAB_ITEM));
infoPtr->uNumItem++;
}
else {
TAB_ITEM *oldItems = infoPtr->items;
infoPtr->uNumItem++;
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (TAB_ITEM) * infoPtr->uNumItem);
/* pre insert copy */
if (iItem > 0) {
memcpy (&infoPtr->items[0], &oldItems[0],
iItem * sizeof(TAB_ITEM));
}
/* post insert copy */
if (iItem < infoPtr->uNumItem - 1) {
memcpy (&infoPtr->items[iItem+1], &oldItems[iItem],
(infoPtr->uNumItem - iItem) * sizeof(TAB_ITEM));
}
HeapFree (GetProcessHeap (), 0, oldItems);
}
infoPtr->items[iItem].mask = pti->mask;
if (pti->mask & TCIF_TEXT) {
len = lstrlen32A (pti->pszText);
infoPtr->items[iItem].pszText =
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (infoPtr->items[iItem].pszText, pti->pszText);
infoPtr->items[iItem].cchTextMax = pti->cchTextMax;
}
if (pti->mask & TCIF_IMAGE)
infoPtr->items[iItem].iImage = pti->iImage;
if (pti->mask & TCIF_PARAM)
infoPtr->items[iItem].lParam = pti->lParam;
hdc = GetDC32 (wndPtr->hwndSelf);
TAB_Refresh (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
TRACE(tab, "[%04x]: added item %d '%s'\n",
wndPtr->hwndSelf, iItem, infoPtr->items[iItem].pszText);
TAB_SetItemBounds(wndPtr);
return iItem;
}
static LRESULT
TAB_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TAB_INFO *infoPtr;
infoPtr = (TAB_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(TAB_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
infoPtr->uNumItem = 0;
infoPtr->hFont = 0;
infoPtr->items = 0;
infoPtr->hcurArrow = LoadCursor32A (0, IDC_ARROW32A);
infoPtr->iSelected = -1;
TRACE(tab, "Created tab control, hwnd [%04x]\n", wndPtr->hwndSelf);
return 0;
}
static LRESULT
TAB_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
INT32 iItem;
if (infoPtr->items) {
for (iItem = 0; iItem < infoPtr->uNumItem; iItem++) {
if (infoPtr->items[iItem].pszText)
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
}
HeapFree (GetProcessHeap (), 0, infoPtr->items);
}
HeapFree (GetProcessHeap (), 0, infoPtr);
return 0;
}
LRESULT WINAPI
TAB_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case TCM_GETCURSEL:
return TAB_GetCurSel (wndPtr);
case TCM_INSERTITEM:
return TAB_InsertItem (wndPtr, wParam, lParam);
case WM_CREATE:
return TAB_Create (wndPtr, wParam, lParam);
case WM_DESTROY:
return TAB_Destroy (wndPtr, wParam, lParam);
case WM_LBUTTONUP:
return TAB_LButtonUp (wndPtr, wParam, lParam);
case WM_PAINT:
return TAB_Paint (wndPtr, wParam);
default:
if (uMsg >= WM_USER)
ERR (tab, "unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
}
void
TAB_Register (void)
{
WNDCLASS32A wndClass;
if (GlobalFindAtom32A (WC_TABCONTROL32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS;
wndClass.lpfnWndProc = (WNDPROC32)TAB_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(TAB_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
wndClass.hbrBackground = 0;
wndClass.lpszClassName = WC_TABCONTROL32A;
RegisterClass32A (&wndClass);
}
......@@ -26,23 +26,43 @@
static LRESULT
TREEVIEW_GetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
switch ((INT32)wParam) {
case TVSIL_NORMAL:
return (LRESULT)infoPtr->himlNormal;
case TVSIL_STATE:
return (LRESULT)infoPtr->himlState;
}
return (LRESULT)NULL;
}
static LRESULT
TREEVIEW_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
HIMAGELIST himlTemp;
if ((INT32)wParam == TVSIL_NORMAL) {
himlTemp = infoPtr->himlNormal;
infoPtr->himlNormal = (HIMAGELIST)lParam;
}
else if ((INT32)wParam == TVSIL_STATE) {
himlTemp = infoPtr->himlState;
infoPtr->himlState = (HIMAGELIST)lParam;
switch ((INT32)wParam) {
case TVSIL_NORMAL:
himlTemp = infoPtr->himlNormal;
infoPtr->himlNormal = (HIMAGELIST)lParam;
return (LRESULT)himlTemp;
case TVSIL_STATE:
himlTemp = infoPtr->himlState;
infoPtr->himlState = (HIMAGELIST)lParam;
return (LRESULT)himlTemp;
}
else
return 0;
return (LRESULT)himlTemp;
return (LRESULT)NULL;
}
......@@ -116,12 +136,12 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
switch (uMsg)
{
case TVM_INSERTITEMA:
FIXME (treeview, "Unimplemented msg TVM_INSERTITEMA\n");
case TVM_INSERTITEM32A:
FIXME (treeview, "Unimplemented msg TVM_INSERTITEM32A\n");
return 0;
case TVM_INSERTITEMW:
FIXME (treeview, "Unimplemented msg TVM_INSERTITEMW\n");
case TVM_INSERTITEM32W:
FIXME (treeview, "Unimplemented msg TVM_INSERTITEM32W\n");
return 0;
case TVM_DELETEITEM:
......@@ -148,10 +168,8 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
FIXME (treeview, "Unimplemented msg TVM_SETINDENT\n");
return 0;
case TVM_GETIMAGELIST:
FIXME (treeview, "Unimplemented msg TVM_GETIMAGELIST\n");
return 0;
//return TREEVIEW_GetImageList (wndPtr, wParam, lParam);
case TVM_GETIMAGELIST:
return TREEVIEW_GetImageList (wndPtr, wParam, lParam);
case TVM_SETIMAGELIST:
return TREEVIEW_SetImageList (wndPtr, wParam, lParam);
......@@ -164,28 +182,28 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
FIXME (treeview, "Unimplemented msg TVM_SELECTITEM \n");
return 0;
case TVM_GETITEMA:
FIXME (treeview, "Unimplemented msg TVM_GETITEMA\n");
case TVM_GETITEM32A:
FIXME (treeview, "Unimplemented msg TVM_GETITEM32A\n");
return 0;
case TVM_GETITEMW:
FIXME (treeview, "Unimplemented msg TVM_GETITEMW\n");
case TVM_GETITEM32W:
FIXME (treeview, "Unimplemented msg TVM_GETITEM32W\n");
return 0;
case TVM_SETITEMA:
FIXME (treeview, "Unimplemented msg TVM_SETITEMA\n");
case TVM_SETITEM32A:
FIXME (treeview, "Unimplemented msg TVM_SETITEM32A\n");
return 0;
case TVM_SETITEMW:
FIXME (treeview, "Unimplemented msg TVM_SETITEMW\n");
case TVM_SETITEM32W:
FIXME (treeview, "Unimplemented msg TVM_SETITEM32W\n");
return 0;
case TVM_EDITLABELA:
FIXME (treeview, "Unimplemented msg TVM_EDITLABELA \n");
case TVM_EDITLABEL32A:
FIXME (treeview, "Unimplemented msg TVM_EDITLABEL32A\n");
return 0;
case TVM_EDITLABELW:
FIXME (treeview, "Unimplemented msg TVM_EDITLABELW \n");
case TVM_EDITLABEL32W:
FIXME (treeview, "Unimplemented msg TVM_EDITLABEL32W\n");
return 0;
case TVM_GETEDITCONTROL:
......@@ -220,12 +238,12 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
FIXME (treeview, "Unimplemented msg TVM_ENDEDITLABELNOW\n");
return 0;
case TVM_GETISEARCHSTRINGA:
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRINGA\n");
case TVM_GETISEARCHSTRING32A:
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRING32A\n");
return 0;
case TVM_GETISEARCHSTRINGW:
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRINGW\n");
case TVM_GETISEARCHSTRING32W:
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRING32W\n");
return 0;
case TVM_SETTOOLTIPS:
......@@ -261,8 +279,8 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
default:
if (uMsg >= WM_USER)
FIXME (treeview, "Unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
FIXME (treeview, "Unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
return 0;
......
......@@ -17,8 +17,8 @@ C_SRCS = \
shlfolder.c \
shlview.c
RC_SRCS = \
shres.rc
# RC_SRCS = \
# shres.rc
all: check_wrc $(MODULE).o
......
......@@ -6,6 +6,7 @@
#include "windows.h"
#include "winerror.h"
#include "debug.h"
#include "pidl.h"
#include "shlobj.h"
#include "shell32_main.h"
......@@ -22,8 +23,9 @@ static HRESULT WINAPI IContextMenu_QueryInterface(LPCONTEXTMENU ,REFIID , LPVOID
static ULONG WINAPI IContextMenu_AddRef(LPCONTEXTMENU);
static ULONG WINAPI IContextMenu_Release(LPCONTEXTMENU);
static HRESULT WINAPI IContextMenu_QueryContextMenu(LPCONTEXTMENU , HMENU32 ,UINT32 ,UINT32 ,UINT32 ,UINT32);
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU, LPCMINVOKECOMMANDINFO);
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU, LPCMINVOKECOMMANDINFO32);
static HRESULT WINAPI IContextMenu_GetCommandString(LPCONTEXTMENU , UINT32 ,UINT32 ,LPUINT32 ,LPSTR ,UINT32);
static HRESULT WINAPI IContextMenu_HandleMenuMsg(LPCONTEXTMENU, UINT32, WPARAM32, LPARAM);
BOOL32 IContextMenu_AllocPidlTable(LPCONTEXTMENU, DWORD);
void IContextMenu_FreePidlTable(LPCONTEXTMENU);
......@@ -33,10 +35,12 @@ BOOL32 IContextMenu_FillPidlTable(LPCONTEXTMENU, LPCITEMIDLIST *, UINT32);
static struct IContextMenu_VTable cmvt =
{ IContextMenu_QueryInterface,
IContextMenu_AddRef,
IContextMenu_Release,
IContextMenu_Release,
IContextMenu_QueryContextMenu,
IContextMenu_InvokeCommand,
IContextMenu_GetCommandString
IContextMenu_GetCommandString,
IContextMenu_HandleMenuMsg,
(void *) 0xdeadbabe /* just paranoia */
};
/**************************************************************************
* IContextMenu_QueryInterface
......@@ -56,10 +60,11 @@ static HRESULT WINAPI IContextMenu_QueryInterface(LPCONTEXTMENU this,REFIID riid
}
else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/
{ *ppvObj = (LPSHELLEXTINIT)this;
WARN(shell,"-- LPSHELLEXTINIT pointer requested\n");
}
if(*ppvObj)
{ (*(LPCONTEXTMENU*)ppvObj)->lpvtbl->fnAddRef(this);
{ (*(LPCONTEXTMENU *)ppvObj)->lpvtbl->fnAddRef(this);
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
......@@ -78,25 +83,23 @@ static ULONG WINAPI IContextMenu_AddRef(LPCONTEXTMENU this)
* IContextMenu_Release
*/
static ULONG WINAPI IContextMenu_Release(LPCONTEXTMENU this)
{ TRACE(shell,"(%p)->()\n",this);
if (!--(this->ref))
{ TRACE(shell," destroying IContextMenu(%p)\n",this);
{ TRACE(shell,"(%p)->()\n",this);
if (!--(this->ref))
{ TRACE(shell," destroying IContextMenu(%p)\n",this);
if(this->pSFParent)
if(this->pSFParent)
this->pSFParent->lpvtbl->fnRelease(this->pSFParent);
/*make sure the pidl is freed*/
if(this->aPidls)
{ IContextMenu_FreePidlTable(this);
}
/*make sure the pidl is freed*/
if(this->aPidls)
{ IContextMenu_FreePidlTable(this);
}
if(this->pPidlMgr)
PidlMgr_Destructor(this->pPidlMgr);
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/**************************************************************************
......@@ -115,7 +118,6 @@ LPCONTEXTMENU IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *a
cm->pSFParent->lpvtbl->fnAddRef(cm->pSFParent);
cm->aPidls = NULL;
cm->pPidlMgr = PidlMgr_Constructor();
IContextMenu_AllocPidlTable(cm, uItemCount);
......@@ -125,10 +127,10 @@ LPCONTEXTMENU IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *a
cm->bAllValues = 1;
for(u = 0; u < uItemCount; u++)
{ cm->bAllValues &= (cm->pPidlMgr->lpvtbl->fnIsValue(cm->pPidlMgr, aPidls[u]) ? 1 : 0);
{ cm->bAllValues &= (_ILIsValue(aPidls[u]) ? 1 : 0);
}
TRACE(shell,"(%p)->()\n",cm);
return cm;
TRACE(shell,"(%p)->()\n",cm);
return cm;
}
......@@ -210,12 +212,12 @@ static HRESULT WINAPI IContextMenu_QueryContextMenu( LPCONTEXTMENU this, HMENU3
/**************************************************************************
* IContextMenu_InvokeCommand()
*/
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU this, LPCMINVOKECOMMANDINFO lpcmi)
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU this, LPCMINVOKECOMMANDINFO32 lpcmi)
{ LPITEMIDLIST pidlTemp,pidlFQ;
SHELLEXECUTEINFO sei;
SHELLEXECUTEINFO32A sei;
int i;
TRACE(shell,"(%p)->(execinfo=%p)\n",this,lpcmi);
TRACE(shell,"(%p)->(invcom=%p verb=%p)\n",this,lpcmi,lpcmi->lpVerb);
if(HIWORD(lpcmi->lpVerb))
{ //the command is being sent via a verb
......@@ -232,7 +234,7 @@ static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU this, LPCMINVOKEC
should never be invoked if there isn't at least one key item in the list.*/
for(i = 0; this->aPidls[i]; i++)
{ if(!this->pPidlMgr->lpvtbl->fnIsValue(this->pPidlMgr, this->aPidls[i]))
{ if(!_ILIsValue(this->aPidls[i]))
break;
}
......@@ -273,46 +275,56 @@ static HRESULT WINAPI IContextMenu_GetCommandString( LPCONTEXTMENU this, UINT32
UINT32 uFlags,LPUINT32 lpReserved,LPSTR lpszName,UINT32 uMaxNameLen)
{ HRESULT hr = E_INVALIDARG;
TRACE(shell,"(%p)->(idcom=%x flags=%x %p name=%s len=%x)\n",this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
TRACE(shell,"(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
switch(uFlags)
switch(uFlags)
{ case GCS_HELPTEXT:
hr = E_NOTIMPL;
break;
hr = E_NOTIMPL;
break;
case GCS_VERBA:
switch(idCommand)
{ case IDM_RENAME:
strcpy((LPSTR)lpszName, "rename");
hr = NOERROR;
break;
}
break;
/* NT 4.0 with IE 3.0x or no IE will always call this with GCS_VERBW. In this
case, you need to do the lstrcpyW to the pointer passed.*/
switch(idCommand)
{ case IDM_RENAME:
strcpy((LPSTR)lpszName, "rename");
hr = NOERROR;
break;
}
break;
/* NT 4.0 with IE 3.0x or no IE will always call this with GCS_VERBW. In this
case, you need to do the lstrcpyW to the pointer passed.*/
case GCS_VERBW:
switch(idCommand)
{ case IDM_RENAME:
lstrcpyAtoW((LPWSTR)lpszName, "rename");
hr = NOERROR;
break;
}
break;
switch(idCommand)
{ case IDM_RENAME:
lstrcpyAtoW((LPWSTR)lpszName, "rename");
hr = NOERROR;
break;
}
break;
case GCS_VALIDATE:
hr = NOERROR;
break;
hr = NOERROR;
break;
}
TRACE(shell,"-- (%p)->(name=%s)\n",this, lpszName);
return hr;
}
/**************************************************************************
* IContextMenu_HandleMenuMsg()
* NOTES
* should be only in IContextMenu2 and IContextMenu3
* is nevertheless called from word95
*/
static HRESULT WINAPI IContextMenu_HandleMenuMsg(LPCONTEXTMENU this, UINT32 uMsg,WPARAM32 wParam,LPARAM lParam)
{ TRACE(shell,"(%p)->(msg=%x wp=%x lp=%lx)\n",this, uMsg, wParam, lParam);
return E_NOTIMPL;
}
/**************************************************************************
* IContextMenu_AllocPidlTable()
*/
BOOL32 IContextMenu_AllocPidlTable(LPCONTEXTMENU this, DWORD dwEntries)
{ //add one for NULL terminator
TRACE(shell,"(%p)->(entrys=%u)\n",this, dwEntries);
TRACE(shell,"(%p)->(entrys=%lu)\n",this, dwEntries);
dwEntries++;
this->aPidls = (LPITEMIDLIST*)SHAlloc(dwEntries * sizeof(LPITEMIDLIST));
......@@ -327,17 +339,17 @@ BOOL32 IContextMenu_AllocPidlTable(LPCONTEXTMENU this, DWORD dwEntries)
* IContextMenu_FreePidlTable()
*/
void IContextMenu_FreePidlTable(LPCONTEXTMENU this)
{ int i;
{ int i;
TRACE(shell,"(%p)->()\n",this);
if(this->aPidls)
{ for(i = 0; this->aPidls[i]; i++)
{ SHFree(this->aPidls[i]);
}
{ SHFree(this->aPidls[i]);
}
SHFree(this->aPidls);
this->aPidls = NULL;
SHFree(this->aPidls);
this->aPidls = NULL;
}
}
......@@ -366,18 +378,16 @@ BOOL32 IContextMenu_CanRenameItems(LPCONTEXTMENU this)
TRACE(shell,"(%p)->()\n",this);
if(this->aPidls)
{ if(this->pPidlMgr)
{ for(i = 0; this->aPidls[i]; i++){} /*get the number of items assigned to this object*/
if(i > 1) /*you can't rename more than one item at a time*/
{ return FALSE;
}
{ for(i = 0; this->aPidls[i]; i++){} /*get the number of items assigned to this object*/
if(i > 1) /*you can't rename more than one item at a time*/
{ return FALSE;
}
dwAttributes = SFGAO_CANRENAME;
this->pSFParent->lpvtbl->fnGetAttributesOf(this->pSFParent, i,
(LPCITEMIDLIST*)this->aPidls, &dwAttributes);
return dwAttributes & SFGAO_CANRENAME;
}
}
return dwAttributes & SFGAO_CANRENAME;
}
return FALSE;
}
......@@ -35,8 +35,8 @@ static HRESULT WINAPI IExtractIcon_QueryInterface(LPEXTRACTICON, REFIID, LPVOID
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON);
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON);
static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON);
static HRESULT IExtractIcon_GetIconLocation(LPEXTRACTICON, UINT32, LPSTR, UINT32, int *, UINT32 *);
static HRESULT IExtractIcon_Extract(LPEXTRACTICON, LPCSTR, UINT32, HICON32 *, HICON32 *, UINT32);
static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON, UINT32, LPSTR, UINT32, int *, UINT32 *);
static HRESULT WINAPI IExtractIcon_Extract(LPEXTRACTICON, LPCSTR, UINT32, HICON32 *, HICON32 *, UINT32);
/* IShellLink Implementation */
static HRESULT WINAPI IShellLink_QueryInterface(LPSHELLLINK,REFIID,LPVOID*);
......@@ -118,16 +118,22 @@ static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON this)
* NOTE
* FIXME returns allways the icon no. 3 (closed Folder)
*/
static HRESULT IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax, int * piIndex, UINT32 * pwFlags)
static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax, int * piIndex, UINT32 * pwFlags)
{ FIXME (shell,"(%p) (flags=%u file=%s max=%u %p %p) semi-stub\n", this, uFlags, szIconFile, cchMax, piIndex, pwFlags);
*pwFlags = GIL_NOTFILENAME;
*piIndex = 3;
return NOERROR;
if (!szIconFile)
{ *piIndex = 20;
}
else
{ *piIndex = 3;
}
*pwFlags = GIL_NOTFILENAME;
return NOERROR;
}
/**************************************************************************
* IExtractIcon_Extract
*/
static HRESULT IExtractIcon_Extract(LPEXTRACTICON this, LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize)
static HRESULT WINAPI IExtractIcon_Extract(LPEXTRACTICON this, LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize)
{ FIXME (shell,"(%p) (file=%s index=%u %p %p size=%u) semi-stub\n", this, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
*phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
*phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
......
/* INTERNAL CLASS pidlmgr */
/*
* internal pidl functions
* 1998 <juergen.schmied@metronet.de>
*
* DO NOT use this definitions outside the shell32.dll !
*
* The contents of a pidl should never used from a application
* directly.
*
* This stuff is used from SHGetFileAttributes, ShellFolder
* EnumIDList and ShellView.
*/
#ifndef __WINE_PIDL_H
#define __WINE_PIDL_H
#include "shlobj.h"
/*
* the pidl does cache fileattributes to speed up SHGetAttributes when
* displaying a big number of files.
*
* a pidl of NULL means the desktop
*
* The structure of the pidl seens to be a union. The first byte of the
* PIDLDATA desribes the type of pidl.
*
* first byte - my Computer 0x1F
* control/printer 0x2E
* drive 0x23
* folder 0x31
* drive: the second byte is the start of a string
* C : \
* 43 3A 5C
* file: see the PIDLDATA structure
*/
#define PT_DESKTOP 0x0000 /*fixme*/
#define PT_MYCOMP 0x001F
#define PT_SPECIAL 0x002E
#define PT_DRIVE 0x0023
#define PT_FOLDER 0x0031
#define PT_VALUE 0x0033 /*fixme*/
#pragma pack(1)
typedef WORD PIDLTYPE;
typedef struct tagPIDLDATA
{ PIDLTYPE type;
union
{ struct
{ CHAR szDriveName[4];
/* end of MS compatible*/
DWORD dwSFGAO;
} drive;
struct
{ DWORD dwFileSize;
WORD uFileDate;
WORD uFileTime;
WORD uFileAttribs;
/* end of MS compatible*/
DWORD dwSFGAO;
CHAR szAlternateName[14]; /* the 8.3 Name*/
CHAR szText[1]; /* last entry, variable size */
} file, folder, generic;
}u;
}
/* here starts my implementation*/
PIDLDATA, *LPPIDLDATA;
#pragma pack(4)
LPITEMIDLIST WINAPI _ILCreateDesktop();
LPITEMIDLIST WINAPI _ILCreateMyComputer();
LPITEMIDLIST WINAPI _ILCreateDrive(LPCSTR);
LPITEMIDLIST WINAPI _ILCreateFolder(LPCSTR);
LPITEMIDLIST WINAPI _ILCreateValue(LPCSTR);
LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPVOID,UINT16);
BOOL32 WINAPI _ILGetDrive(LPCITEMIDLIST,LPSTR,UINT16);
DWORD WINAPI _ILGetItemText(LPCITEMIDLIST,LPSTR,UINT16);
DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST,LPSTR,DWORD);
DWORD WINAPI _ILGetValueText(LPCITEMIDLIST,LPSTR,DWORD);
DWORD WINAPI _ILGetDataText(LPCITEMIDLIST,LPCITEMIDLIST,LPSTR,DWORD);
DWORD WINAPI _ILGetPidlPath(LPCITEMIDLIST,LPSTR,DWORD);
DWORD WINAPI _ILGetData(PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT16);
BOOL32 WINAPI _ILIsDesktop(LPCITEMIDLIST);
BOOL32 WINAPI _ILIsMyComputer(LPCITEMIDLIST);
BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST);
BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST);
BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST);
extern LPITEMIDLIST PidlMgr_CreateDesktop(LPPIDLMGR);
extern LPITEMIDLIST PidlMgr_CreateMyComputer(LPPIDLMGR);
extern LPITEMIDLIST PidlMgr_CreateDrive(LPPIDLMGR,LPCSTR);
extern LPITEMIDLIST PidlMgr_CreateFolder(LPPIDLMGR,LPCSTR);
extern LPITEMIDLIST PidlMgr_CreateValue(LPPIDLMGR,LPCSTR);
extern BOOL32 PidlMgr_GetDesktop(LPPIDLMGR,LPCITEMIDLIST,LPSTR);
extern BOOL32 PidlMgr_GetDrive(LPPIDLMGR,LPCITEMIDLIST,LPSTR,UINT16);
extern LPITEMIDLIST PidlMgr_GetLastItem(LPPIDLMGR,LPCITEMIDLIST);
extern DWORD PidlMgr_GetItemText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,UINT16);
extern BOOL32 PidlMgr_IsDesktop(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsMyComputer(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsDrive(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsFolder(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsValue(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_HasFolders(LPPIDLMGR,LPSTR,LPCITEMIDLIST);
extern DWORD PidlMgr_GetFolderText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
extern DWORD PidlMgr_GetValueText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
extern BOOL32 PidlMgr_GetValueType(LPPIDLMGR,LPCITEMIDLIST,LPCITEMIDLIST,LPDWORD);
extern DWORD PidlMgr_GetDataText(LPPIDLMGR,LPCITEMIDLIST,LPCITEMIDLIST,LPSTR,DWORD);
extern DWORD PidlMgr_GetPidlPath(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
extern LPITEMIDLIST PidlMgr_Create(LPPIDLMGR,PIDLTYPE,LPVOID,UINT16);
extern DWORD PidlMgr_GetData(LPPIDLMGR,PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT16);
extern LPPIDLDATA PidlMgr_GetDataPointer(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_SeparatePathAndValue(LPPIDLMGR,LPITEMIDLIST,LPITEMIDLIST*,LPITEMIDLIST*);
BOOL32 WINAPI _ILHasFolders(LPSTR,LPCITEMIDLIST);
LPPIDLDATA WINAPI _ILGetDataPointer(LPCITEMIDLIST);
LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
/*
BOOL32 WINAPI _ILGetDesktop(LPCITEMIDLIST,LPSTR);
BOOL32 WINAPI _ILSeparatePathAndValue(LPITEMIDLIST,LPITEMIDLIST*,LPITEMIDLIST*);
BOOL32 WINAPI _ILGetValueType(LPCITEMIDLIST,LPCITEMIDLIST,LPDWORD);
*/
#endif
......@@ -29,29 +29,30 @@
typedef DWORD (* WINAPI GetClassPtr)(REFCLSID,REFIID,LPVOID);
static GetClassPtr SH_find_moduleproc(LPSTR dllname,HMODULE32 *xhmod,LPSTR name)
{ HMODULE32 hmod;
FARPROC32 dllunload,nameproc;
{ HMODULE32 hmod;
FARPROC32 dllunload,nameproc;
TRACE(shell,"dll=%s, hmodule=%p, name=%s\n",dllname, xhmod, name);
if (xhmod)
{ *xhmod = 0;
}
{ *xhmod = 0;
}
if (!strcasecmp(PathFindFilename(dllname),"shell32.dll"))
{ return (GetClassPtr)SHELL32_DllGetClassObject;
}
}
hmod = LoadLibraryEx32A(dllname,0,LOAD_WITH_ALTERED_SEARCH_PATH);
if (!hmod)
{ return NULL;
}
}
dllunload = GetProcAddress32(hmod,"DllCanUnloadNow");
if (!dllunload)
{ if (xhmod)
{ *xhmod = hmod;
}
}
{ *xhmod = hmod;
}
}
nameproc = GetProcAddress32(hmod,name);
if (!nameproc)
{ FreeLibrary32(hmod);
{ FreeLibrary32(hmod);
return NULL;
}
/* register unloadable dll with unloadproc ... */
......@@ -73,21 +74,14 @@ static DWORD SH_get_instance(REFCLSID clsid,LPSTR dllname,LPVOID unknownouter,RE
dllgetclassob = SH_find_moduleproc(dllname,NULL,"DllGetClassObject");
if (!dllgetclassob)
{ return 0x80070000|GetLastError();
}
/* FIXME */
/*
hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,inst);
if (hres<0)
return hres;
}
*/
hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,&classfac);
if (hres<0 || (hres>=0x80000000))
{ return hres;
}
}
if (!classfac)
{ FIXME(shell,"no classfactory, but hres is 0x%ld!\n",hres);
{ FIXME(shell,"no classfactory, but hres is 0x%ld!\n",hres);
return E_FAIL;
}
classfac->lpvtbl->fnCreateInstance(classfac,unknownouter,refiid,inst);
......@@ -111,11 +105,11 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
if (clsid)
{ WINE_StringFromCLSID(clsid,xclsid);
}
}
else
{ if (!aclsid)
{ return 0x80040154;
}
}
strcpy(xclsid,aclsid);
}
TRACE(shell,"(%p,\n\tSID:\t%s,%p,\n\tIID:\t%s,%p)\n",aclsid,xclsid,unknownouter,xiid,inst);
......@@ -124,11 +118,11 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,buffer,0,0x02000000,&inprockey))
{ return SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
}
}
pathlen=sizeof(path);
if (RegQueryValue32A(inprockey,NULL,path,&pathlen))
{ RegCloseKey(inprockey);
{ RegCloseKey(inprockey);
return SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
}
......@@ -136,7 +130,7 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
tmodellen=sizeof(tmodel);
type=REG_SZ;
if (RegQueryValueEx32A(inprockey,"ThreadingModel",NULL,&type,tmodel,&tmodellen))
{ RegCloseKey(inprockey);
{ RegCloseKey(inprockey);
return SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
}
......@@ -144,8 +138,8 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
hres=SH_get_instance(clsid,path,unknownouter,refiid,inst);
if (hres<0)
{ hres=SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
}
{ hres=SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
}
RegCloseKey(inprockey);
return hres;
}
......@@ -178,11 +172,11 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)||
IsEqualCLSID(rclsid, &CLSID_ShellLink))
{ if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)) /*debug*/
{ TRACE(shell,"requested CLSID_ShellDesktop\n");
}
{ TRACE(shell,"-- requested CLSID_ShellDesktop\n");
}
if(IsEqualCLSID(rclsid, &CLSID_ShellLink)) /*debug*/
{ TRACE(shell,"requested CLSID_ShellLink\n");
}
{ TRACE(shell,"-- requested CLSID_ShellLink\n");
}
lpclf = IClassFactory_Constructor();
if(lpclf)
{ hres = lpclf->lpvtbl->fnQueryInterface(lpclf,iid, ppv);
......@@ -190,10 +184,10 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
}
}
else
{ WARN(shell, "clsid(%s) not in buildin SHELL32\n",xclsid);
{ WARN(shell, "-- CLSID not found\n");
hres = CLASS_E_CLASSNOTAVAILABLE;
}
TRACE(shell,"RETURN pointer to interface: %p\n",ppv);
TRACE(shell,"-- return pointer to interface: %p\n",*ppv);
return hres;
}
......@@ -249,26 +243,26 @@ LPCLASSFACTORY IClassFactory_Constructor()
*/
static HRESULT WINAPI IClassFactory_QueryInterface(
LPCLASSFACTORY this, REFIID riid, LPVOID *ppvObj)
{ char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE(shell,"(%p)->(\n\tIID:\t%s)\n",this,xriid);
*ppvObj = NULL;
{ char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE(shell,"(%p)->(\n\tIID:\t%s)\n",this,xriid);
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = this;
}
else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/
{ *ppvObj = (IClassFactory*)this;
}
*ppvObj = NULL;
if(*ppvObj)
{ (*(LPCLASSFACTORY*)ppvObj)->lpvtbl->fnAddRef(this);
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = this;
}
else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/
{ *ppvObj = (IClassFactory*)this;
}
if(*ppvObj)
{ (*(LPCLASSFACTORY*)ppvObj)->lpvtbl->fnAddRef(this);
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE(shell,"-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
return E_NOINTERFACE;
}
/******************************************************************************
* IClassFactory_AddRef
......@@ -294,12 +288,12 @@ static ULONG WINAPI IClassFactory_Release(LPCLASSFACTORY this)
*/
static HRESULT WINAPI IClassFactory_CreateInstance(
LPCLASSFACTORY this, LPUNKNOWN pUnknown, REFIID riid, LPVOID *ppObject)
{ IUnknown *pObj = NULL;
{ IUnknown *pObj = NULL;
HRESULT hres;
char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE(shell,"%p->(%p,\n\tIID:\t%s,%p)\n",this,pUnknown,xriid,ppObject);
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE(shell,"%p->(%p,\n\tIID:\t%s,%p)\n",this,pUnknown,xriid,ppObject);
*ppObject = NULL;
......@@ -308,39 +302,39 @@ static HRESULT WINAPI IClassFactory_CreateInstance(
}
if (IsEqualIID(riid, &IID_IShellFolder))
{ pObj = (IUnknown *)IShellFolder_Constructor(NULL,NULL);
}
else if (IsEqualIID(riid, &IID_IShellView))
{ pObj = (IUnknown *)IShellView_Constructor();
}
else if (IsEqualIID(riid, &IID_IShellLink))
{ pObj = (IUnknown *)IShellLink_Constructor();
}
else if (IsEqualIID(riid, &IID_IExtractIcon))
{ pObj = (IUnknown *)IExtractIcon_Constructor(NULL);
}
else if (IsEqualIID(riid, &IID_IContextMenu))
{ pObj = (IUnknown *)IContextMenu_Constructor(NULL, NULL, 0);
}
else
{ ERR(shell,"unknown IID requested\n\tIID:\t%s\n",xriid);
return(E_NOINTERFACE);
}
{ pObj = (IUnknown *)IShellFolder_Constructor(NULL,NULL);
}
else if (IsEqualIID(riid, &IID_IShellView))
{ pObj = (IUnknown *)IShellView_Constructor();
}
else if (IsEqualIID(riid, &IID_IShellLink))
{ pObj = (IUnknown *)IShellLink_Constructor();
}
else if (IsEqualIID(riid, &IID_IExtractIcon))
{ pObj = (IUnknown *)IExtractIcon_Constructor(NULL);
}
else if (IsEqualIID(riid, &IID_IContextMenu))
{ pObj = (IUnknown *)IContextMenu_Constructor(NULL, NULL, 0);
}
else
{ ERR(shell,"unknown IID requested\n\tIID:\t%s\n",xriid);
return(E_NOINTERFACE);
}
if (!pObj)
{ return(E_OUTOFMEMORY);
}
if (!pObj)
{ return(E_OUTOFMEMORY);
}
hres = pObj->lpvtbl->fnQueryInterface(pObj,riid, ppObject);
pObj->lpvtbl->fnRelease(pObj);
TRACE(shell,"-- Object created: (%p)->%p\n",this,*ppObject);
pObj->lpvtbl->fnRelease(pObj);
TRACE(shell,"-- Object created: (%p)->%p\n",this,*ppObject);
return hres;
return hres;
}
/******************************************************************************
* IClassFactory_LockServer
*/
static HRESULT WINAPI IClassFactory_LockServer(LPCLASSFACTORY this, BOOL32 fLock)
{ TRACE(shell,"%p->(0x%x), not implemented\n",this, fLock);
return E_NOTIMPL;
{ TRACE(shell,"%p->(0x%x), not implemented\n",this, fLock);
return E_NOTIMPL;
}
......@@ -416,8 +416,8 @@ BOOL32 WINAPI PathYetAnotherMakeUniqueName(LPDWORD x,LPDWORD y) {
*
*/
DWORD WINAPI
SHMapPIDLToSystemImageListIndex(DWORD x,DWORD y,DWORD z)
{ FIXME(shell,"(%08lx,%08lx,%08lx):stub.\n",x,y,z);
SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,DWORD y,DWORD z)
{ FIXME(shell,"(folder=%p,%08lx,%08lx):stub.\n",sh,y,z);
return 0;
}
......@@ -452,15 +452,22 @@ StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
* SHCloneSpecialIDList [SHELL32.89]
*
* PARAMETERS
* hwnd
* hwndOwner [in]
* nFolder [in] CSIDL_xxxxx ??
*
* RETURNS
* pidl ??
* NOTES
* exported by ordinal
*/
DWORD WINAPI SHCloneSpecialIDList(HWND32 hwnd,DWORD x2,DWORD x3) {
FIXME(shell,"(hwnd=0x%x,0x%lx,0x%lx):stub.\n",
hwnd,x2,x3
);
return S_OK;
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND32 hwndOwner,DWORD nFolder,DWORD x3)
{ LPITEMIDLIST ppidl;
WARN(shell,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
hwndOwner,nFolder,x3);
SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
return ppidl;
}
/*************************************************************************
......@@ -484,7 +491,7 @@ BOOL32 WINAPI IsLFNDrive(LPCSTR path) {
* exported by ordinal
*/
void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
x1,x2,x3,x4
);
}
......@@ -513,8 +520,8 @@ void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
*/
void __cdecl
ShellMessageBoxA(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
char buf[100],buf2[100],*buf3;
LPVOID args = &arglist;
char buf[100],buf2[100]/*,*buf3*/;
/* LPVOID args = &arglist;*/
if (!LoadString32A(hmod,x,buf,100))
strcpy(buf,"Desktop");
......@@ -584,11 +591,12 @@ LPSTR WINAPI PathGetExtension(LPSTR path,DWORD y,DWORD z)
* SHCreateDirectory [SHELL32.165]
*
* NOTES
* exported by ordinal
* exported by ordinal
* not sure about LPSECURITY_ATTRIBUTES
*/
DWORD WINAPI SHCreateDirectory(DWORD x,LPCSTR path) {
TRACE(shell,"(%08lx,%s):stub.\n",x,path);
if (CreateDirectory32A(path,x))
DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
TRACE(shell,"(%p,%s):stub.\n",sec,path);
if (CreateDirectory32A(path,sec))
return TRUE;
/* SHChangeNotify(8,1,path,0); */
return FALSE;
......@@ -760,7 +768,7 @@ DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)
* exported by name
*/
DWORD WINAPI SHFileOperation32 (
LPSHFILEOPSTRUCT32 lpFileOp)
LPSHFILEOPSTRUCT32A lpFileOp)
{ FIXME (shell,"(%p):stub.\n", lpFileOp);
return 1;
}
......@@ -794,34 +802,100 @@ HRESULT WINAPI SHCreateShellFolderViewEx32(
/*************************************************************************
* SHFind_InitMenuPopup [SHELL32.149]
*
* NOTES
* Registers the menu behind the "Start" button
*
* PARAMETERS
* hMenu [in] handel of menu previously created
* hWndParent [in] parent window
* w [in] no pointer
* x [in] no pointer
*/
HRESULT WINAPI SHFind_InitMenuPopup (HMENU32 hMenu, HWND32 hWndParent, DWORD w, DWORD x)
{ FIXME(shell,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
hMenu,hWndParent,w,x);
return 0;
}
/*************************************************************************
* FileMenu_InitMenuPopup [SHELL32.109]
*
*/
HRESULT WINAPI SHFind_InitMenuPopup (DWORD u, DWORD v, DWORD w, DWORD x)
{ FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x);
return 0;
HRESULT WINAPI FileMenu_InitMenuPopup (DWORD hmenu)
{ FIXME(shell,"hmenu=0x%lx stub\n",hmenu);
return 0;
}
/*************************************************************************
* FileMenu_Create [SHELL32.114]
*
* w retval from LoadBitmapA
*
*
*/
HRESULT WINAPI FileMenu_Create (DWORD u, DWORD v, DWORD w, DWORD x, DWORD z)
{ FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
{ FIXME(shell,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
return 0;
}
/*************************************************************************
* FileMenu_TrackPopupMenuEx [SHELL32.116]
*
* PARAMETERS
* uFlags [in] according to TrackPopupMenuEx
* posX [in]
* posY [in]
* hWndParent [in]
* z could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
*/
HRESULT WINAPI FileMenu_TrackPopupMenuEx (DWORD t, DWORD uFlags, DWORD posX, DWORD posY, HWND32 hWndParent, DWORD z)
{ FIXME(shell,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
t,uFlags,posX,posY, hWndParent,z);
return 0;
}
/*************************************************************************
* SHWinHelp [SHELL32.127]
*
*/
HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
{ FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
return 0;
}
/*************************************************************************
* SHRunConrolPanel [SHELL32.161]
*
*/
HRESULT WINAPI SHRunConrolPanel (DWORD x, DWORD z)
{ FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z);
return 0;
}
/*************************************************************************
* ShellExecuteEx [SHELL32.291]
*
*/
BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFOA u)
{ FIXME(shell,"%p stub\n",u);
return 0;
BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei)
{ CHAR szTemp[MAX_PATH];
FIXME(shell,"%p stub\n",sei);
if (sei->fMask & SEE_MASK_IDLIST)
{ SHGetPathFromIDList32A (sei->lpIDList,szTemp);
TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, szTemp);
}
if (sei->fMask & SEE_MASK_CLASSNAME)
{ TRACE (shell,"-- classname= %s\n", sei->lpClass);
}
if (sei->lpVerb)
{ TRACE (shell,"-- action=%s\n", sei->lpVerb);
}
return 0;
}
/*************************************************************************
* SHSetInstanceExplorer [SHELL32.176]
*
*/
HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
}
/*************************************************************************
* SHGetInstanceExplorer [SHELL32.256]
......@@ -830,8 +904,8 @@ HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
* exported by name
*/
HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
}
/*************************************************************************
* SHFreeUnusedLibraries [SHELL32.123]
......@@ -840,6 +914,43 @@ HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
* exported by name
*/
HRESULT WINAPI SHFreeUnusedLibraries (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
}
/*************************************************************************
* DAD_ShowDragImage [SHELL32.137]
*
* NOTES
* exported by name
*/
HRESULT WINAPI DAD_ShowDragImage (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
}
/*************************************************************************
* FileMenu_Destroy [SHELL32.118]
*
* NOTES
* exported by name
*/
HRESULT WINAPI FileMenu_Destroy (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
}
/*************************************************************************
* SHGetDataFromIDListA [SHELL32.247]
*
*/
HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
{ FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x,y);
return 0;
}
/*************************************************************************
* SHFileOperationA [SHELL32.243]
*
*/
HRESULT WINAPI SHFileOperationA(DWORD x)
{ FIXME(shell,"0x%08lx stub\n",x);
return 0;
}
......@@ -29,19 +29,29 @@
-----------
This paragraph describes the development status of the common controls.
3.1 Animation Control
---------------------
Author:
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
Status:
- Nothing done at all.
- Dummy control. No functionality.
Notes:
Author needed!! Any volunteers??
3.2 Combo Box Ex Control
------------------------
Author:
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
Status:
- Nothing done at all.
- Dummy control. No functionality.
Notes:
Author needed!! Any volunteers??
3.3 Date and Time Picker Control
......@@ -49,18 +59,27 @@
Status:
- Nothing done at all.
Notes:
Author needed!! Any volunteers??
3.4 Drag List Box Control
-------------------------
Status:
- Nothing done at all.
Notes:
Author needed!! Any volunteers??
3.5 Flat Scroll Bar Control
---------------------------
Status:
- Nothing done at all.
Notes:
Author needed!! Any volunteers??
3.6 Header Control
------------------
......@@ -73,8 +92,14 @@
3.7 Hot Key Control
-------------------
Author:
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
Status:
- Nothing done at all.
Dummy control. No functionality.
Notes:
Author needed!! Any volunteers??
3.8 Image List (no control)
......@@ -96,21 +121,30 @@
Status:
- Nothing done at all.
Notes:
Author needed!! Any volunteers??
3.10 List View Control
----------------------
Author:
James Michael Mastros <root@jennifer-unix.dyn.ml.org>
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
Notes:
Author needed!! Any volunteers??
3.11 Month Calendar Control
---------------------------
Status:
- Nothing done at all.
Notes:
Author needed!! Any volunteers??
3.12 Pager Control
------------------
......@@ -217,13 +251,11 @@
3.20 Trackbar Control
---------------------
Author:
Dummy written by Eric Kohl.
Dummy written by Eric Kohl <ekohl@abo.rhein-zeitung.de>
Alex Priem (alexp@sci.kun.nl)
Status:
- Dummy control. No functionality.
Notes:
Author needed!! Any volunteers??
Under construction.
3.21 Tree View Control
......@@ -233,7 +265,7 @@
Alex Priem (alexp@sci.kun.nl)
Status:
- Dummy control. No functionality.
Under contstruction.
3.22 Updown Control
......@@ -266,16 +298,16 @@
------------------------
There are quite a lot of undocumented functions like:
- DSA (Dynnamic Structure Array) functions.
- DPA (Dymnamic Pointer Array?) functions.
- DSA (Dynnamic Storage Array) functions.
- DPA (Dymnamic Pointer Array) functions.
- MRU ("Most Recently Used" List) functions.
- other unknown functions.
Have a look at relay32/comctl32.spec.
5.1 Dymnamic Structure Arrays (DSA)
------------------------------------
5.1 Dymnamic Storage Arrays (DSA)
---------------------------------
Most of the DSA functions are implemented. I used TASKMAN.EXE to write them.
Since TASKMAN.EXE doesn't bail out or crash I think I've done it right.
......
......@@ -14,13 +14,18 @@ The macros are defined in file.h as follows.:
(((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
((handle)>0x400) ? handle : \
(handle)-5)
#define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
((handle>0x400) ? handle : \
(HFILE16)hnd+5); })
WARNING: be careful not to use the macro HFILE16_TO_HFILE32 on
functions with side-effects, as it will cause them to be evaluated
several times. This could be considered a bug, but the use of this
macro is limited enough not to need a rewrite.
NOTE: The 0x400 special case above deals with LZW filehandles (see
misc/lzexpand.c).
......@@ -27,6 +27,12 @@ implemented the classes and filled function stubs.
----------------
Status:
- development started
Undocumented:
word95 gets a IContextMenu Interface and calls HandleMenuMsg()
whitch should only a member of IContextMenu2.
I suppose IContextMenu and IContextMenu2/3 are using the same vtable
and are in effect the same.
4.2 IShellExtInit
-----------------
......@@ -60,12 +66,20 @@ implemented the classes and filled function stubs.
4.7. PIDL Manager
-----------------
Status:
- roughly complete will be migrated to a set of functions because it's
- roughly complete will be migrated to a set of functions because it's
not holding any instance data,
Undocumented:
MS says: the abID of SHITEMID should be treated as binary data and not
be interpreted by applications. Applys to everyone but MS itself.
Word95 interprets the contents of abID (Filesize/Date) so we have to go
for binary compatibility here.
I expect the file open/close dialog in comctl32 does so also.
5. Structures
-------------
5.1 PIDL
--------
......@@ -320,6 +320,10 @@ static DOS_DIR *DOSFS_OpenDir( LPCSTR path )
return NULL;
}
/* Treat empty path as root directory. This simplifies path split into
directory and mask in several other places */
if (!*path) path = "/";
#ifdef VFAT_IOCTL_READDIR_BOTH
/* Check if the VFAT ioctl is supported on this directory */
......@@ -609,7 +613,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
FILE_OBJECT *file;
HFILE32 handle;
if (!name) return NULL; /* if FILE_DupUnixHandle was used */
if (!name) return (HFILE32)NULL; /* if FILE_DupUnixHandle was used */
if (name[0] && (name[1] == ':')) name += 2;
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;
......@@ -624,18 +628,24 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
if (!strcmp(DOSFS_Devices[i].name,"NUL"))
return FILE_OpenUnixFile("/dev/null",unixmode);
if (!strcmp(DOSFS_Devices[i].name,"CON")) {
HFILE32 to_dup;
HFILE32 handle;
switch (unixmode) {
case O_RDONLY:
return GetStdHandle( STD_INPUT_HANDLE );
to_dup = GetStdHandle( STD_INPUT_HANDLE );
break;
case O_WRONLY:
return GetStdHandle( STD_OUTPUT_HANDLE );
to_dup = GetStdHandle( STD_OUTPUT_HANDLE );
break;
default:
FIXME(dosfs,"can't open CON read/write\n");
return HFILE_ERROR32;
break;
}
if (!DuplicateHandle( GetCurrentProcess(), to_dup, GetCurrentProcess(),
&handle, 0, FALSE, DUPLICATE_SAME_ACCESS ))
handle = HFILE_ERROR32;
return handle;
}
if (!strcmp(DOSFS_Devices[i].name,"SCSIMGR$")) {
if ((handle = FILE_Alloc( &file )) == INVALID_HANDLE_VALUE32)
......@@ -1166,19 +1176,19 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
/* Skip to desired position */
while (info.cur_pos < skip)
if (DOSFS_ReadDir( info.dir, &long_name, &short_name ))
if (info.dir && DOSFS_ReadDir( info.dir, &long_name, &short_name ))
info.cur_pos++;
else
break;
if (info.cur_pos == skip && DOSFS_FindNextEx( &info, entry ))
if (info.dir && info.cur_pos == skip && DOSFS_FindNextEx( &info, entry ))
count = info.cur_pos - skip;
else
count = 0;
if (!count)
{
DOSFS_CloseDir( info.dir );
if (info.dir) DOSFS_CloseDir( info.dir );
memset( &info, '\0', sizeof(info) );
}
......
......@@ -784,7 +784,7 @@ UINT32 WINAPI GetDriveType32A( LPCSTR root )
case TYPE_HD: return DRIVE_FIXED;
case TYPE_CDROM: return DRIVE_CDROM;
case TYPE_NETWORK: return DRIVE_REMOTE;
case TYPE_INVALID:
case TYPE_INVALID: return DRIVE_DOESNOTEXIST;
default: return DRIVE_CANNOTDETERMINE;
}
}
......@@ -1040,3 +1040,8 @@ BOOL32 WINAPI GetVolumeInformation32W( LPCWSTR root, LPWSTR label,
HeapFree( GetProcessHeap(), 0, xfsname );
return ret;
}
BOOL32 WINAPI SetVolumeLabel32A(LPCSTR rootpath,LPCSTR volname) {
FIXME(dosfs,"(%s,%s),stub!\n",rootpath,volname);
return TRUE;
}
......@@ -87,6 +87,7 @@ HFILE32 FILE_Alloc( FILE_OBJECT **file )
(*file)->unix_handle = -1;
(*file)->unix_name = NULL;
(*file)->type = FILE_TYPE_DISK;
(*file)->pos = 0;
handle = HANDLE_Alloc( PROCESS_Current(), &(*file)->header,
FILE_ALL_ACCESS | GENERIC_READ |
......@@ -112,7 +113,8 @@ static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars,
return TRUE;
}
if ((result = read(file->unix_handle, lpBuffer, nNumberOfChars)) == -1)
if ( (file->pos < 0) || /* workaround, see SetFilePointer */
((result = read(file->unix_handle, lpBuffer, nNumberOfChars)) == -1) )
{
FILE_SetDosError();
return FALSE;
......@@ -144,6 +146,11 @@ static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars,
* win32 doesn't have interrupted system calls
*/
if (file->pos < 0) { /* workaround, see SetFilePointer */
FILE_SetDosError();
return FALSE;
}
for (;;)
{
result = write(file->unix_handle, lpBuffer, nNumberOfChars);
......@@ -871,6 +878,7 @@ error: /* We get here if there was an error opening the file */
*/
HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode )
{
TRACE(file,"OpenFile16(%s,%i)\n", name, mode);
return HFILE32_TO_HFILE16(FILE_DoOpenFile( name, ofs, mode, FALSE ));
}
......@@ -999,7 +1007,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
DWORD method )
{
FILE_OBJECT *file;
int origin, result;
DWORD result = 0xffffffff;
if (highword && *highword)
{
......@@ -1008,28 +1016,56 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
return 0xffffffff;
}
TRACE(file, "handle %d offset %ld origin %ld\n",
hFile, distance, method );
hFile, distance, method );
if (!(file = FILE_GetFile( hFile ))) return 0xffffffff;
/* the pointer may be positioned before the start of the file;
no error is returned in that case,
but subsequent attempts at I/O will produce errors.
This is not allowed with Unix lseek(),
so we'll need some emulation here */
switch(method)
{
case FILE_CURRENT: origin = SEEK_CUR; break;
case FILE_END: origin = SEEK_END; break;
default: origin = SEEK_SET; break;
case FILE_CURRENT:
distance += file->pos; /* fall through */
case FILE_BEGIN:
if ((result = lseek(file->unix_handle, distance, SEEK_SET)) == -1)
{
if ((INT32)distance < 0)
file->pos = result = distance;
}
else
file->pos = result;
break;
case FILE_END:
if ((result = lseek(file->unix_handle, distance, SEEK_END)) == -1)
{
if ((INT32)distance < 0)
{
/* get EOF */
result = lseek(file->unix_handle, 0, SEEK_END);
/* return to the old pos, as the first lseek failed */
lseek(file->unix_handle, file->pos, SEEK_END);
file->pos = (result += distance);
}
else
ERR(file, "lseek: unknown error. Please report.\n");
}
else file->pos = result;
break;
default:
ERR(file, "Unknown origin %ld !\n", method);
}
if ((result = lseek( file->unix_handle, distance, origin )) == -1)
{
/* care for this pathological case:
SetFilePointer(00000006,ffffffff,00000000,00000002)
ret=0062ab4a fs=01c7 */
if ((distance != -1))
if (result == -1)
FILE_SetDosError();
else
result = 0;
}
FILE_ReleaseFile( file );
return (DWORD)result;
return result;
}
......@@ -1665,7 +1701,7 @@ BOOL32 WINAPI CopyFile32W( LPCWSTR source, LPCWSTR dest, BOOL32 fail_if_exists)
/***********************************************************************
* SetFileTime (KERNEL32.493)
* SetFileTime (KERNEL32.650)
*/
BOOL32 WINAPI SetFileTime( HFILE32 hFile,
const FILETIME *lpCreationTime,
......@@ -1676,7 +1712,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile,
struct utimbuf utimbuf;
if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */
TRACE(file,"(%s,%p,%p,%p)\n",
TRACE(file,"('%s',%p,%p,%p)\n",
file->unix_name,
lpCreationTime,
lpLastAccessTime,
......@@ -1692,6 +1728,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile,
utimbuf.modtime = 0; /* FIXME */
if (-1==utime(file->unix_name,&utimbuf))
{
MSG("Couldn't set the time for file '%s'. Insufficient permissions !?\n", file->unix_name);
FILE_ReleaseFile( file );
FILE_SetDosError();
return FALSE;
......
......@@ -952,6 +952,19 @@ INT32 WINAPI GetProfileSection32A( LPCSTR section, LPSTR buffer, DWORD len )
/***********************************************************************
* GetProfileSection32W (KERNEL32)
*/
INT32 WINAPI GetProfileSection32W( LPCWSTR section, LPWSTR buffer, DWORD len )
{
if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini" );
return GetPrivateProfileSection32W( section, buffer, len, wininiW );
}
/***********************************************************************
* WriteProfileString16 (KERNEL.59)
*/
BOOL16 WINAPI WriteProfileString16( LPCSTR section, LPCSTR entry,
......@@ -1090,6 +1103,25 @@ INT32 WINAPI GetPrivateProfileSection32A( LPCSTR section, LPSTR buffer,
}
/***********************************************************************
* GetPrivateProfileSection32W (KERNEL32.256)
*/
INT32 WINAPI GetPrivateProfileSection32W (LPCWSTR section, LPWSTR buffer,
DWORD len, LPCWSTR filename )
{
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, len );
INT32 ret = GetPrivateProfileSection32A( sectionA, bufferA, len,
filenameA );
HeapFree( GetProcessHeap(), 0, sectionA );
HeapFree( GetProcessHeap(), 0, filenameA );
HeapFree( GetProcessHeap(), 0, bufferA);
return ret;
}
/***********************************************************************
* WritePrivateProfileString16 (KERNEL.129)
*/
BOOL16 WINAPI WritePrivateProfileString16( LPCSTR section, LPCSTR entry,
......@@ -1136,7 +1168,7 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
{
char *p =(char*)string;
FIXME(profile, "WritePrivateProfileSection32A empty stup\n");
FIXME(profile, "WritePrivateProfileSection32A empty stub\n");
if (TRACE_ON(profile)) {
TRACE(profile, "(%s) => [%s]\n", filename, section);
while (*(p+1)) {
......@@ -1150,6 +1182,43 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
}
/***********************************************************************
* WritePrivateProfileSection32W (KERNEL32)
*/
BOOL32 WINAPI WritePrivateProfileSection32W( LPCWSTR section,
LPCWSTR string, LPCWSTR filename)
{
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
LPSTR stringA = HEAP_strdupWtoA( GetProcessHeap(), 0, string );
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
BOOL32 res = WritePrivateProfileSection32A( sectionA, stringA, filenameA );
HeapFree( GetProcessHeap(), 0, sectionA );
HeapFree( GetProcessHeap(), 0, stringA );
HeapFree( GetProcessHeap(), 0, filenameA );
return res;
}
/***********************************************************************
* WriteProfileSection32A (KERNEL32.747)
*/
BOOL32 WINAPI WriteProfileSection32A( LPCSTR section, LPCSTR keys_n_values)
{
return WritePrivateProfileSection32A( section, keys_n_values, "win.ini");
}
/***********************************************************************
* WriteProfileSection32W (KERNEL32.748)
*/
BOOL32 WINAPI WriteProfileSection32W( LPCWSTR section, LPCWSTR keys_n_values)
{
if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");
return (WritePrivateProfileSection32W (section,keys_n_values, wininiW));
}
/***********************************************************************
* GetPrivateProfileSectionNames16 (KERNEL.143)
*/
WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size,
......@@ -1182,6 +1251,45 @@ WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size,
}
/***********************************************************************
* GetProfileSectionNames16 (KERNEL.142)
*/
WORD WINAPI GetProfileSectionNames16( LPSTR buffer, WORD size)
{
return (GetPrivateProfileSectionNames16 (buffer,size,"win.ini"));
}
/***********************************************************************
* GetPrivateProfileSectionNames32A (KERNEL32.365)
*/
DWORD WINAPI GetPrivateProfileSectionNames32A( LPSTR buffer, DWORD size,
LPCSTR filename)
{
return (GetPrivateProfileSectionNames16 (buffer,size,filename));
}
/***********************************************************************
* GetPrivateProfileSectionNames32W (KERNEL32.366)
*/
DWORD WINAPI GetPrivateProfileSectionNames32W( LPWSTR buffer, DWORD size,
LPCWSTR filename)
{
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, size);
INT32 ret = GetPrivateProfileSectionNames16 (bufferA, size, filenameA);
lstrcpynAtoW( buffer, bufferA, size);
HeapFree( GetProcessHeap(), 0, bufferA);
HeapFree( GetProcessHeap(), 0, filenameA );
return ret;
}
/***********************************************************************
* GetPrivateProfileStruct32A (KERNEL32.370)
......@@ -1200,6 +1308,30 @@ BOOL32 WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key,
return FALSE;
}
/***********************************************************************
* GetPrivateProfileStruct32W (KERNEL32.543)
*/
BOOL32 WINAPI GetPrivateProfileStruct32W (LPCWSTR section, LPCWSTR key,
LPVOID buffer, UINT32 len, LPCWSTR filename)
{
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
LPSTR keyA = HEAP_strdupWtoA( GetProcessHeap(), 0, key);
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, len );
INT32 ret = GetPrivateProfileStruct32A( sectionA, keyA, bufferA,
len, filenameA );
lstrcpynAtoW( buffer, bufferA, len );
HeapFree( GetProcessHeap(), 0, bufferA);
HeapFree( GetProcessHeap(), 0, sectionA );
HeapFree( GetProcessHeap(), 0, keyA );
HeapFree( GetProcessHeap(), 0, filenameA );
return ret;
}
/***********************************************************************
* WritePrivateProfileStruct32A (KERNEL32.744)
......@@ -1216,6 +1348,24 @@ BOOL32 WINAPI WritePrivateProfileStruct32A (LPCSTR section, LPCSTR key,
return PROFILE_SetString( section, key, buf);
}
/***********************************************************************
* WritePrivateProfileStruct32W (KERNEL32.544)
*/
BOOL32 WINAPI WritePrivateProfileStruct32W (LPCWSTR section, LPCWSTR key,
LPVOID buf, UINT32 bufsize, LPCWSTR filename)
{
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
LPSTR keyA = HEAP_strdupWtoA( GetProcessHeap(), 0, key);
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
INT32 ret = WritePrivateProfileStruct32A( sectionA, keyA, buf, bufsize,
filenameA );
HeapFree( GetProcessHeap(), 0, sectionA );
HeapFree( GetProcessHeap(), 0, keyA );
HeapFree( GetProcessHeap(), 0, filenameA );
return ret;
}
/***********************************************************************
* WriteOutProfiles (KERNEL.315)
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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