Import and merge Wine-20041201

svn path=/trunk/; revision=12599
This commit is contained in:
Gé van Geldorp
2004-12-31 16:00:23 +00:00
parent 0004a79f81
commit 038eebbf4e
83 changed files with 52005 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
EXTRADEFS = -D_SHELL32_ -DCOM_NO_WINDOWS_H
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shell32.dll
IMPORTS = shlwapi comctl32 user32 gdi32 advapi32 kernel32
DELAYIMPORTS = ole32
EXTRALIBS = -luuid $(LIBUNICODE)
C_SRCS = \
authors.c \
autocomplete.c \
brsfolder.c \
changenotify.c \
classes.c \
clipboard.c \
control.c \
cpanelfolder.c \
dataobject.c \
debughlp.c \
dialogs.c \
dragdrophelper.c \
enumidlist.c \
folders.c \
iconcache.c \
memorystream.c \
pidl.c \
regsvr.c \
shell32_main.c \
shelllink.c \
shellole.c \
shellord.c \
shellpath.c \
shellreg.c \
shellstring.c \
shfldr_desktop.c \
shfldr_fs.c \
shfldr_mycomp.c \
shlexec.c \
shlfileop.c \
shlfolder.c \
shlfsbind.c \
shlmenu.c \
shlview.c \
shpolicy.c \
shv_bg_cmenu.c \
shv_item_cmenu.c \
ros-systray.c
RC_SRCS = shres.rc
RC_BINSRC = shres.rc
RC_BINARIES = \
cdrom.ico \
desktop.ico \
document.ico \
drive.ico \
floppy.ico \
folder.ico \
folder_open.ico \
mycomputer.ico \
netdrive.ico \
netdrive2.ico \
ramdisk.ico
C_SRCS16 = shell.c
RC_SRCS16 = version16.rc
SPEC_SRCS16 = shell.spec
SUBDIRS = tests
@MAKE_DLL_RULES@
# Special rules for 16-bit resource files
version16.res: version16.rc
$(LDPATH) $(RC16) $(RC16FLAGS) -fo$@ $(SRCDIR)/version16.rc
shell.spec.c: shell.spec version16.res
$(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --main-module $(MODULE) --res version16.res --dll $(SRCDIR)/shell.spec
authors.c: $(TOPSRCDIR)/AUTHORS
(LC_ALL=C; export LC_ALL; echo 'const char * const SHELL_Authors[] = {' && \
sed -e '1,2d' -e 's/\(.*\)/ \"\1\",/' $(TOPSRCDIR)/AUTHORS && \
echo ' 0 };') >$@ || ($(RM) $@ && false)
depend: authors.c
clean::
$(RM) authors.c
### Dependencies:

View File

@@ -0,0 +1,30 @@
# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $
TARGET_NAME = shell32
TARGET_OBJECTS = @C_SRCS@
TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__
TARGET_SDKLIBS = wine.a @IMPORTS@ ole32.a wine_uuid.a ntdll.a
TARGET_BASE = $(TARGET_BASE_LIB_SHELL32)
TARGET_RC_SRCS = @RC_SRCS@
TARGET_RC_BINSRC = @RC_BINSRC@
TARGET_RC_BINARIES = @RC_BINARIES@
TARGET_CLEAN = authors.c
default: all
authors.c:
ifeq ($(HOST),mingw32-linux)
echo 'const char * const SHELL_Authors[] = { "Copyright 1993-2004 WINE team", "Copyright 1998-2004 ReactOS team", 0 };' > authors.c
else
echo const char * const SHELL_Authors[] = { "Copyright 1993-2004 WINE team", "Copyright 1998-2004 ReactOS team", 0 }; > authors.c
endif
DEP_OBJECTS = $(TARGET_OBJECTS)
include $(TOOLS_PATH)/depend.mk

View File

@@ -0,0 +1,646 @@
/*
* AutoComplete interfaces implementation.
*
* Copyright 2004 Maxime Bellengé <maxime.bellenge@laposte.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
Implemented:
- ACO_AUTOAPPEND style
- ACO_AUTOSUGGEST style
- ACO_UPDOWNKEYDROPSLIST style
- Handle pwzsRegKeyPath and pwszQuickComplete in Init
TODO:
- implement ACO_SEARCH style
- implement ACO_FILTERPREFIXES style
- implement ACO_USETAB style
- implement ACO_RTLREADING style
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "undocshell.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "pidl.h"
#include "shlguid.h"
#include "shlobj.h"
#include "shldisp.h"
#include "debughlp.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct
{
IAutoCompleteVtbl *lpVtbl;
IAutoComplete2Vtbl *lpvtblAutoComplete2;
DWORD ref;
BOOL enabled;
HWND hwndEdit;
HWND hwndListBox;
WNDPROC wpOrigEditProc;
WNDPROC wpOrigLBoxProc;
WCHAR *txtbackup;
WCHAR *quickComplete;
IEnumString *enumstr;
AUTOCOMPLETEOPTIONS options;
} IAutoCompleteImpl;
static struct IAutoCompleteVtbl acvt;
static struct IAutoComplete2Vtbl ac2vt;
#define _IAutoComplete2_Offset ((int)(&(((IAutoCompleteImpl*)0)->lpvtblAutoComplete2)))
#define _ICOM_THIS_From_IAutoComplete2(class, name) class* This = (class*)(((char*)name)-_IAutoComplete2_Offset);
/*
converts This to a interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpvtblAutoComplete2)
static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
/**************************************************************************
* IAutoComplete_Constructor
*/
HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
IAutoCompleteImpl *lpac;
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
lpac = (IAutoCompleteImpl*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
if (!lpac)
return E_OUTOFMEMORY;
lpac->ref = 1;
lpac->lpVtbl = &acvt;
lpac->lpvtblAutoComplete2 = &ac2vt;
lpac->enabled = TRUE;
lpac->enumstr = NULL;
lpac->options = ACO_AUTOAPPEND;
lpac->wpOrigEditProc = NULL;
lpac->hwndListBox = NULL;
lpac->txtbackup = NULL;
lpac->quickComplete = NULL;
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (lpac), riid, ppv))) {
IUnknown_Release (_IUnknown_ (lpac));
return E_NOINTERFACE;
}
TRACE("-- (%p)->\n",lpac);
return S_OK;
}
/**************************************************************************
* AutoComplete_QueryInterface
*/
static HRESULT WINAPI IAutoComplete_fnQueryInterface(
IAutoComplete * iface,
REFIID riid,
LPVOID *ppvObj)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n", This, shdebugstr_guid(riid), ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown))
{
*ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IAutoComplete))
{
*ppvObj = (IAutoComplete*)This;
}
else if(IsEqualIID(riid, &IID_IAutoComplete2))
{
*ppvObj = _IAutoComplete2_ (This);
}
if (*ppvObj)
{
IAutoComplete_AddRef((IAutoComplete*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/******************************************************************************
* IAutoComplete_fnAddRef
*/
static ULONG WINAPI IAutoComplete_fnAddRef(
IAutoComplete * iface)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface;
TRACE("(%p)->(%lu)\n",This,This->ref);
return ++(This->ref);
}
/******************************************************************************
* IAutoComplete_fnRelease
*/
static ULONG WINAPI IAutoComplete_fnRelease(
IAutoComplete * iface)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface;
TRACE("(%p)->(%lu)\n",This,This->ref);
if (!--(This->ref)) {
TRACE(" destroying IAutoComplete(%p)\n",This);
if (This->quickComplete)
HeapFree(GetProcessHeap(), 0, This->quickComplete);
if (This->txtbackup)
HeapFree(GetProcessHeap(), 0, This->txtbackup);
if (This->hwndListBox)
DestroyWindow(This->hwndListBox);
if (This->enumstr)
IEnumString_Release(This->enumstr);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
return This->ref;
}
/******************************************************************************
* IAutoComplete_fnEnable
*/
static HRESULT WINAPI IAutoComplete_fnEnable(
IAutoComplete * iface,
BOOL fEnable)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface;
HRESULT hr = S_OK;
TRACE("(%p)->(%s)\n", This, (fEnable)?"true":"false");
This->enabled = fEnable;
return hr;
}
/******************************************************************************
* IAutoComplete_fnInit
*/
static HRESULT WINAPI IAutoComplete_fnInit(
IAutoComplete * iface,
HWND hwndEdit,
IUnknown *punkACL,
LPCOLESTR pwzsRegKeyPath,
LPCOLESTR pwszQuickComplete)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface;
static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0};
TRACE("(%p)->(0x%08lx, %p, %s, %s)\n",
This, (long)hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete));
if (This->options & ACO_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n");
if (This->options & ACO_AUTOAPPEND) TRACE(" ACO_AUTOAPPEND\n");
if (This->options & ACO_SEARCH) FIXME(" ACO_SEARCH not supported\n");
if (This->options & ACO_FILTERPREFIXES) FIXME(" ACO_FILTERPREFIXES not supported\n");
if (This->options & ACO_USETAB) FIXME(" ACO_USETAB not supported\n");
if (This->options & ACO_UPDOWNKEYDROPSLIST) TRACE(" ACO_UPDOWNKEYDROPSLIST\n");
if (This->options & ACO_RTLREADING) FIXME(" ACO_RTLREADING not supported\n");
This->hwndEdit = hwndEdit;
if (!SUCCEEDED (IUnknown_QueryInterface (punkACL, &IID_IEnumString, (LPVOID*)&This->enumstr))) {
TRACE("No IEnumString interface\n");
return E_NOINTERFACE;
}
This->wpOrigEditProc = (WNDPROC) SetWindowLongPtrW( hwndEdit, GWLP_WNDPROC, (LONG_PTR) ACEditSubclassProc);
SetWindowLongPtrW( hwndEdit, GWLP_USERDATA, (LONG_PTR)This);
if (This->options & ACO_AUTOSUGGEST) {
HWND hwndParent;
hwndParent = GetParent(This->hwndEdit);
/* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */
This->hwndListBox = CreateWindowExW(0, lbName, NULL,
WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
hwndParent, NULL,
(HINSTANCE)GetWindowLongPtrW( hwndParent, GWLP_HINSTANCE ), NULL);
if (This->hwndListBox) {
This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc);
SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This);
}
}
if (pwzsRegKeyPath) {
WCHAR *key;
WCHAR result[MAX_PATH];
WCHAR *value;
HKEY hKey = 0;
LONG res;
LONG len;
/* pwszRegKeyPath contains the key as well as the value, so we split */
key = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
strcpyW(key, pwzsRegKeyPath);
value = strrchrW(key, '\\');
*value = 0;
value++;
/* Now value contains the value and buffer the key */
res = RegOpenKeyExW(HKEY_CURRENT_USER, key, 0, KEY_READ, &hKey);
if (res != ERROR_SUCCESS) {
/* if the key is not found, MSDN states we must seek in HKEY_LOCAL_MACHINE */
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hKey);
}
if (res == ERROR_SUCCESS) {
res = RegQueryValueW(hKey, value, result, &len);
if (res == ERROR_SUCCESS) {
This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
strcpyW(This->quickComplete, result);
}
RegCloseKey(hKey);
}
HeapFree(GetProcessHeap(), 0, key);
}
if ((pwszQuickComplete) && (!This->quickComplete)) {
This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
lstrcpyW(This->quickComplete, pwszQuickComplete);
}
return S_OK;
}
/**************************************************************************
* IAutoComplete_fnVTable
*/
static IAutoCompleteVtbl acvt =
{
IAutoComplete_fnQueryInterface,
IAutoComplete_fnAddRef,
IAutoComplete_fnRelease,
IAutoComplete_fnInit,
IAutoComplete_fnEnable,
};
/**************************************************************************
* AutoComplete2_QueryInterface
*/
static HRESULT WINAPI IAutoComplete2_fnQueryInterface(
IAutoComplete2 * iface,
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
return IAutoComplete_QueryInterface((IAutoComplete*)This, riid, ppvObj);
}
/******************************************************************************
* IAutoComplete2_fnAddRef
*/
static ULONG WINAPI IAutoComplete2_fnAddRef(
IAutoComplete2 * iface)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl,iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return IAutoComplete2_AddRef((IAutoComplete*)This);
}
/******************************************************************************
* IAutoComplete2_fnRelease
*/
static ULONG WINAPI IAutoComplete2_fnRelease(
IAutoComplete2 * iface)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl,iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return IAutoComplete_Release((IAutoComplete*)This);
}
/******************************************************************************
* IAutoComplete2_fnEnable
*/
static HRESULT WINAPI IAutoComplete2_fnEnable(
IAutoComplete2 * iface,
BOOL fEnable)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
TRACE ("(%p)->(%s)\n", This, (fEnable)?"true":"false");
return IAutoComplete_Enable((IAutoComplete*)This, fEnable);
}
/******************************************************************************
* IAutoComplete2_fnInit
*/
static HRESULT WINAPI IAutoComplete2_fnInit(
IAutoComplete2 * iface,
HWND hwndEdit,
IUnknown *punkACL,
LPCOLESTR pwzsRegKeyPath,
LPCOLESTR pwszQuickComplete)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
TRACE("(%p)\n", This);
return IAutoComplete_Init((IAutoComplete*)This, hwndEdit, punkACL, pwzsRegKeyPath, pwszQuickComplete);
}
/**************************************************************************
* IAutoComplete_fnGetOptions
*/
static HRESULT WINAPI IAutoComplete2_fnGetOptions(
IAutoComplete2 * iface,
DWORD *pdwFlag)
{
HRESULT hr = S_OK;
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
TRACE("(%p) -> (%p)\n", This, pdwFlag);
*pdwFlag = This->options;
return hr;
}
/**************************************************************************
* IAutoComplete_fnSetOptions
*/
static HRESULT WINAPI IAutoComplete2_fnSetOptions(
IAutoComplete2 * iface,
DWORD dwFlag)
{
HRESULT hr = S_OK;
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
TRACE("(%p) -> (0x%lx)\n", This, dwFlag);
This->options = dwFlag;
return hr;
}
/**************************************************************************
* IAutoComplete2_fnVTable
*/
static IAutoComplete2Vtbl ac2vt =
{
IAutoComplete2_fnQueryInterface,
IAutoComplete2_fnAddRef,
IAutoComplete2_fnRelease,
IAutoComplete2_fnInit,
IAutoComplete2_fnEnable,
/* IAutoComplete2 */
IAutoComplete2_fnSetOptions,
IAutoComplete2_fnGetOptions,
};
/*
Window procedure for autocompletion
*/
static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
LPOLESTR strs;
HRESULT hr;
WCHAR hwndText[255];
WCHAR *hwndQCText;
RECT r;
BOOL control, filled, displayall = FALSE;
int cpt, height, sel;
if (!This->enabled) return CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam);
switch (uMsg)
{
case CB_SHOWDROPDOWN:
ShowWindow(This->hwndListBox, SW_HIDE);
break;
case WM_KILLFOCUS:
if ((This->options && ACO_AUTOSUGGEST) &&
((HWND)wParam != This->hwndListBox))
{
ShowWindow(This->hwndListBox, SW_HIDE);
}
break;
case WM_KEYUP:
GetWindowTextW( hwnd, (LPWSTR)hwndText, 255);
switch(wParam) {
case VK_RETURN:
/* If quickComplete is set and control is pressed, replace the string */
control = GetKeyState(VK_CONTROL) & 0x8000;
if (control && This->quickComplete) {
hwndQCText = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
SendMessageW(hwnd, EM_SETSEL, 0, sel);
HeapFree(GetProcessHeap(), 0, hwndQCText);
}
ShowWindow(This->hwndListBox, SW_HIDE);
return 0;
case VK_LEFT:
case VK_RIGHT:
return 0;
case VK_UP:
case VK_DOWN:
/* Two cases here :
- if the listbox is not visible, displays it
with all the entries if the style ACO_UPDOWNKEYDROPSLIST
is present but does not select anything.
- if the listbox is visible, change the selection
*/
if ( (This->options & (ACO_AUTOSUGGEST | ACO_UPDOWNKEYDROPSLIST))
&& (!IsWindowVisible(This->hwndListBox) && (! *hwndText)) )
{
/* We must dispays all the entries */
displayall = TRUE;
} else {
if (IsWindowVisible(This->hwndListBox)) {
int count;
count = SendMessageW(This->hwndListBox, LB_GETCOUNT, 0, 0);
/* Change the selection */
sel = SendMessageW(This->hwndListBox, LB_GETCURSEL, 0, 0);
if (wParam == VK_UP)
sel = ((sel-1)<0)?count-1:sel-1;
else
sel = ((sel+1)>= count)?-1:sel+1;
SendMessageW(This->hwndListBox, LB_SETCURSEL, sel, 0);
if (sel != -1) {
WCHAR *msg;
int len;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
HeapFree(GetProcessHeap(), 0, msg);
} else {
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)This->txtbackup);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(This->txtbackup), lstrlenW(This->txtbackup));
}
}
return 0;
}
break;
case VK_BACK:
case VK_DELETE:
if ((! *hwndText) && (This->options & ACO_AUTOSUGGEST)) {
ShowWindow(This->hwndListBox, SW_HIDE);
return CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam);
}
if (This->options & ACO_AUTOAPPEND) {
DWORD b;
SendMessageW(hwnd, EM_GETSEL, (WPARAM)&b, (LPARAM)NULL);
if (b>1) {
hwndText[b-1] = '\0';
} else {
hwndText[0] = '\0';
SetWindowTextW(hwnd, hwndText);
}
}
break;
default:
;
}
SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, This->txtbackup);
This->txtbackup = (WCHAR*) HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
lstrcpyW(This->txtbackup, hwndText);
/* Returns if there is no text to search and we doesn't want to display all the entries */
if ((!displayall) && (! *hwndText) )
break;
IEnumString_Reset(This->enumstr);
filled = FALSE;
for(cpt = 0;;) {
hr = IEnumString_Next(This->enumstr, 1, &strs, NULL);
if (hr != S_OK)
break;
if ((LPWSTR)strstrW(strs, hwndText) == strs) {
if (This->options & ACO_AUTOAPPEND) {
SetWindowTextW(hwnd, strs);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(hwndText), lstrlenW(strs));
break;
}
if (This->options & ACO_AUTOSUGGEST) {
SendMessageW(This->hwndListBox, LB_ADDSTRING, 0, (LPARAM)strs);
filled = TRUE;
cpt++;
}
}
}
if (This->options & ACO_AUTOSUGGEST) {
if (filled) {
height = SendMessageW(This->hwndListBox, LB_GETITEMHEIGHT, 0, 0);
SendMessageW(This->hwndListBox, LB_CARETOFF, 0, 0);
GetWindowRect(hwnd, &r);
SetParent(This->hwndListBox, HWND_DESKTOP);
/* It seems that Windows XP displays 7 lines at most
and otherwise displays a vertical scroll bar */
SetWindowPos(This->hwndListBox, HWND_TOP,
r.left, r.bottom + 1, r.right - r.left, min(height * 7, height*(cpt+1)),
SWP_SHOWWINDOW );
} else {
ShowWindow(This->hwndListBox, SW_HIDE);
}
}
break;
default:
return CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam);
}
return 0;
}
static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
IAutoCompleteImpl *This = (IAutoCompleteImpl *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
WCHAR *msg;
int sel = -1, len;
switch (uMsg) {
case WM_MOUSEMOVE:
sel = SendMessageW(hwnd, LB_ITEMFROMPOINT, 0, lParam);
SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0);
break;
case WM_LBUTTONDOWN:
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
sel = (INT)SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg));
ShowWindow(hwnd, SW_HIDE);
HeapFree(GetProcessHeap(), 0, msg);
break;
default:
return CallWindowProcW(This->wpOrigLBoxProc, hwnd, uMsg, wParam, lParam);
}
return 0;
}

View File

@@ -0,0 +1,517 @@
/*
* Copyright 1999 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* FIXME:
* - many memory leaks
* - many flags unimplemented
*/
#include <stdlib.h>
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "wine/debug.h"
#include "undocshell.h"
#include "shlguid.h"
#include "pidl.h"
#include "shell32_main.h"
#include "shellapi.h"
#include "shresdef.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
static HWND hwndTreeView;
static LPBROWSEINFOW lpBrowseInfo;
static LPITEMIDLIST pidlRet;
static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST lpifq, HTREEITEM hParent, IEnumIDList* lpe);
static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent);
#define SUPPORTEDFLAGS (BIF_STATUSTEXT | \
BIF_BROWSEFORCOMPUTER | \
BIF_RETURNFSANCESTORS | \
BIF_RETURNONLYFSDIRS | \
BIF_BROWSEINCLUDEFILES)
static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
{
return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0);
}
static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root)
{
HIMAGELIST hImageList;
IShellFolder * lpsf;
HRESULT hr;
IEnumIDList * pEnumIL = NULL;
LPITEMIDLIST parentofroot;
parentofroot = ILClone(root);
ILRemoveLastID(parentofroot);
hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW);
Shell_GetImageList(NULL, &hImageList);
TRACE("dlg=%p tree=%p\n", hwndParent, hwndTreeView );
if (hImageList && hwndTreeView)
TreeView_SetImageList(hwndTreeView, hImageList, 0);
if (_ILIsDesktop (root)) {
hr = SHGetDesktopFolder(&lpsf);
} else {
IShellFolder * lpsfdesktop;
hr = SHGetDesktopFolder(&lpsfdesktop);
if (SUCCEEDED(hr)) {
hr = IShellFolder_BindToObject(lpsfdesktop, parentofroot, 0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf);
IShellFolder_Release(lpsfdesktop);
}
}
if (SUCCEEDED(hr))
{
IShellFolder * pSFRoot;
if (_ILIsPidlSimple(root))
{
pSFRoot = lpsf;
IShellFolder_AddRef(pSFRoot);
}
else
hr = IShellFolder_BindToObject(lpsf,ILFindLastID(root),0,&IID_IShellFolder,(LPVOID *)&pSFRoot);
if (SUCCEEDED(hr))
{
hr = IShellFolder_EnumObjects(
pSFRoot,
hwndParent,
BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags),
&pEnumIL);
IShellFolder_Release(pSFRoot);
}
}
if (SUCCEEDED(hr) && hwndTreeView)
{
TreeView_DeleteAllItems(hwndTreeView);
TreeView_Expand(hwndTreeView,
InsertTreeViewItem(lpsf, _ILIsPidlSimple(root) ? root : ILFindLastID(root), parentofroot, pEnumIL, TVI_ROOT),
TVE_EXPAND);
}
if (SUCCEEDED(hr))
IShellFolder_Release(lpsf);
TRACE("done\n");
}
static int GetIcon(LPITEMIDLIST lpi, UINT uFlags)
{
SHFILEINFOW sfi;
SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), uFlags);
return sfi.iIcon;
}
static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
{
LPITEMIDLIST pidlDesktop = NULL;
TRACE("%p %p\n",lpifq, lpTV_ITEM);
if (!lpifq)
{
pidlDesktop = _ILCreateDesktop();
lpifq = pidlDesktop;
}
lpTV_ITEM->iImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
lpTV_ITEM->iSelectedImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON);
if (pidlDesktop)
ILFree(pidlDesktop);
return;
}
typedef struct tagID
{
LPSHELLFOLDER lpsfParent;
LPITEMIDLIST lpi;
LPITEMIDLIST lpifq;
IEnumIDList* pEnumIL;
} TV_ITEMDATA, *LPTV_ITEMDATA;
static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
{
BOOL bSuccess=TRUE;
STRRET str;
TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
{
if (FAILED(StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi)))
{
bSuccess = FALSE;
}
}
else
bSuccess = FALSE;
TRACE("-- %s\n", debugstr_w(lpFriendlyName));
return bSuccess;
}
static HTREEITEM InsertTreeViewItem(IShellFolder * lpsf, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL, HTREEITEM hParent)
{
TVITEMW tvi;
TVINSERTSTRUCTW tvins;
WCHAR szBuff[MAX_PATH];
LPTV_ITEMDATA lptvid=0;
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
tvi.cChildren= pEnumIL ? 1 : 0;
tvi.mask |= TVIF_CHILDREN;
if (!(lptvid = (LPTV_ITEMDATA)SHAlloc(sizeof(TV_ITEMDATA))))
return NULL;
if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
return NULL;
tvi.pszText = szBuff;
tvi.cchTextMax = MAX_PATH;
tvi.lParam = (LPARAM)lptvid;
IShellFolder_AddRef(lpsf);
lptvid->lpsfParent = lpsf;
lptvid->lpi = ILClone(pidl);
lptvid->lpifq = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
lptvid->pEnumIL = pEnumIL;
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
tvins.u.item = tvi;
tvins.hInsertAfter = NULL;
tvins.hParent = hParent;
return (HTREEITEM)TreeView_InsertItemW(hwndTreeView, &tvins);
}
static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hParent, IEnumIDList* lpe)
{
HTREEITEM hPrev = 0;
LPITEMIDLIST pidlTemp = 0;
ULONG ulFetched;
HRESULT hr;
HWND hwnd=GetParent(hwndTreeView);
TRACE("%p %p %x\n",lpsf, pidl, (INT)hParent);
SetCapture(GetParent(hwndTreeView));
SetCursor(LoadCursorA(0, (LPSTR)IDC_WAIT));
while (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))
{
ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
IEnumIDList* pEnumIL = NULL;
IShellFolder* pSFChild = NULL;
IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
if (ulAttrs & SFGAO_FOLDER)
{
hr = IShellFolder_BindToObject(lpsf,pidlTemp,NULL,&IID_IShellFolder,(LPVOID*)&pSFChild);
if (SUCCEEDED(hr))
{
hr = IShellFolder_EnumObjects(pSFChild, hwnd, BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags), &pEnumIL);
if (SUCCEEDED(hr))
{
if ((IEnumIDList_Skip(pEnumIL, 1) != S_OK) || FAILED(IEnumIDList_Reset(pEnumIL)))
{
IEnumIDList_Release(pEnumIL);
pEnumIL = NULL;
}
}
IShellFolder_Release(pSFChild);
}
}
if (!(hPrev = InsertTreeViewItem(lpsf, pidlTemp, pidl, pEnumIL, hParent)))
goto Done;
SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */
pidlTemp=NULL;
}
Done:
ReleaseCapture();
SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW));
if (pidlTemp)
SHFree(pidlTemp);
}
static inline BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
{
LPPIDLDATA data = _ILGetDataPointer(pidl);
if (!data)
return FALSE;
return (data->type == type);
}
static void BrsFolder_CheckValidSelection(HWND hWndTree, LPTV_ITEMDATA lptvid)
{
LPCITEMIDLIST pidl = lptvid->lpi;
BOOL bEnabled = TRUE;
DWORD dwAttributes;
if ((lpBrowseInfo->ulFlags & BIF_BROWSEFORCOMPUTER) &&
!PIDLIsType(pidl, PT_COMP))
bEnabled = FALSE;
if (lpBrowseInfo->ulFlags & BIF_RETURNFSANCESTORS)
{
dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes)) ||
!dwAttributes)
bEnabled = FALSE;
}
if (lpBrowseInfo->ulFlags & BIF_RETURNONLYFSDIRS)
{
dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM;
if (FAILED(IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes)) ||
(dwAttributes != (SFGAO_FOLDER | SFGAO_FILESYSTEM)))
bEnabled = FALSE;
}
SendMessageW(hWndTree, BFFM_ENABLEOK, 0, (LPARAM)bEnabled);
}
static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh)
{
NMTREEVIEWW *pnmtv = (NMTREEVIEWW *)lpnmh;
LPTV_ITEMDATA lptvid; /* Long pointer to TreeView item data */
IShellFolder * lpsf2=0;
TRACE("%p %x %p msg=%x\n", hWnd, CtlID, lpnmh, pnmtv->hdr.code);
switch (pnmtv->hdr.idFrom)
{ case IDD_TREEVIEW:
switch (pnmtv->hdr.code)
{
case TVN_DELETEITEMA:
case TVN_DELETEITEMW:
TRACE("TVN_DELETEITEMA/W\n");
lptvid=(LPTV_ITEMDATA)pnmtv->itemOld.lParam;
IShellFolder_Release(lptvid->lpsfParent);
if (lptvid->pEnumIL)
IEnumIDList_Release(lptvid->pEnumIL);
SHFree(lptvid->lpi);
SHFree(lptvid->lpifq);
SHFree(lptvid);
break;
case TVN_ITEMEXPANDINGA:
case TVN_ITEMEXPANDINGW:
{
TRACE("TVN_ITEMEXPANDINGA/W\n");
if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
break;
lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam;
if (SUCCEEDED(IShellFolder_BindToObject(lptvid->lpsfParent, lptvid->lpi,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2)))
{ FillTreeView( lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem, lptvid->pEnumIL);
}
TreeView_SortChildren(hwndTreeView, pnmtv->itemNew.hItem, FALSE);
}
break;
case TVN_SELCHANGEDA:
case TVN_SELCHANGEDW:
lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam;
pidlRet = lptvid->lpifq;
if (lpBrowseInfo->lpfn)
(lpBrowseInfo->lpfn)(hWnd, BFFM_SELCHANGED, (LPARAM)pidlRet, lpBrowseInfo->lParam);
BrsFolder_CheckValidSelection(hWnd, lptvid);
break;
default:
WARN("unhandled (%d)\n", pnmtv->hdr.code);
break;
}
break;
default:
break;
}
return 0;
}
/*************************************************************************
* BrsFolderDlgProc32 (not an exported API function)
*/
static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
LPARAM lParam )
{
TRACE("hwnd=%p msg=%04x 0x%08x 0x%08lx\n", hWnd, msg, wParam, lParam );
switch(msg)
{ case WM_INITDIALOG:
pidlRet = NULL;
lpBrowseInfo = (LPBROWSEINFOW) lParam;
if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
if (lpBrowseInfo->lpszTitle) {
SetWindowTextW(GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle);
} else {
ShowWindow(GetDlgItem(hWnd, IDD_TITLE), SW_HIDE);
}
if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT))
ShowWindow(GetDlgItem(hWnd, IDD_STATUS), SW_HIDE);
InitializeTreeView(hWnd, lpBrowseInfo->pidlRoot);
if (lpBrowseInfo->lpfn)
(lpBrowseInfo->lpfn)(hWnd, BFFM_INITIALIZED, 0, lpBrowseInfo->lParam);
return TRUE;
case WM_NOTIFY:
MsgNotify( hWnd, (UINT)wParam, (LPNMHDR)lParam);
break;
case WM_COMMAND:
switch (wParam)
{ case IDOK:
pdump ( pidlRet );
if (lpBrowseInfo->pszDisplayName)
SHGetPathFromIDListW(pidlRet, lpBrowseInfo->pszDisplayName);
EndDialog(hWnd, (DWORD) ILClone(pidlRet));
return TRUE;
case IDCANCEL:
EndDialog(hWnd, 0);
return TRUE;
}
break;
case BFFM_SETSTATUSTEXTA:
TRACE("Set status %s\n", debugstr_a((LPSTR)lParam));
SetWindowTextA(GetDlgItem(hWnd, IDD_STATUS), (LPSTR)lParam);
break;
case BFFM_SETSTATUSTEXTW:
TRACE("Set status %s\n", debugstr_w((LPWSTR)lParam));
SetWindowTextW(GetDlgItem(hWnd, IDD_STATUS), (LPWSTR)lParam);
break;
case BFFM_ENABLEOK:
TRACE("Enable %ld\n", lParam);
EnableWindow(GetDlgItem(hWnd, 1), (lParam)?TRUE:FALSE);
break;
case BFFM_SETOKTEXT: /* unicode only */
TRACE("Set OK text %s\n", debugstr_w((LPWSTR)wParam));
SetWindowTextW(GetDlgItem(hWnd, 1), (LPWSTR)wParam);
break;
case BFFM_SETSELECTIONA:
if (wParam)
FIXME("Set selection %s\n", debugstr_a((LPSTR)lParam));
else
FIXME("Set selection %p\n", (void*)lParam);
break;
case BFFM_SETSELECTIONW:
if (wParam)
FIXME("Set selection %s\n", debugstr_w((LPWSTR)lParam));
else
FIXME("Set selection %p\n", (void*)lParam);
break;
case BFFM_SETEXPANDED: /* unicode only */
if (wParam)
FIXME("Set expanded %s\n", debugstr_w((LPWSTR)lParam));
else
FIXME("Set expanded %p\n", (void*)lParam);
break;
}
return FALSE;
}
static const WCHAR swBrowseTempName[] = {'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0};
/*************************************************************************
* SHBrowseForFolderA [SHELL32.@]
* SHBrowseForFolder [SHELL32.@]
*/
LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi)
{
BROWSEINFOW bi;
LPITEMIDLIST lpid;
INT len;
TRACE("(%p{lpszTitle=%s,owner=%p})\n", lpbi,
lpbi ? debugstr_a(lpbi->lpszTitle) : NULL, lpbi ? lpbi->hwndOwner : NULL);
if (!lpbi)
return NULL;
bi.hwndOwner = lpbi->hwndOwner;
bi.pidlRoot = lpbi->pidlRoot;
if (lpbi->pszDisplayName)
{
/*lpbi->pszDisplayName is assumed to be MAX_PATH (MSDN) */
bi.pszDisplayName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, MAX_PATH);
}
else
bi.pszDisplayName = NULL;
if (lpbi->lpszTitle)
{
len = MultiByteToWideChar(CP_ACP, 0, lpbi->lpszTitle, -1, NULL, 0);
bi.lpszTitle = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpbi->lpszTitle, -1, (LPWSTR)bi.lpszTitle, len);
}
else
bi.lpszTitle = NULL;
bi.ulFlags = lpbi->ulFlags;
bi.lpfn = lpbi->lpfn;
bi.lParam = lpbi->lParam;
bi.iImage = lpbi->iImage;
lpid = (LPITEMIDLIST) DialogBoxParamW(shell32_hInstance,
swBrowseTempName, lpbi->hwndOwner,
BrsFolderDlgProc, (INT)&bi);
if (bi.pszDisplayName)
{
WideCharToMultiByte(CP_ACP, 0, bi.pszDisplayName, -1, lpbi->pszDisplayName, MAX_PATH, 0, NULL);
HeapFree(GetProcessHeap(), 0, bi.pszDisplayName);
}
if (bi.lpszTitle)
{
HeapFree(GetProcessHeap(), 0, (LPVOID)bi.lpszTitle);
}
lpbi->iImage = bi.iImage;
return lpid;
}
/*************************************************************************
* SHBrowseForFolderW [SHELL32.@]
*/
LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
{
TRACE("((%p->{lpszTitle=%s,owner=%p})\n", lpbi,
lpbi ? debugstr_w(lpbi->lpszTitle) : NULL, lpbi ? lpbi->hwndOwner : 0);
if (!lpbi)
return NULL;
return (LPITEMIDLIST) DialogBoxParamW(shell32_hInstance,
swBrowseTempName, lpbi->hwndOwner,
BrsFolderDlgProc, (INT)lpbi);
}

View File

@@ -0,0 +1,484 @@
/*
* shell change notification
*
* Copyright 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "wingdi.h"
#include "pidl.h"
#include "shell32_main.h"
#include "undocshell.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
static CRITICAL_SECTION SHELL32_ChangenotifyCS;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &SHELL32_ChangenotifyCS,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { 0, (DWORD)(__FILE__ ": SHELL32_ChangenotifyCS") }
};
static CRITICAL_SECTION SHELL32_ChangenotifyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
typedef SHChangeNotifyEntry *LPNOTIFYREGISTER;
/* internal list of notification clients (internal) */
typedef struct _NOTIFICATIONLIST
{
struct _NOTIFICATIONLIST *next;
struct _NOTIFICATIONLIST *prev;
HWND hwnd; /* window to notify */
DWORD uMsg; /* message to send */
LPNOTIFYREGISTER apidl; /* array of entries to watch*/
UINT cidl; /* number of pidls in array */
LONG wEventMask; /* subscribed events */
LONG wSignalledEvent; /* event that occurred */
DWORD dwFlags; /* client flags */
LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/
} NOTIFICATIONLIST, *LPNOTIFICATIONLIST;
static NOTIFICATIONLIST *head, *tail;
#define SHCNE_NOITEMEVENTS ( \
SHCNE_ASSOCCHANGED )
#define SHCNE_ONEITEMEVENTS ( \
SHCNE_ATTRIBUTES | SHCNE_CREATE | SHCNE_DELETE | SHCNE_DRIVEADD | \
SHCNE_DRIVEADDGUI | SHCNE_DRIVEREMOVED | SHCNE_FREESPACE | \
SHCNE_MEDIAINSERTED | SHCNE_MEDIAREMOVED | SHCNE_MKDIR | \
SHCNE_NETSHARE | SHCNE_NETUNSHARE | SHCNE_RMDIR | \
SHCNE_SERVERDISCONNECT | SHCNE_UPDATEDIR | SHCNE_UPDATEIMAGE )
#define SHCNE_TWOITEMEVENTS ( \
SHCNE_RENAMEFOLDER | SHCNE_RENAMEITEM | SHCNE_UPDATEITEM )
/* for dumping events */
static const char * DumpEvent( LONG event )
{
if( event == SHCNE_ALLEVENTS )
return "SHCNE_ALLEVENTS";
#define DUMPEV(x) ,( event & SHCNE_##x )? #x " " : ""
return wine_dbg_sprintf( "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
DUMPEV(RENAMEITEM)
DUMPEV(CREATE)
DUMPEV(DELETE)
DUMPEV(MKDIR)
DUMPEV(RMDIR)
DUMPEV(MEDIAINSERTED)
DUMPEV(MEDIAREMOVED)
DUMPEV(DRIVEREMOVED)
DUMPEV(DRIVEADD)
DUMPEV(NETSHARE)
DUMPEV(NETUNSHARE)
DUMPEV(ATTRIBUTES)
DUMPEV(UPDATEDIR)
DUMPEV(UPDATEITEM)
DUMPEV(SERVERDISCONNECT)
DUMPEV(UPDATEIMAGE)
DUMPEV(DRIVEADDGUI)
DUMPEV(RENAMEFOLDER)
DUMPEV(FREESPACE)
DUMPEV(EXTENDED_EVENT)
DUMPEV(ASSOCCHANGED)
DUMPEV(INTERRUPT)
);
#undef DUMPEV
}
static const char * NodeName(LPNOTIFICATIONLIST item)
{
const char *str;
WCHAR path[MAX_PATH];
if(SHGetPathFromIDListW(item->apidl[0].pidl, path ))
str = wine_dbg_sprintf("%s", debugstr_w(path));
else
str = wine_dbg_sprintf("<not a disk file>" );
return str;
}
static void AddNode(LPNOTIFICATIONLIST item)
{
TRACE("item %p\n", item );
/* link items */
item->prev = tail;
item->next = NULL;
if( tail )
tail->next = item;
else
head = item;
tail = item;
}
static LPNOTIFICATIONLIST FindNode( HANDLE hitem )
{
LPNOTIFICATIONLIST ptr;
for( ptr = head; ptr; ptr = ptr->next )
if( ptr == (LPNOTIFICATIONLIST) hitem )
return ptr;
return NULL;
}
static void DeleteNode(LPNOTIFICATIONLIST item)
{
UINT i;
TRACE("item=%p prev=%p next=%p\n", item, item->prev, item->next);
/* remove item from list */
if( item->prev )
item->prev->next = item->next;
else
head = item->next;
if( item->next )
item->next->prev = item->prev;
else
tail = item->prev;
/* free the item */
for (i=0; i<item->cidl; i++)
SHFree((LPITEMIDLIST)item->apidl[i].pidl);
SHFree(item->apidl);
SHFree(item);
}
void InitChangeNotifications(void)
{
}
void FreeChangeNotifications(void)
{
TRACE("\n");
EnterCriticalSection(&SHELL32_ChangenotifyCS);
while( head )
DeleteNode( head );
LeaveCriticalSection(&SHELL32_ChangenotifyCS);
DeleteCriticalSection(&SHELL32_ChangenotifyCS);
}
/*************************************************************************
* SHChangeNotifyRegister [SHELL32.2]
*
*/
ULONG WINAPI
SHChangeNotifyRegister(
HWND hwnd,
int fSources,
LONG wEventMask,
UINT uMsg,
int cItems,
SHChangeNotifyEntry *lpItems)
{
LPNOTIFICATIONLIST item;
int i;
item = SHAlloc(sizeof(NOTIFICATIONLIST));
TRACE("(%p,0x%08x,0x%08lx,0x%08x,%d,%p) item=%p\n",
hwnd, fSources, wEventMask, uMsg, cItems, lpItems, item);
item->next = NULL;
item->prev = NULL;
item->cidl = cItems;
item->apidl = SHAlloc(sizeof(SHChangeNotifyEntry) * cItems);
for(i=0;i<cItems;i++)
{
item->apidl[i].pidl = ILClone(lpItems[i].pidl);
item->apidl[i].fRecursive = lpItems[i].fRecursive;
}
item->hwnd = hwnd;
item->uMsg = uMsg;
item->wEventMask = wEventMask;
item->wSignalledEvent = 0;
item->dwFlags = fSources;
TRACE("new node: %s\n", NodeName( item ));
EnterCriticalSection(&SHELL32_ChangenotifyCS);
AddNode(item);
LeaveCriticalSection(&SHELL32_ChangenotifyCS);
return (ULONG)item;
}
/*************************************************************************
* SHChangeNotifyDeregister [SHELL32.4]
*/
BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
{
LPNOTIFICATIONLIST node;
TRACE("(0x%08lx)\n", hNotify);
EnterCriticalSection(&SHELL32_ChangenotifyCS);
node = FindNode((HANDLE)hNotify);
if( node )
DeleteNode(node);
LeaveCriticalSection(&SHELL32_ChangenotifyCS);
return node?TRUE:FALSE;
}
/*************************************************************************
* SHChangeNotifyUpdateEntryList [SHELL32.5]
*/
BOOL WINAPI SHChangeNotifyUpdateEntryList(DWORD unknown1, DWORD unknown2,
DWORD unknown3, DWORD unknown4)
{
FIXME("(0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx)\n",
unknown1, unknown2, unknown3, unknown4);
return -1;
}
static BOOL should_notify( LPCITEMIDLIST changed, LPCITEMIDLIST watched, BOOL sub )
{
TRACE("%p %p %d\n", changed, watched, sub );
if ( !watched )
return FALSE;
if (ILIsEqual( watched, changed ) )
return TRUE;
if( sub && ILIsParent( watched, changed, FALSE ) )
return TRUE;
return FALSE;
}
/*************************************************************************
* SHChangeNotify [SHELL32.@]
*/
void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
{
LPCITEMIDLIST Pidls[2];
LPNOTIFICATIONLIST ptr;
UINT typeFlag = uFlags & SHCNF_TYPE;
Pidls[0] = NULL;
Pidls[1] = NULL;
TRACE("(0x%08lx,0x%08x,%p,%p):stub.\n", wEventId, uFlags, dwItem1, dwItem2);
if( ( wEventId & SHCNE_NOITEMEVENTS ) && ( dwItem1 || dwItem2 ) )
{
TRACE("dwItem1 and dwItem2 are not zero, but should be\n");
dwItem1 = 0;
dwItem2 = 0;
return;
}
else if( ( wEventId & SHCNE_ONEITEMEVENTS ) && dwItem2 )
{
TRACE("dwItem2 is not zero, but should be\n");
dwItem2 = 0;
return;
}
if( ( ( wEventId & SHCNE_NOITEMEVENTS ) &&
( wEventId & ~SHCNE_NOITEMEVENTS ) ) ||
( ( wEventId & SHCNE_ONEITEMEVENTS ) &&
( wEventId & ~SHCNE_ONEITEMEVENTS ) ) ||
( ( wEventId & SHCNE_TWOITEMEVENTS ) &&
( wEventId & ~SHCNE_TWOITEMEVENTS ) ) )
{
WARN("mutually incompatible events listed\n");
return;
}
/* convert paths in IDLists*/
switch (typeFlag)
{
case SHCNF_PATHA:
if (dwItem1) Pidls[0] = SHSimpleIDListFromPathA((LPCSTR)dwItem1);
if (dwItem2) Pidls[1] = SHSimpleIDListFromPathA((LPCSTR)dwItem2);
break;
case SHCNF_PATHW:
if (dwItem1) Pidls[0] = SHSimpleIDListFromPathW((LPCWSTR)dwItem1);
if (dwItem2) Pidls[1] = SHSimpleIDListFromPathW((LPCWSTR)dwItem2);
break;
case SHCNF_IDLIST:
Pidls[0] = (LPCITEMIDLIST)dwItem1;
Pidls[1] = (LPCITEMIDLIST)dwItem2;
break;
case SHCNF_PRINTERA:
case SHCNF_PRINTERW:
FIXME("SHChangeNotify with (uFlags & SHCNF_PRINTER)\n");
return;
case SHCNF_DWORD:
default:
FIXME("unknown type %08x\n",typeFlag);
return;
}
{
WCHAR path[MAX_PATH];
if( Pidls[0] && SHGetPathFromIDListW(Pidls[0], path ))
TRACE("notify %08lx on item1 = %s\n", wEventId, debugstr_w(path));
if( Pidls[1] && SHGetPathFromIDListW(Pidls[1], path ))
TRACE("notify %08lx on item2 = %s\n", wEventId, debugstr_w(path));
}
EnterCriticalSection(&SHELL32_ChangenotifyCS);
/* loop through the list */
for( ptr = head; ptr; ptr = ptr->next )
{
BOOL notify;
DWORD i;
notify = FALSE;
TRACE("trying %p\n", ptr);
for( i=0; (i<ptr->cidl) && !notify ; i++ )
{
LPCITEMIDLIST pidl = ptr->apidl[i].pidl;
BOOL subtree = ptr->apidl[i].fRecursive;
if (wEventId & ptr->wEventMask)
{
if( !pidl ) /* all ? */
notify = TRUE;
else if( wEventId & SHCNE_NOITEMEVENTS )
notify = TRUE;
else if( wEventId & ( SHCNE_ONEITEMEVENTS | SHCNE_TWOITEMEVENTS ) )
notify = should_notify( Pidls[0], pidl, subtree );
else if( wEventId & SHCNE_TWOITEMEVENTS )
notify = should_notify( Pidls[1], pidl, subtree );
}
}
if( !notify )
continue;
ptr->pidlSignaled = ILClone(Pidls[0]);
TRACE("notifying %s, event %s(%lx) before\n", NodeName( ptr ), DumpEvent(
wEventId ),wEventId );
ptr->wSignalledEvent |= wEventId;
if (ptr->dwFlags & SHCNRF_NewDelivery)
SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM) ptr, (LPARAM) GetCurrentProcessId());
else
SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM)Pidls, wEventId);
TRACE("notifying %s, event %s(%lx) after\n", NodeName( ptr ), DumpEvent(
wEventId ),wEventId );
}
TRACE("notify Done\n");
LeaveCriticalSection(&SHELL32_ChangenotifyCS);
/* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */
if ((typeFlag & SHCNF_PATHA) || (typeFlag & SHCNF_PRINTERA))
{
if (Pidls[0]) SHFree((LPITEMIDLIST)Pidls[0]);
if (Pidls[1]) SHFree((LPITEMIDLIST)Pidls[1]);
}
}
/*************************************************************************
* NTSHChangeNotifyRegister [SHELL32.640]
* NOTES
* Idlist is an array of structures and Count specifies how many items in the array
* (usually just one I think).
*/
DWORD WINAPI NTSHChangeNotifyRegister(
HWND hwnd,
LONG events1,
LONG events2,
DWORD msg,
int count,
SHChangeNotifyEntry *idlist)
{
FIXME("(%p,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p):semi stub.\n",
hwnd,events1,events2,msg,count,idlist);
return (DWORD) SHChangeNotifyRegister(hwnd, events1, events2, msg, count, idlist);
}
/*************************************************************************
* SHChangeNotification_Lock [SHELL32.644]
*/
HANDLE WINAPI SHChangeNotification_Lock(
HANDLE hChange,
DWORD dwProcessId,
LPITEMIDLIST **lppidls,
LPLONG lpwEventId)
{
DWORD i;
LPNOTIFICATIONLIST node;
LPCITEMIDLIST *idlist;
TRACE("%p %08lx %p %p\n", hChange, dwProcessId, lppidls, lpwEventId);
/* EnterCriticalSection(&SHELL32_ChangenotifyCS); */
node = FindNode( hChange );
if( node )
{
idlist = SHAlloc( sizeof(LPCITEMIDLIST *) * node->cidl );
for(i=0; i<node->cidl; i++)
idlist[i] = (LPCITEMIDLIST)node->pidlSignaled;
*lpwEventId = node->wSignalledEvent;
*lppidls = (LPITEMIDLIST*)idlist;
node->wSignalledEvent = 0;
}
else
ERR("Couldn't find %p\n", hChange );
/* LeaveCriticalSection(&SHELL32_ChangenotifyCS); */
return (HANDLE) node;
}
/*************************************************************************
* SHChangeNotification_Unlock [SHELL32.645]
*/
BOOL WINAPI SHChangeNotification_Unlock ( HANDLE hLock)
{
TRACE("\n");
return 1;
}
/*************************************************************************
* NTSHChangeNotifyDeregister [SHELL32.641]
*/
DWORD WINAPI NTSHChangeNotifyDeregister(ULONG x1)
{
FIXME("(0x%08lx):semi stub.\n",x1);
return SHChangeNotifyDeregister( x1 );
}

View File

@@ -0,0 +1,380 @@
/*
* file type mapping
* (HKEY_CLASSES_ROOT - Stuff)
*
* Copyright 1998, 1999, 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "wine/debug.h"
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "shlobj.h"
#include "shell32_main.h"
#include "shlguid.h"
#include "shresdef.h"
#include "shlwapi.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define MAX_EXTENSION_LENGTH 20
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, DWORD len, BOOL bPrependDot)
{
HKEY hkey;
WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
TRACE("%s %p\n", debugstr_w(szExtension), debugstr_w(szFileType));
/* added because we do not want to have double dots */
if (szExtension[0] == '.')
bPrependDot = 0;
if (bPrependDot)
szTemp[0] = '.';
lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, 0x02000000, &hkey))
{
return FALSE;
}
if (RegQueryValueW(hkey, NULL, szFileType, &len))
{
RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
return TRUE;
}
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL bPrependDot)
{
HKEY hkey;
char szTemp[MAX_EXTENSION_LENGTH + 2];
TRACE("%s %p\n", szExtension, szFileType);
/* added because we do not want to have double dots */
if (szExtension[0] == '.')
bPrependDot = 0;
if (bPrependDot)
szTemp[0] = '.';
lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, 0x02000000, &hkey))
{
return FALSE;
}
if (RegQueryValueA(hkey, NULL, szFileType, &len))
{
RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
TRACE("--UE;\n} %s\n", szFileType);
return TRUE;
}
BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
{
static const WCHAR swShell[] = {'\\','s','h','e','l','l','\\',0};
static const WCHAR swCommand[] = {'\\','c','o','m','m','a','n','d',0};
BOOL ret = FALSE;
TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
if (szClass)
RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, 0x02000000, &hkeyClass);
if (hkeyClass)
{
WCHAR sTemp[MAX_PATH];
lstrcpyW(sTemp, swShell);
lstrcatW(sTemp, szVerb);
lstrcatW(sTemp, swCommand);
ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
if (szClass)
RegCloseKey(hkeyClass);
}
TRACE("-- %s\n", debugstr_w(szDest) );
return ret;
}
/***************************************************************************************
* HCR_GetDefaultIcon [internal]
*
* Gets the icon for a filetype
*/
static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
{
char xriid[50];
sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
TRACE("%s\n",xriid );
return !RegOpenKeyExA(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey);
}
static BOOL HCR_RegGetDefaultIconW(HKEY hkey, LPWSTR szDest, DWORD len, LPDWORD dwNr)
{
DWORD dwType;
WCHAR sTemp[MAX_PATH];
WCHAR sNum[5];
if (!RegQueryValueExW(hkey, NULL, 0, &dwType, (LPBYTE)szDest, &len))
{
if (dwType == REG_EXPAND_SZ)
{
ExpandEnvironmentStringsW(szDest, sTemp, MAX_PATH);
lstrcpynW(szDest, sTemp, len);
}
if (ParseFieldW (szDest, 2, sNum, 5))
*dwNr = atoiW(sNum);
else
*dwNr=0; /* sometimes the icon number is missing */
ParseFieldW (szDest, 1, szDest, len);
return TRUE;
}
return FALSE;
}
static BOOL HCR_RegGetDefaultIconA(HKEY hkey, LPSTR szDest, DWORD len, LPDWORD dwNr)
{
DWORD dwType;
char sTemp[MAX_PATH];
char sNum[5];
if (!RegQueryValueExA(hkey, NULL, 0, &dwType, szDest, &len))
{
if (dwType == REG_EXPAND_SZ)
{
ExpandEnvironmentStringsA(szDest, sTemp, MAX_PATH);
lstrcpynA(szDest, sTemp, len);
}
if (ParseFieldA (szDest, 2, sNum, 5))
*dwNr=atoi(sNum);
else
*dwNr=0; /* sometimes the icon number is missing */
ParseFieldA (szDest, 1, szDest, len);
return TRUE;
}
return FALSE;
}
BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, LPDWORD dwNr)
{
static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0};
HKEY hkey;
WCHAR sTemp[MAX_PATH];
BOOL ret = FALSE;
TRACE("%s\n",debugstr_w(szClass) );
lstrcpynW(sTemp, szClass, MAX_PATH);
lstrcatW(sTemp, swDefaultIcon);
if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, 0x02000000, &hkey))
{
ret = HCR_RegGetDefaultIconW(hkey, szDest, len, dwNr);
RegCloseKey(hkey);
}
TRACE("-- %s %li\n", debugstr_w(szDest), *dwNr );
return ret;
}
BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr)
{
HKEY hkey;
char sTemp[MAX_PATH];
BOOL ret = FALSE;
TRACE("%s\n",szClass );
sprintf(sTemp, "%s\\DefaultIcon",szClass);
if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, 0x02000000, &hkey))
{
ret = HCR_RegGetDefaultIconA(hkey, szDest, len, dwNr);
RegCloseKey(hkey);
}
TRACE("-- %s %li\n", szDest, *dwNr );
return ret;
}
BOOL HCR_GetDefaultIconFromGUIDW(REFIID riid, LPWSTR szDest, DWORD len, LPDWORD dwNr)
{
HKEY hkey;
BOOL ret = FALSE;
if (HCR_RegOpenClassIDKey(riid, &hkey))
{
ret = HCR_RegGetDefaultIconW(hkey, szDest, len, dwNr);
RegCloseKey(hkey);
}
TRACE("-- %s %li\n", debugstr_w(szDest), *dwNr );
return ret;
}
/***************************************************************************************
* HCR_GetClassName [internal]
*
* Gets the name of a registered class
*/
static const WCHAR swEmpty[] = {0};
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
{
HKEY hkey;
BOOL ret = FALSE;
DWORD buflen = len;
szDest[0] = 0;
if (HCR_RegOpenClassIDKey(riid, &hkey))
{
if (!RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len))
{
ret = TRUE;
}
RegCloseKey(hkey);
}
if (!ret || !szDest[0])
{
if(IsEqualIID(riid, &CLSID_ShellDesktop))
{
if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
ret = TRUE;
}
else if (IsEqualIID(riid, &CLSID_MyComputer))
{
if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
ret = TRUE;
}
}
TRACE("-- %s\n", debugstr_w(szDest));
return ret;
}
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
{ HKEY hkey;
BOOL ret = FALSE;
DWORD buflen = len;
szDest[0] = 0;
if (HCR_RegOpenClassIDKey(riid, &hkey))
{
if (!RegQueryValueExA(hkey,"",0,NULL,szDest,&len))
{
ret = TRUE;
}
RegCloseKey(hkey);
}
if (!ret || !szDest[0])
{
if(IsEqualIID(riid, &CLSID_ShellDesktop))
{
if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
ret = TRUE;
}
else if (IsEqualIID(riid, &CLSID_MyComputer))
{
if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
ret = TRUE;
}
}
TRACE("-- %s\n", szDest);
return ret;
}
/***************************************************************************************
* HCR_GetFolderAttributes [internal]
*
* gets the folder attributes of a class
*
* FIXME
* verify the defaultvalue for *szDest
*/
BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest)
{ HKEY hkey;
char xriid[60];
DWORD attributes;
DWORD len = 4;
sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
TRACE("%s\n",xriid );
if (!szDest) return FALSE;
*szDest = SFGAO_FOLDER|SFGAO_FILESYSTEM;
strcat (xriid, "\\ShellFolder");
if (RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey))
{
return FALSE;
}
if (RegQueryValueExA(hkey,"Attributes",0,NULL,(LPBYTE)&attributes,&len))
{
RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
TRACE("-- 0x%08lx\n", attributes);
*szDest = attributes;
return TRUE;
}

View File

@@ -0,0 +1,270 @@
/*
* clipboard helper functions
*
* Copyright 2000 Juergen Schmied <juergen.schmied@debitel.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* NOTES:
*
* For copy & paste functions within contextmenus does the shell use
* the OLE clipboard functions in combination with dataobjects.
* The OLE32.DLL gets loaded with LoadLibrary
*
* - a right mousebutton-copy sets the following formats:
* classic:
* Shell IDList Array
* Prefered Drop Effect
* Shell Object Offsets
* HDROP
* FileName
* ole:
* OlePrivateData (ClipboardDataObjectInterface)
*
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "pidl.h"
#include "undocshell.h"
#include "shell32_main.h"
#include "shlwapi.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/**************************************************************************
* RenderHDROP
*
* creates a CF_HDROP structure
*/
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
UINT i;
int rootsize = 0,size = 0;
char szRootPath[MAX_PATH];
char szFileName[MAX_PATH];
HGLOBAL hGlobal;
DROPFILES *pDropFiles;
int offset;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
/* get the size needed */
size = sizeof(DROPFILES);
SHGetPathFromIDListA(pidlRoot, szRootPath);
PathAddBackslashA(szRootPath);
rootsize = strlen(szRootPath);
for (i=0; i<cidl;i++)
{
_ILSimpleGetText(apidl[i], szFileName, MAX_PATH);
size += rootsize + strlen(szFileName) + 1;
}
size++;
/* Fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
pDropFiles = (DROPFILES *)GlobalLock(hGlobal);
pDropFiles->pFiles = sizeof(DROPFILES);
pDropFiles->fWide = FALSE;
offset = pDropFiles->pFiles;
strcpy(szFileName, szRootPath);
for (i=0; i<cidl;i++)
{
_ILSimpleGetText(apidl[i], szFileName + rootsize, MAX_PATH - rootsize);
size = strlen(szFileName) + 1;
strcpy(((char*)pDropFiles)+offset, szFileName);
offset += size;
}
((char*)pDropFiles)[offset] = 0;
GlobalUnlock(hGlobal);
return hGlobal;
}
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
UINT i;
int offset = 0, sizePidl, size;
HGLOBAL hGlobal;
LPIDA pcida;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
/* get the size needed */
size = sizeof(CIDA) + sizeof (UINT)*(cidl); /* header */
size += ILGetSize (pidlRoot); /* root pidl */
for(i=0; i<cidl; i++)
{
size += ILGetSize(apidl[i]); /* child pidls */
}
/* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
pcida = GlobalLock (hGlobal);
pcida->cidl = cidl;
/* root pidl */
offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
pcida->aoffset[0] = offset; /* first element */
sizePidl = ILGetSize (pidlRoot);
memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
offset += sizePidl;
for(i=0; i<cidl; i++) /* child pidls */
{
pcida->aoffset[i+1] = offset;
sizePidl = ILGetSize(apidl[i]);
memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
offset += sizePidl;
}
GlobalUnlock(hGlobal);
return hGlobal;
}
HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
FIXME("\n");
return 0;
}
HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
FIXME("\n");
return 0;
}
HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
FIXME("\n");
return 0;
}
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
int size = 0;
char szTemp[MAX_PATH], *szFileName;
LPITEMIDLIST pidl;
HGLOBAL hGlobal;
HRESULT hr;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
/* get path of combined pidl */
pidl = ILCombine(pidlRoot, apidl[0]);
if (!pidl)
return 0;
hr = SHELL_GetPathFromIDListA(pidl, szTemp, MAX_PATH);
SHFree(pidl);
if (FAILED(hr))
return 0;
size = strlen(szTemp) + 1;
/* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
szFileName = (char *)GlobalLock(hGlobal);
memcpy(szFileName, szTemp, size);
GlobalUnlock(hGlobal);
return hGlobal;
}
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
int size = 0;
WCHAR szTemp[MAX_PATH], *szFileName;
LPITEMIDLIST pidl;
HGLOBAL hGlobal;
HRESULT hr;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
/* get path of combined pidl */
pidl = ILCombine(pidlRoot, apidl[0]);
if (!pidl)
return 0;
hr = SHELL_GetPathFromIDListW(pidl, szTemp, MAX_PATH);
SHFree(pidl);
if (FAILED(hr))
return 0;
size = (strlenW(szTemp)+1) * sizeof(WCHAR);
/* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
szFileName = (WCHAR *)GlobalLock(hGlobal);
memcpy(szFileName, szTemp, size);
GlobalUnlock(hGlobal);
return hGlobal;
}
HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
{
DWORD * pdwFlag;
HGLOBAL hGlobal;
TRACE("(0x%08lx)\n", dwFlags);
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
if(!hGlobal) return hGlobal;
pdwFlag = (DWORD*)GlobalLock(hGlobal);
*pdwFlag = dwFlags;
GlobalUnlock(hGlobal);
return hGlobal;
}
/**************************************************************************
* IsDataInClipboard
*
* checks if there is something in the clipboard we can use
*/
BOOL IsDataInClipboard (HWND hwnd)
{
BOOL ret = FALSE;
if (OpenClipboard(hwnd))
{
if (GetOpenClipboardWindow())
{
ret = IsClipboardFormatAvailable(CF_TEXT);
}
CloseClipboard();
}
return ret;
}

View File

@@ -0,0 +1,499 @@
/* Control Panel management
*
* Copyright 2001 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/winbase16.h"
#include "wownt32.h"
#include "wine/debug.h"
#include "cpl.h"
#include "wine/unicode.h"
#define NO_SHLWAPI_REG
#include "shlwapi.h"
#include "cpanel.h"
WINE_DEFAULT_DEBUG_CHANNEL(shlctrl);
CPlApplet* Control_UnloadApplet(CPlApplet* applet)
{
unsigned i;
CPlApplet* next;
for (i = 0; i < applet->count; i++) {
if (!applet->info[i].dwSize) continue;
applet->proc(applet->hWnd, CPL_STOP, i, applet->info[i].lData);
}
if (applet->proc) applet->proc(applet->hWnd, CPL_EXIT, 0L, 0L);
FreeLibrary(applet->hModule);
next = applet->next;
HeapFree(GetProcessHeap(), 0, applet);
return next;
}
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
{
CPlApplet* applet;
unsigned i;
CPLINFO info;
NEWCPLINFOW newinfo;
if (!(applet = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet))))
return applet;
applet->hWnd = hWnd;
if (!(applet->hModule = LoadLibraryW(cmd))) {
WARN("Cannot load control panel applet %s\n", debugstr_w(cmd));
goto theError;
}
if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) {
WARN("Not a valid control panel applet %s\n", debugstr_w(cmd));
goto theError;
}
if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) {
WARN("Init of applet has failed\n");
goto theError;
}
if ((applet->count = applet->proc(hWnd, CPL_GETCOUNT, 0L, 0L)) == 0) {
WARN("No subprogram in applet\n");
goto theError;
}
applet = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet,
sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOW));
for (i = 0; i < applet->count; i++) {
ZeroMemory(&newinfo, sizeof(newinfo));
newinfo.dwSize = sizeof(NEWCPLINFOA);
applet->info[i].dwSize = sizeof(NEWCPLINFOW);
/* proc is supposed to return a null value upon success for
* CPL_INQUIRE and CPL_NEWINQUIRE
* However, real drivers don't seem to behave like this
* So, use introspection rather than return value
*/
applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo);
if (newinfo.hIcon == 0) {
applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
if (info.idIcon == 0 || info.idName == 0) {
WARN("Couldn't get info from sp %u\n", i);
applet->info[i].dwSize = 0;
} else {
/* convert the old data into the new structure */
applet->info[i].dwFlags = 0;
applet->info[i].dwHelpContext = 0;
applet->info[i].lData = info.lData;
applet->info[i].hIcon = LoadIconW(applet->hModule,
MAKEINTRESOURCEW(info.idIcon));
LoadStringW(applet->hModule, info.idName,
applet->info[i].szName, sizeof(applet->info[i].szName) / sizeof(WCHAR));
LoadStringW(applet->hModule, info.idInfo,
applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
applet->info[i].szHelpFile[0] = '\0';
}
}
else
{
CopyMemory(&applet->info[i], &newinfo, newinfo.dwSize);
if (newinfo.dwSize != sizeof(NEWCPLINFOW))
{
applet->info[i].dwSize = sizeof(NEWCPLINFOW);
MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szName,
sizeof(((LPNEWCPLINFOA)&newinfo)->szName) / sizeof(CHAR),
applet->info[i].szName,
sizeof(applet->info[i].szName) / sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szInfo,
sizeof(((LPNEWCPLINFOA)&newinfo)->szInfo) / sizeof(CHAR),
applet->info[i].szInfo,
sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szHelpFile,
sizeof(((LPNEWCPLINFOA)&newinfo)->szHelpFile) / sizeof(CHAR),
applet->info[i].szHelpFile,
sizeof(applet->info[i].szHelpFile) / sizeof(WCHAR));
}
}
}
applet->next = panel->first;
panel->first = applet;
return applet;
theError:
Control_UnloadApplet(applet);
return NULL;
}
static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTA* cs)
{
CPanel* panel = (CPanel*)cs->lpCreateParams;
SetWindowLongA(hWnd, 0, (LPARAM)panel);
panel->status = 0;
panel->hWnd = hWnd;
}
#define XICON 32
#define XSTEP 128
#define YICON 32
#define YSTEP 64
static BOOL Control_Localize(const CPanel* panel, unsigned cx, unsigned cy,
CPlApplet** papplet, unsigned* psp)
{
unsigned i, x = (XSTEP-XICON)/2, y = 0;
CPlApplet* applet;
RECT rc;
GetClientRect(panel->hWnd, &rc);
for (applet = panel->first; applet; applet = applet->next) {
for (i = 0; i < applet->count; i++) {
if (!applet->info[i].dwSize) continue;
if (x + XSTEP >= rc.right - rc.left) {
x = (XSTEP-XICON)/2;
y += YSTEP;
}
if (cx >= x && cx < x + XICON && cy >= y && cy < y + YSTEP) {
*papplet = applet;
*psp = i;
return TRUE;
}
x += XSTEP;
}
}
return FALSE;
}
static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rc, txtRect;
unsigned i, x = 0, y = 0;
CPlApplet* applet;
HGDIOBJ hOldFont;
hdc = (wParam) ? (HDC)wParam : BeginPaint(panel->hWnd, &ps);
hOldFont = SelectObject(hdc, GetStockObject(ANSI_VAR_FONT));
GetClientRect(panel->hWnd, &rc);
for (applet = panel->first; applet; applet = applet->next) {
for (i = 0; i < applet->count; i++) {
if (x + XSTEP >= rc.right - rc.left) {
x = 0;
y += YSTEP;
}
if (!applet->info[i].dwSize) continue;
DrawIcon(hdc, x + (XSTEP-XICON)/2, y, applet->info[i].hIcon);
txtRect.left = x;
txtRect.right = x + XSTEP;
txtRect.top = y + YICON;
txtRect.bottom = y + YSTEP;
DrawTextW(hdc, applet->info[i].szName, -1, &txtRect,
DT_CENTER | DT_VCENTER);
x += XSTEP;
}
}
SelectObject(hdc, hOldFont);
if (!wParam) EndPaint(panel->hWnd, &ps);
return 0;
}
static LRESULT Control_WndProc_LButton(CPanel* panel, LPARAM lParam, BOOL up)
{
unsigned i;
CPlApplet* applet;
if (Control_Localize(panel, LOWORD(lParam), HIWORD(lParam), &applet, &i)) {
if (up) {
if (panel->clkApplet == applet && panel->clkSP == i) {
applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData);
}
} else {
panel->clkApplet = applet;
panel->clkSP = i;
}
}
return 0;
}
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
WPARAM lParam1, LPARAM lParam2)
{
CPanel* panel = (CPanel*)GetWindowLongA(hWnd, 0);
if (panel || wMsg == WM_CREATE) {
switch (wMsg) {
case WM_CREATE:
Control_WndProc_Create(hWnd, (CREATESTRUCTA*)lParam2);
return 0;
case WM_DESTROY:
{
CPlApplet* applet = panel->first;
while (applet)
applet = Control_UnloadApplet(applet);
}
PostQuitMessage(0);
break;
case WM_PAINT:
return Control_WndProc_Paint(panel, lParam1);
case WM_LBUTTONUP:
return Control_WndProc_LButton(panel, lParam2, TRUE);
case WM_LBUTTONDOWN:
return Control_WndProc_LButton(panel, lParam2, FALSE);
/* EPP case WM_COMMAND: */
/* EPP return Control_WndProc_Command(mwi, lParam1, lParam2); */
}
}
return DefWindowProcA(hWnd, wMsg, lParam1, lParam2);
}
static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
{
WNDCLASSA wc;
MSG msg;
const CHAR* appName = "Wine Control Panel";
wc.style = CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc = Control_WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof(CPlApplet*);
wc.hInstance = hInst;
wc.hIcon = 0;
wc.hCursor = 0;
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = "Shell_Control_WndClass";
if (!RegisterClassA(&wc)) return;
CreateWindowExA(0, wc.lpszClassName, appName,
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hWnd, NULL, hInst, panel);
if (!panel->hWnd) return;
if (!panel->first) {
/* FIXME appName & message should be localized */
MessageBoxA(panel->hWnd, "Cannot load any applets", appName, MB_OK);
return;
}
while (GetMessageA(&msg, panel->hWnd, 0, 0)) {
TranslateMessage(&msg);
DispatchMessageA(&msg);
}
}
static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
{
HANDLE h;
WIN32_FIND_DATAW fd;
WCHAR buffer[MAX_PATH];
static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0};
WCHAR *p;
GetSystemDirectoryW( buffer, MAX_PATH );
p = buffer + strlenW(buffer);
*p++ = '\\';
lstrcpyW(p, wszAllCpl);
if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) {
do {
lstrcpyW(p, fd.cFileName);
Control_LoadApplet(hWnd, buffer, panel);
} while (FindNextFileW(h, &fd));
FindClose(h);
}
Control_DoInterface(panel, hWnd, hInst);
}
static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
/* forms to parse:
* foo.cpl,@sp,str
* foo.cpl,@sp
* foo.cpl,,str
* foo.cpl @sp
* foo.cpl str
* "a path\foo.cpl"
*/
{
LPWSTR buffer;
LPWSTR beg = NULL;
LPWSTR end;
WCHAR ch;
LPWSTR ptr;
unsigned sp = 0;
LPWSTR extraPmts = NULL;
int quoted = 0;
buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd));
if (!buffer) return;
end = lstrcpyW(buffer, wszCmd);
for (;;) {
ch = *end;
if (ch == '"') quoted = !quoted;
if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
*end = '\0';
if (beg) {
if (*beg == '@') {
sp = atoiW(beg + 1);
} else if (*beg == '\0') {
sp = 0;
} else {
extraPmts = beg;
}
}
if (ch == '\0') break;
beg = end + 1;
if (ch == ' ') while (end[1] == ' ') end++;
}
end++;
}
while ((ptr = StrChrW(buffer, '"')))
memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR));
TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp);
Control_LoadApplet(hWnd, buffer, panel);
if (panel->first) {
CPlApplet* applet = panel->first;
assert(applet && applet->next == NULL);
if (sp >= applet->count) {
WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
sp = 0;
}
if (applet->info[sp].dwSize) {
if (!applet->proc(applet->hWnd, CPL_STARTWPARMSA, sp, (LPARAM)extraPmts))
applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData);
}
Control_UnloadApplet(applet);
}
HeapFree(GetProcessHeap(), 0, buffer);
}
/*************************************************************************
* Control_RunDLLW [SHELL32.@]
*
*/
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
{
CPanel panel;
TRACE("(%p, %p, %s, 0x%08lx)\n",
hWnd, hInst, debugstr_w(cmd), nCmdShow);
memset(&panel, 0, sizeof(panel));
if (!cmd || !*cmd) {
Control_DoWindow(&panel, hWnd, hInst);
} else {
Control_DoLaunch(&panel, hWnd, cmd);
}
}
/*************************************************************************
* Control_RunDLLA [SHELL32.@]
*
*/
void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
{
DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 );
LPWSTR wszCmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len ))
{
Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow);
}
HeapFree(GetProcessHeap(), 0, wszCmd);
}
/*************************************************************************
* Control_FillCache_RunDLLW [SHELL32.@]
*
*/
HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
{
FIXME("%p %p 0x%08lx 0x%08lx stub\n", hWnd, hModule, w, x);
return 0;
}
/*************************************************************************
* Control_FillCache_RunDLLA [SHELL32.@]
*
*/
HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
{
return Control_FillCache_RunDLLW(hWnd, hModule, w, x);
}
/*************************************************************************
* RunDLL_CallEntry16 [SHELL32.122]
* the name is probably wrong
*/
void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
LPCSTR cmdline, INT cmdshow )
{
#if !defined(__CYGWIN__) && !defined (__MINGW32__) && !defined(_MSC_VER)
WORD args[5];
SEGPTR cmdline_seg;
TRACE( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
proc, hwnd, inst, debugstr_a(cmdline), cmdshow );
cmdline_seg = MapLS( cmdline );
args[4] = HWND_16(hwnd);
args[3] = MapHModuleLS(inst);
args[2] = SELECTOROF(cmdline_seg);
args[1] = OFFSETOF(cmdline_seg);
args[0] = cmdshow;
WOWCallback16Ex( proc, WCB16_PASCAL, sizeof(args), args, NULL );
UnMapLS( cmdline_seg );
#else
FIXME( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
proc, hwnd, inst, debugstr_a(cmdline), cmdshow );
#endif
}
/*************************************************************************
* CallCPLEntry16 [SHELL32.166]
*
* called by desk.cpl on "Advanced" with:
* hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0
*
*/
DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
{
FIXME("(%p, %p, %08lx, %08lx, %08lx, %08lx): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6);
return 0x0deadbee;
}

View File

@@ -0,0 +1,47 @@
/* Control Panel management
*
* Copyright 2001 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_SHELL_CPANEL_H
#define __WINE_SHELL_CPANEL_H
#include "cpl.h"
typedef struct CPlApplet {
struct CPlApplet* next; /* linked list */
HWND hWnd;
unsigned count; /* number of subprograms */
HMODULE hModule; /* module of loaded applet */
APPLET_PROC proc; /* entry point address */
NEWCPLINFOW info[1]; /* array of count information.
* dwSize field is 0 if entry is invalid */
} CPlApplet;
typedef struct CPanel {
CPlApplet* first; /* linked list */
HWND hWnd;
unsigned status;
CPlApplet* clkApplet;
unsigned clkSP;
} CPanel;
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel);
CPlApplet* Control_UnloadApplet(CPlApplet* applet);
#endif /* __WINE_SHELL_CPANEL_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,458 @@
/*
* IEnumFORMATETC, IDataObject
*
* selecting and droping objects within the shell and/or common dialogs
*
* Copyright 1998, 1999 <juergen.schmied@metronet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "wingdi.h"
#include "pidl.h"
#include "winerror.h"
#include "shell32_main.h"
#include "wine/debug.h"
#include "undocshell.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/***********************************************************************
* IEnumFORMATETC implementation
*/
typedef struct
{
/* IUnknown fields */
IEnumFORMATETCVtbl *lpVtbl;
DWORD ref;
/* IEnumFORMATETC fields */
UINT posFmt;
UINT countFmt;
LPFORMATETC pFmt;
} IEnumFORMATETCImpl;
static HRESULT WINAPI IEnumFORMATETC_fnQueryInterface(LPENUMFORMATETC iface, REFIID riid, LPVOID* ppvObj);
static ULONG WINAPI IEnumFORMATETC_fnAddRef(LPENUMFORMATETC iface);
static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface);
static HRESULT WINAPI IEnumFORMATETC_fnNext(LPENUMFORMATETC iface, ULONG celt, FORMATETC* rgelt, ULONG* pceltFethed);
static HRESULT WINAPI IEnumFORMATETC_fnSkip(LPENUMFORMATETC iface, ULONG celt);
static HRESULT WINAPI IEnumFORMATETC_fnReset(LPENUMFORMATETC iface);
static HRESULT WINAPI IEnumFORMATETC_fnClone(LPENUMFORMATETC iface, LPENUMFORMATETC* ppenum);
static struct IEnumFORMATETCVtbl efvt =
{
IEnumFORMATETC_fnQueryInterface,
IEnumFORMATETC_fnAddRef,
IEnumFORMATETC_fnRelease,
IEnumFORMATETC_fnNext,
IEnumFORMATETC_fnSkip,
IEnumFORMATETC_fnReset,
IEnumFORMATETC_fnClone
};
LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[])
{
IEnumFORMATETCImpl* ef;
DWORD size=cfmt * sizeof(FORMATETC);
ef=(IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl));
if(ef)
{
ef->ref=1;
ef->lpVtbl=&efvt;
ef->countFmt = cfmt;
ef->pFmt = SHAlloc (size);
if (ef->pFmt)
{
memcpy(ef->pFmt, afmt, size);
}
}
TRACE("(%p)->(%u,%p)\n",ef, cfmt, afmt);
return (LPENUMFORMATETC)ef;
}
static HRESULT WINAPI IEnumFORMATETC_fnQueryInterface(LPENUMFORMATETC iface, REFIID riid, LPVOID* ppvObj)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown))
{
*ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IEnumFORMATETC))
{
*ppvObj = (IEnumFORMATETC*)This;
}
if(*ppvObj)
{
IUnknown_AddRef((IUnknown*)(*ppvObj));
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
static ULONG WINAPI IEnumFORMATETC_fnAddRef(LPENUMFORMATETC iface)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This, This->ref);
return ++(This->ref);
}
static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->()\n",This);
if (!--(This->ref))
{
TRACE(" destroying IEnumFORMATETC(%p)\n",This);
if (This->pFmt)
{
SHFree (This->pFmt);
}
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
static HRESULT WINAPI IEnumFORMATETC_fnNext(LPENUMFORMATETC iface, ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
UINT i;
TRACE("(%p)->(%lu,%p)\n", This, celt, rgelt);
if(!This->pFmt)return S_FALSE;
if(!rgelt) return E_INVALIDARG;
if (pceltFethed) *pceltFethed = 0;
for(i = 0; This->posFmt < This->countFmt && celt > i; i++)
{
*rgelt++ = This->pFmt[This->posFmt++];
}
if (pceltFethed) *pceltFethed = i;
return ((i == celt) ? S_OK : S_FALSE);
}
static HRESULT WINAPI IEnumFORMATETC_fnSkip(LPENUMFORMATETC iface, ULONG celt)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->(num=%lu)\n", This, celt);
if((This->posFmt + celt) >= This->countFmt) return S_FALSE;
This->posFmt += celt;
return S_OK;
}
static HRESULT WINAPI IEnumFORMATETC_fnReset(LPENUMFORMATETC iface)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->()\n", This);
This->posFmt = 0;
return S_OK;
}
static HRESULT WINAPI IEnumFORMATETC_fnClone(LPENUMFORMATETC iface, LPENUMFORMATETC* ppenum)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->(ppenum=%p)\n", This, ppenum);
if (!ppenum) return E_INVALIDARG;
*ppenum = IEnumFORMATETC_Constructor(This->countFmt, This->pFmt);
if(*ppenum)
IEnumFORMATETC_fnSkip(*ppenum, This->posFmt);
return S_OK;
}
/***********************************************************************
* IDataObject implementation
*/
/* number of supported formats */
#define MAX_FORMATS 4
typedef struct
{
/* IUnknown fields */
IDataObjectVtbl *lpVtbl;
DWORD ref;
/* IDataObject fields */
LPITEMIDLIST pidl;
LPITEMIDLIST * apidl;
UINT cidl;
FORMATETC pFormatEtc[MAX_FORMATS];
UINT cfShellIDList;
UINT cfFileNameA;
UINT cfFileNameW;
} IDataObjectImpl;
static struct IDataObjectVtbl dtovt;
/**************************************************************************
* IDataObject_Constructor
*/
LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl)
{
IDataObjectImpl* dto;
dto = (IDataObjectImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDataObjectImpl));
if (dto)
{
dto->ref = 1;
dto->lpVtbl = &dtovt;
dto->pidl = ILClone(pMyPidl);
dto->apidl = _ILCopyaPidl(apidl, cidl);
dto->cidl = cidl;
dto->cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST);
dto->cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
dto->cfFileNameW = RegisterClipboardFormatA(CFSTR_FILENAMEW);
InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[2], dto->cfFileNameA, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[3], dto->cfFileNameW, TYMED_HGLOBAL);
}
TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl);
return (LPDATAOBJECT)dto;
}
/***************************************************************************
* IDataObject_QueryInterface
*/
static HRESULT WINAPI IDataObject_fnQueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{
*ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IDataObject)) /*IDataObject*/
{
*ppvObj = (IDataObject*)This;
}
if(*ppvObj)
{
IUnknown_AddRef((IUnknown*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/**************************************************************************
* IDataObject_AddRef
*/
static ULONG WINAPI IDataObject_fnAddRef(LPDATAOBJECT iface)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This, This->ref);
return ++(This->ref);
}
/**************************************************************************
* IDataObject_Release
*/
static ULONG WINAPI IDataObject_fnRelease(LPDATAOBJECT iface)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
TRACE("(%p)->()\n",This);
if (!--(This->ref))
{
TRACE(" destroying IDataObject(%p)\n",This);
_ILFreeaPidl(This->apidl, This->cidl);
ILFree(This->pidl),
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
/**************************************************************************
* IDataObject_fnGetData
*/
static HRESULT WINAPI IDataObject_fnGetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
char szTemp[256];
szTemp[0]=0;
GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
TRACE("(%p)->(%p %p format=%s)\n", This, pformatetcIn, pmedium, szTemp);
if (pformatetcIn->cfFormat == This->cfShellIDList)
{
if (This->cidl < 1) return(E_UNEXPECTED);
pmedium->u.hGlobal = RenderSHELLIDLIST(This->pidl, This->apidl, This->cidl);
}
else if (pformatetcIn->cfFormat == CF_HDROP)
{
if (This->cidl < 1) return(E_UNEXPECTED);
pmedium->u.hGlobal = RenderHDROP(This->pidl, This->apidl, This->cidl);
}
else if (pformatetcIn->cfFormat == This->cfFileNameA)
{
if (This->cidl < 1) return(E_UNEXPECTED);
pmedium->u.hGlobal = RenderFILENAMEA(This->pidl, This->apidl, This->cidl);
}
else if (pformatetcIn->cfFormat == This->cfFileNameW)
{
if (This->cidl < 1) return(E_UNEXPECTED);
pmedium->u.hGlobal = RenderFILENAMEW(This->pidl, This->apidl, This->cidl);
}
else
{
FIXME("-- expected clipformat not implemented\n");
return (E_INVALIDARG);
}
if (pmedium->u.hGlobal)
{
pmedium->tymed = TYMED_HGLOBAL;
pmedium->pUnkForRelease = NULL;
return S_OK;
}
return E_OUTOFMEMORY;
}
static HRESULT WINAPI IDataObject_fnGetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnQueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
UINT i;
TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat, pformatetc->tymed);
if(!(DVASPECT_CONTENT & pformatetc->dwAspect))
return DV_E_DVASPECT;
/* check our formats table what we have */
for (i=0; i<MAX_FORMATS; i++)
{
if ((This->pFormatEtc[i].cfFormat == pformatetc->cfFormat)
&& (This->pFormatEtc[i].tymed == pformatetc->tymed))
{
return S_OK;
}
}
return DV_E_TYMED;
}
static HRESULT WINAPI IDataObject_fnGetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnSetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnEnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
TRACE("(%p)->()\n", This);
*ppenumFormatEtc=NULL;
/* only get data */
if (DATADIR_GET == dwDirection)
{
*ppenumFormatEtc = IEnumFORMATETC_Constructor(MAX_FORMATS, This->pFormatEtc);
return (*ppenumFormatEtc) ? S_OK : E_FAIL;
}
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnDAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnDUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnEnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
{
IDataObjectImpl *This = (IDataObjectImpl *)iface;
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
}
static struct IDataObjectVtbl dtovt =
{
IDataObject_fnQueryInterface,
IDataObject_fnAddRef,
IDataObject_fnRelease,
IDataObject_fnGetData,
IDataObject_fnGetDataHere,
IDataObject_fnQueryGetData,
IDataObject_fnGetCanonicalFormatEtc,
IDataObject_fnSetData,
IDataObject_fnEnumFormatEtc,
IDataObject_fnDAdvise,
IDataObject_fnDUnadvise,
IDataObject_fnEnumDAdvise
};

View File

@@ -0,0 +1,338 @@
/*
* Helper functions for debugging
*
* Copyright 1998, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "windef.h"
#include "wingdi.h"
#include "pidl.h"
#include "shlguid.h"
#include "shldisp.h"
#include "wine/debug.h"
#include "debughlp.h"
#include "docobj.h"
#include "shell32_main.h"
WINE_DEFAULT_DEBUG_CHANNEL(pidl);
static
LPITEMIDLIST _dbg_ILGetNext(LPCITEMIDLIST pidl)
{
WORD len;
if(pidl)
{
len = pidl->mkid.cb;
if (len)
{
return (LPITEMIDLIST) (((LPBYTE)pidl)+len);
}
}
return NULL;
}
static
BOOL _dbg_ILIsDesktop(LPCITEMIDLIST pidl)
{
return ( !pidl || (pidl && pidl->mkid.cb == 0x00) );
}
static
LPPIDLDATA _dbg_ILGetDataPointer(LPCITEMIDLIST pidl)
{
if(pidl && pidl->mkid.cb != 0x00)
return (LPPIDLDATA) &(pidl->mkid.abID);
return NULL;
}
static
LPSTR _dbg_ILGetTextPointer(LPCITEMIDLIST pidl)
{
LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl);
if (pdata)
{
switch (pdata->type)
{
case PT_GUID:
case PT_SHELLEXT:
case PT_YAGUID:
return NULL;
case PT_DRIVE:
case PT_DRIVE1:
case PT_DRIVE2:
case PT_DRIVE3:
return (LPSTR)&(pdata->u.drive.szDriveName);
case PT_FOLDER:
case PT_FOLDER1:
case PT_VALUE:
case PT_IESPECIAL1:
case PT_IESPECIAL2:
return (LPSTR)&(pdata->u.file.szNames);
case PT_WORKGRP:
case PT_COMP:
case PT_NETWORK:
case PT_NETPROVIDER:
case PT_SHARE:
return (LPSTR)&(pdata->u.network.szNames);
}
}
return NULL;
}
static
LPSTR _dbg_ILGetSTextPointer(LPCITEMIDLIST pidl)
{
LPPIDLDATA pdata =_dbg_ILGetDataPointer(pidl);
if (pdata)
{
switch (pdata->type)
{
case PT_FOLDER:
case PT_VALUE:
case PT_IESPECIAL1:
case PT_IESPECIAL2:
return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1);
case PT_WORKGRP:
return (LPSTR)(pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1);
}
}
return NULL;
}
static
IID* _dbg_ILGetGUIDPointer(LPCITEMIDLIST pidl)
{
LPPIDLDATA pdata =_ILGetDataPointer(pidl);
if (pdata)
{
switch (pdata->type)
{
case PT_SHELLEXT:
case PT_GUID:
return &(pdata->u.guid.guid);
}
}
return NULL;
}
static
DWORD _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
{
DWORD dwReturn=0;
LPSTR szSrc;
GUID const * riid;
char szTemp[MAX_PATH];
if (!pidl) return 0;
if (szOut)
*szOut = 0;
if (_dbg_ILIsDesktop(pidl))
{
/* desktop */
if (szOut) strncpy(szOut, "Desktop", uOutSize);
dwReturn = strlen ("Desktop");
}
else if (( szSrc = _dbg_ILGetTextPointer(pidl) ))
{
/* filesystem */
if (szOut) strncpy(szOut, szSrc, uOutSize);
dwReturn = strlen(szSrc);
}
else if (( riid = _dbg_ILGetGUIDPointer(pidl) ))
{
if (szOut)
sprintf( szOut, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
dwReturn = strlen (szTemp);
}
return dwReturn;
}
void pdump (LPCITEMIDLIST pidl)
{
LPCITEMIDLIST pidltemp = pidl;
if (!TRACE_ON(pidl)) return;
if (! pidltemp)
{
MESSAGE ("-------- pidl=NULL (Desktop)\n");
}
else
{
MESSAGE ("-------- pidl=%p\n", pidl);
if (pidltemp->mkid.cb)
{
do
{
DWORD dwAttrib = 0;
LPPIDLDATA pData = _dbg_ILGetDataPointer(pidltemp);
DWORD type = pData->type;
LPSTR szLongName = _dbg_ILGetTextPointer(pidltemp);
LPSTR szShortName = _dbg_ILGetSTextPointer(pidltemp);
char szName[MAX_PATH];
_dbg_ILSimpleGetText(pidltemp, szName, MAX_PATH);
if( PT_FOLDER == type || PT_VALUE == type)
dwAttrib = pData->u.file.uFileAttribs;
MESSAGE ("[%p] size=%04u type=%lx attr=0x%08lx name=\"%s\" (%s,%s)\n",
pidltemp, pidltemp->mkid.cb,type,dwAttrib,szName,debugstr_a(szLongName), debugstr_a(szShortName));
pidltemp = _dbg_ILGetNext(pidltemp);
} while (pidltemp->mkid.cb);
}
else
{
MESSAGE ("empty pidl (Desktop)\n");
}
pcheck(pidl);
}
}
#define BYTES_PRINTED 32
BOOL pcheck (LPCITEMIDLIST pidl)
{
DWORD type, ret=TRUE;
LPCITEMIDLIST pidltemp = pidl;
if (pidltemp && pidltemp->mkid.cb)
{ do
{ type = _dbg_ILGetDataPointer(pidltemp)->type;
switch (type)
{ case PT_CPLAPPLET:
case PT_GUID:
case PT_SHELLEXT:
case PT_DRIVE:
case PT_DRIVE1:
case PT_DRIVE2:
case PT_DRIVE3:
case PT_FOLDER:
case PT_VALUE:
case PT_FOLDER1:
case PT_WORKGRP:
case PT_COMP:
case PT_NETPROVIDER:
case PT_NETWORK:
case PT_IESPECIAL1:
case PT_YAGUID:
case PT_IESPECIAL2:
case PT_SHARE:
break;
default:
{
char szTemp[BYTES_PRINTED*4 + 1];
int i;
unsigned char c;
memset(szTemp, ' ', BYTES_PRINTED*4 + 1);
for ( i = 0; (i<pidltemp->mkid.cb) && (i<BYTES_PRINTED); i++)
{
c = ((const unsigned char *)pidltemp)[i];
szTemp[i*3+0] = ((c>>4)>9)? (c>>4)+55 : (c>>4)+48;
szTemp[i*3+1] = ((0x0F&c)>9)? (0x0F&c)+55 : (0x0F&c)+48;
szTemp[i*3+2] = ' ';
szTemp[i+BYTES_PRINTED*3] = (c>=0x20 && c <=0x80) ? c : '.';
}
szTemp[BYTES_PRINTED*4] = 0x00;
ERR("unknown IDLIST %p [%p] size=%u type=%lx\n%s\n",pidl, pidltemp, pidltemp->mkid.cb,type, szTemp);
ret = FALSE;
}
}
pidltemp = _dbg_ILGetNext(pidltemp);
} while (pidltemp->mkid.cb);
}
return ret;
}
static char shdebugstr_buf1[100];
static char shdebugstr_buf2[100];
static char * shdebugstr_buf = shdebugstr_buf1;
static struct {
REFIID riid;
char *name;
} InterfaceDesc[] = {
{&IID_IUnknown, "IID_IUnknown"},
{&IID_IClassFactory, "IID_IClassFactory"},
{&IID_IShellView, "IID_IShellView"},
{&IID_IOleCommandTarget, "IID_IOleCommandTarget"},
{&IID_IDropTarget, "IID_IDropTarget"},
{&IID_IDropSource, "IID_IDropSource"},
{&IID_IViewObject, "IID_IViewObject"},
{&IID_IContextMenu, "IID_IContextMenu"},
{&IID_IShellExtInit, "IID_IShellExtInit"},
{&IID_IShellFolder, "IID_IShellFolder"},
{&IID_IShellFolder2, "IID_IShellFolder2"},
{&IID_IPersist, "IID_IPersist"},
{&IID_IPersistFolder, "IID_IPersistFolder"},
{&IID_IPersistFolder2, "IID_IPersistFolder2"},
{&IID_IPersistFolder3, "IID_IPersistFolder3"},
{&IID_IExtractIconA, "IID_IExtractIconA"},
{&IID_IExtractIconW, "IID_IExtractIconW"},
{&IID_IDataObject, "IID_IDataObject"},
{&IID_IAutoComplete, "IID_IAutoComplete"},
{&IID_IAutoComplete2, "IID_IAutoComplete2"},
{NULL,NULL}};
const char * shdebugstr_guid( const struct _GUID *id )
{
int i;
char* name = NULL;
char clsidbuf[100];
shdebugstr_buf = (shdebugstr_buf == shdebugstr_buf1) ? shdebugstr_buf2 : shdebugstr_buf1;
if (!id) {
strcpy (shdebugstr_buf, "(null)");
} else {
for (i=0;InterfaceDesc[i].riid && !name;i++) {
if (IsEqualIID(InterfaceDesc[i].riid, id)) name = InterfaceDesc[i].name;
}
if (!name) {
if (HCR_GetClassNameA(id, clsidbuf, 100))
name = clsidbuf;
}
sprintf( shdebugstr_buf, "\n\t{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x} (%s)",
id->Data1, id->Data2, id->Data3,
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7], name ? name : "unknown" );
}
return shdebugstr_buf;
}

View File

@@ -0,0 +1,35 @@
/*
* Definitions for debugging
*
* Copyright 1998, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_SHELL32_DEBUGHLP_H
#define __WINE_SHELL32_DEBUGHLP_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "shlobj.h"
extern void pdump (LPCITEMIDLIST pidl);
extern BOOL pcheck (LPCITEMIDLIST pidl);
extern const char * shdebugstr_guid( const struct _GUID *id );
#endif /* __WINE_SHELL32_DEBUGHLP_H */

View File

@@ -0,0 +1,446 @@
/*
* common shell dialogs
*
* Copyright 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "commdlg.h"
#include "wine/debug.h"
#include "shellapi.h"
#include "shlobj.h"
#include "shell32_main.h"
#include "shresdef.h"
#include "undocshell.h"
typedef struct
{
HWND hwndOwner ;
HICON hIcon ;
LPCSTR lpstrDirectory ;
LPCSTR lpstrTitle ;
LPCSTR lpstrDescription ;
UINT uFlags ;
} RUNFILEDLGPARAMS ;
typedef BOOL (*LPFNOFN) (OPENFILENAMEA *) ;
WINE_DEFAULT_DEBUG_CHANNEL(shell);
INT_PTR CALLBACK RunDlgProc (HWND, UINT, WPARAM, LPARAM) ;
void FillList (HWND, char *) ;
/*************************************************************************
* PickIconDlg [SHELL32.62]
*
*/
BOOL WINAPI PickIconDlg(
HWND hwndOwner,
LPSTR lpstrFile,
DWORD nMaxFile,
LPDWORD lpdwIconIndex)
{
FIXME("(%p,%s,%08lx,%p):stub.\n",
hwndOwner, lpstrFile, nMaxFile,lpdwIconIndex);
return 0xffffffff;
}
/*************************************************************************
* RunFileDlg [SHELL32.61]
*
* NOTES
* Original name: RunFileDlg (exported by ordinal)
*/
void WINAPI RunFileDlg(
HWND hwndOwner,
HICON hIcon,
LPCSTR lpstrDirectory,
LPCSTR lpstrTitle,
LPCSTR lpstrDescription,
UINT uFlags)
{
RUNFILEDLGPARAMS rfdp;
HRSRC hRes;
LPVOID template;
TRACE("\n");
rfdp.hwndOwner = hwndOwner;
rfdp.hIcon = hIcon;
rfdp.lpstrDirectory = lpstrDirectory;
rfdp.lpstrTitle = lpstrTitle;
rfdp.lpstrDescription = lpstrDescription;
rfdp.uFlags = uFlags;
if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_RUN_DLG", (LPSTR)RT_DIALOG)))
{
MessageBoxA (hwndOwner, "Couldn't find dialog.", "Nix", MB_OK) ;
return;
}
if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes)))
{
MessageBoxA (hwndOwner, "Couldn't load dialog.", "Nix", MB_OK) ;
return;
}
DialogBoxIndirectParamA((HINSTANCE)GetWindowLongPtrW( hwndOwner,
GWLP_HINSTANCE ),
template, hwndOwner, RunDlgProc, (LPARAM)&rfdp);
}
/* Dialog procedure for RunFileDlg */
INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int ic ;
char *psz, szMsg[256] ;
static RUNFILEDLGPARAMS *prfdp = NULL ;
switch (message)
{
case WM_INITDIALOG :
prfdp = (RUNFILEDLGPARAMS *)lParam ;
SetWindowTextA (hwnd, prfdp->lpstrTitle) ;
SetClassLongA (hwnd, GCL_HICON, (LPARAM)prfdp->hIcon) ;
SendMessageA (GetDlgItem (hwnd, 12297), STM_SETICON,
(WPARAM)LoadIconA (NULL, (LPSTR)IDI_WINLOGO), 0);
FillList (GetDlgItem (hwnd, 12298), NULL) ;
SetFocus (GetDlgItem (hwnd, 12298)) ;
return TRUE ;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDOK :
{
HWND htxt = NULL ;
if ((ic = GetWindowTextLengthA (htxt = GetDlgItem (hwnd, 12298))))
{
psz = HeapAlloc( GetProcessHeap(), 0, (ic + 2) );
GetWindowTextA (htxt, psz, ic + 1) ;
if (ShellExecuteA(NULL, "open", psz, NULL, NULL, SW_SHOWNORMAL) < (HINSTANCE)33)
{
char *pszSysMsg = NULL ;
FormatMessageA (
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError (),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&pszSysMsg, 0, NULL
) ;
sprintf (szMsg, "Error: %s", pszSysMsg) ;
LocalFree ((HLOCAL)pszSysMsg) ;
MessageBoxA (hwnd, szMsg, "Nix", MB_OK | MB_ICONEXCLAMATION) ;
HeapFree(GetProcessHeap(), 0, psz);
SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
return TRUE ;
}
FillList (htxt, psz) ;
HeapFree(GetProcessHeap(), 0, psz);
EndDialog (hwnd, 0) ;
}
}
case IDCANCEL :
EndDialog (hwnd, 0) ;
return TRUE ;
case 12288 :
{
HMODULE hComdlg = NULL ;
LPFNOFN ofnProc = NULL ;
static char szFName[1024] = "", szFileTitle[256] = "", szInitDir[768] = "" ;
static OPENFILENAMEA ofn =
{
sizeof (OPENFILENAMEA),
NULL,
NULL,
"Executable Files\0*.exe\0All Files\0*.*\0\0\0\0",
NULL,
0,
0,
szFName,
1023,
szFileTitle,
255,
(LPCSTR)szInitDir,
"Browse",
OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST,
0,
0,
NULL,
0,
(LPOFNHOOKPROC)NULL,
NULL
} ;
ofn.hwndOwner = hwnd ;
if (NULL == (hComdlg = LoadLibraryExA ("comdlg32", NULL, 0)))
{
MessageBoxA (hwnd, "Unable to display dialog box (LoadLibraryEx) !", "Nix", MB_OK | MB_ICONEXCLAMATION) ;
return TRUE ;
}
if ((LPFNOFN)NULL == (ofnProc = (LPFNOFN)GetProcAddress (hComdlg, "GetOpenFileNameA")))
{
MessageBoxA (hwnd, "Unable to display dialog box (GetProcAddress) !", "Nix", MB_OK | MB_ICONEXCLAMATION) ;
return TRUE ;
}
ofnProc (&ofn) ;
SetFocus (GetDlgItem (hwnd, IDOK)) ;
SetWindowTextA (GetDlgItem (hwnd, 12298), szFName) ;
SendMessageA (GetDlgItem (hwnd, 12298), CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
SetFocus (GetDlgItem (hwnd, IDOK)) ;
FreeLibrary (hComdlg) ;
return TRUE ;
}
}
return TRUE ;
}
return FALSE ;
}
/* This grabs the MRU list from the registry and fills the combo for the "Run" dialog above */
void FillList (HWND hCb, char *pszLatest)
{
HKEY hkey ;
/* char szDbgMsg[256] = "" ; */
char *pszList = NULL, *pszCmd = NULL, cMatch = 0, cMax = 0x60, szIndex[2] = "-" ;
DWORD icList = 0, icCmd = 0 ;
UINT Nix ;
SendMessageA (hCb, CB_RESETCONTENT, 0, 0) ;
if (ERROR_SUCCESS != RegCreateKeyExA (
HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU",
0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL))
MessageBoxA (hCb, "Unable to open registry key !", "Nix", MB_OK) ;
RegQueryValueExA (hkey, "MRUList", NULL, NULL, NULL, &icList) ;
if (icList > 0)
{
pszList = HeapAlloc( GetProcessHeap(), 0, icList) ;
if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, pszList, &icList))
MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK) ;
}
else
{
icList = 1 ;
pszList = HeapAlloc( GetProcessHeap(), 0, icList) ;
pszList[0] = 0 ;
}
for (Nix = 0 ; Nix < icList - 1 ; Nix++)
{
if (pszList[Nix] > cMax)
cMax = pszList[Nix] ;
szIndex[0] = pszList[Nix] ;
if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, NULL, &icCmd))
MessageBoxA (hCb, "Unable to grab size of index", "Nix", MB_OK) ;
if( pszCmd )
pszCmd = HeapReAlloc(GetProcessHeap(), 0, pszCmd, icCmd) ;
else
pszCmd = HeapAlloc(GetProcessHeap(), 0, icCmd) ;
if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, pszCmd, &icCmd))
MessageBoxA (hCb, "Unable to grab index", "Nix", MB_OK) ;
if (NULL != pszLatest)
{
if (!strcasecmp (pszCmd, pszLatest))
{
/*
sprintf (szDbgMsg, "Found existing (%d).\n", Nix) ;
MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ;
*/
SendMessageA (hCb, CB_INSERTSTRING, 0, (LPARAM)pszCmd) ;
SetWindowTextA (hCb, pszCmd) ;
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
cMatch = pszList[Nix] ;
memmove (&pszList[1], pszList, Nix) ;
pszList[0] = cMatch ;
continue ;
}
}
if (26 != icList - 1 || icList - 2 != Nix || cMatch || NULL == pszLatest)
{
/*
sprintf (szDbgMsg, "Happily appending (%d).\n", Nix) ;
MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ;
*/
SendMessageA (hCb, CB_ADDSTRING, 0, (LPARAM)pszCmd) ;
if (!Nix)
{
SetWindowTextA (hCb, pszCmd) ;
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
}
}
else
{
/*
sprintf (szDbgMsg, "Doing loop thing.\n") ;
MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ;
*/
SendMessageA (hCb, CB_INSERTSTRING, 0, (LPARAM)pszLatest) ;
SetWindowTextA (hCb, pszLatest) ;
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
cMatch = pszList[Nix] ;
memmove (&pszList[1], pszList, Nix) ;
pszList[0] = cMatch ;
szIndex[0] = cMatch ;
RegSetValueExA (hkey, szIndex, 0, REG_SZ, pszLatest, strlen (pszLatest) + 1) ;
}
}
if (!cMatch && NULL != pszLatest)
{
/*
sprintf (szDbgMsg, "Simply inserting (increasing list).\n") ;
MessageBoxA (hCb, szDbgMsg, "Nix", MB_OK) ;
*/
SendMessageA (hCb, CB_INSERTSTRING, 0, (LPARAM)pszLatest) ;
SetWindowTextA (hCb, pszLatest) ;
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
cMatch = ++cMax ;
if( pszList )
pszList = HeapReAlloc(GetProcessHeap(), 0, pszList, ++icList) ;
else
pszList = HeapAlloc(GetProcessHeap(), 0, ++icList) ;
memmove (&pszList[1], pszList, icList - 1) ;
pszList[0] = cMatch ;
szIndex[0] = cMatch ;
RegSetValueExA (hkey, szIndex, 0, REG_SZ, pszLatest, strlen (pszLatest) + 1) ;
}
RegSetValueExA (hkey, "MRUList", 0, REG_SZ, pszList, strlen (pszList) + 1) ;
HeapFree( GetProcessHeap(), 0, pszCmd) ;
HeapFree( GetProcessHeap(), 0, pszList) ;
}
/*************************************************************************
* ConfirmDialog [internal]
*
* Put up a confirm box, return TRUE if the user confirmed
*/
static BOOL ConfirmDialog(HWND hWndOwner, UINT PromptId, UINT TitleId)
{
WCHAR Prompt[256];
WCHAR Title[256];
LoadStringW(shell32_hInstance, PromptId, Prompt, sizeof(Prompt) / sizeof(WCHAR));
LoadStringW(shell32_hInstance, TitleId, Title, sizeof(Title) / sizeof(WCHAR));
return MessageBoxW(hWndOwner, Prompt, Title, MB_YESNO|MB_ICONQUESTION) == IDYES;
}
/*************************************************************************
* RestartDialogEx [SHELL32.730]
*/
int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)
{
TRACE("(%p)\n", hWndOwner);
/*FIXME: use uReason */
if (ConfirmDialog(hWndOwner, IDS_RESTART_PROMPT, IDS_RESTART_TITLE))
{
HANDLE hToken;
TOKEN_PRIVILEGES npr;
/* enable shutdown privilege for current process */
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
LookupPrivilegeValueA(0, "SeShutdownPrivilege", &npr.Privileges[0].Luid);
npr.PrivilegeCount = 1;
npr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
CloseHandle(hToken);
}
ExitWindowsEx(EWX_REBOOT, 0);
}
return 0;
}
/*************************************************************************
* RestartDialog [SHELL32.59]
*/
int WINAPI RestartDialog(HWND hWndOwner, LPCWSTR lpstrReason, DWORD uFlags)
{
return RestartDialogEx(hWndOwner, lpstrReason, uFlags, 0);
}
/*************************************************************************
* ExitWindowsDialog [SHELL32.60]
*
* NOTES
* exported by ordinal
*/
void WINAPI ExitWindowsDialog (HWND hWndOwner)
{
TRACE("(%p)\n", hWndOwner);
if (ConfirmDialog(hWndOwner, IDS_SHUTDOWN_PROMPT, IDS_SHUTDOWN_TITLE))
{
HANDLE hToken;
TOKEN_PRIVILEGES npr;
/* enable shutdown privilege for current process */
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
LookupPrivilegeValueA(0, "SeShutdownPrivilege", &npr.Privileges[0].Luid);
npr.PrivilegeCount = 1;
npr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
CloseHandle(hToken);
}
ExitWindowsEx(EWX_SHUTDOWN, 0);
}
}

View File

@@ -0,0 +1,186 @@
/*
* file system folder
*
* Copyright 1997 Marcus Meissner
* Copyright 1998, 1999, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "objbase.h"
#include "ole2.h"
#include "shlguid.h"
#include "shlobj.h"
#include "wine/debug.h"
#include "debughlp.h"
WINE_DEFAULT_DEBUG_CHANNEL (shell);
/***********************************************************************
* IDropTargetHelper implementation
*/
typedef struct {
IDropTargetHelperVtbl *lpVtbl;
DWORD ref;
} IDropTargetHelperImpl;
static struct IDropTargetHelperVtbl vt_IDropTargetHelper;
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IDropTargetHelper_(This) (IDropTargetHelper*)&(This->lpVtbl)
/**************************************************************************
* IDropTargetHelper_Constructor
*/
HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
IDropTargetHelperImpl *dth;
TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
if (!ppv)
return E_POINTER;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
dth = (IDropTargetHelperImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
if (!dth) return E_OUTOFMEMORY;
dth->ref = 0;
dth->lpVtbl = &vt_IDropTargetHelper;
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (dth), riid, ppv))) {
IUnknown_Release (_IUnknown_ (dth));
return E_NOINTERFACE;
}
TRACE ("--(%p)\n", dth);
return S_OK;
}
/**************************************************************************
* IDropTargetHelper_fnQueryInterface
*/
static HRESULT WINAPI IDropTargetHelper_fnQueryInterface (IDropTargetHelper * iface, REFIID riid, LPVOID * ppvObj)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
*ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IDropTargetHelper)) {
*ppvObj = This;
}
if (*ppvObj) {
IUnknown_AddRef ((IUnknown *) (*ppvObj));
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
FIXME ("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
static ULONG WINAPI IDropTargetHelper_fnAddRef (IDropTargetHelper * iface)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return ++(This->ref);
}
static ULONG WINAPI IDropTargetHelper_fnRelease (IDropTargetHelper * iface)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
if (!--(This->ref)) {
TRACE("-- destroying (%p)\n", This);
LocalFree ((HLOCAL) This);
return 0;
}
return This->ref;
}
static HRESULT WINAPI IDropTargetHelper_fnDragEnter (
IDropTargetHelper * iface,
HWND hwndTarget,
IDataObject* pDataObject,
POINT* ppt,
DWORD dwEffect)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
FIXME ("(%p)->(%p %p %p 0x%08lx)\n", This,hwndTarget, pDataObject, ppt, dwEffect);
return E_NOTIMPL;
}
static HRESULT WINAPI IDropTargetHelper_fnDragLeave (IDropTargetHelper * iface)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
FIXME ("(%p)->()\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI IDropTargetHelper_fnDragOver (IDropTargetHelper * iface, POINT* ppt, DWORD dwEffect)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
FIXME ("(%p)->(%p 0x%08lx)\n", This, ppt, dwEffect);
return E_NOTIMPL;
}
static HRESULT WINAPI IDropTargetHelper_fnDrop (IDropTargetHelper * iface, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
FIXME ("(%p)->(%p %p 0x%08lx)\n", This, pDataObject, ppt, dwEffect);
return E_NOTIMPL;
}
static HRESULT WINAPI IDropTargetHelper_fnShow (IDropTargetHelper * iface, BOOL fShow)
{
IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
FIXME ("(%p)->(%u)\n", This, fShow);
return E_NOTIMPL;
}
static IDropTargetHelperVtbl vt_IDropTargetHelper =
{
IDropTargetHelper_fnQueryInterface,
IDropTargetHelper_fnAddRef,
IDropTargetHelper_fnRelease,
IDropTargetHelper_fnDragEnter,
IDropTargetHelper_fnDragLeave,
IDropTargetHelper_fnDragOver,
IDropTargetHelper_fnDrop,
IDropTargetHelper_fnShow
};

View File

@@ -0,0 +1,376 @@
/*
* IEnumIDList
*
* Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "undocshell.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "pidl.h"
#include "shlguid.h"
#include "enumidlist.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct tagENUMLIST
{
struct tagENUMLIST *pNext;
LPITEMIDLIST pidl;
} ENUMLIST, *LPENUMLIST;
typedef struct
{
IEnumIDListVtbl *lpVtbl;
DWORD ref;
LPENUMLIST mpFirst;
LPENUMLIST mpLast;
LPENUMLIST mpCurrent;
} IEnumIDListImpl;
static struct IEnumIDListVtbl eidlvt;
/**************************************************************************
* AddToEnumList()
*/
BOOL AddToEnumList(
IEnumIDList * iface,
LPITEMIDLIST pidl)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
LPENUMLIST pNew;
TRACE("(%p)->(pidl=%p)\n",This,pidl);
if (!iface || !pidl)
return FALSE;
pNew = (LPENUMLIST)SHAlloc(sizeof(ENUMLIST));
if(pNew)
{
/*set the next pointer */
pNew->pNext = NULL;
pNew->pidl = pidl;
/*is This the first item in the list? */
if(!This->mpFirst)
{
This->mpFirst = pNew;
This->mpCurrent = pNew;
}
if(This->mpLast)
{
/*add the new item to the end of the list */
This->mpLast->pNext = pNew;
}
/*update the last item pointer */
This->mpLast = pNew;
TRACE("-- (%p)->(first=%p, last=%p)\n",This,This->mpFirst,This->mpLast);
return TRUE;
}
return FALSE;
}
/**************************************************************************
* CreateFolderEnumList()
*/
BOOL CreateFolderEnumList(
IEnumIDList *list,
LPCSTR lpszPath,
DWORD dwFlags)
{
LPITEMIDLIST pidl=NULL;
WIN32_FIND_DATAA stffile;
HANDLE hFile;
CHAR szPath[MAX_PATH];
BOOL succeeded = TRUE;
TRACE("(%p)->(path=%s flags=0x%08lx) \n",list,debugstr_a(lpszPath),dwFlags);
if(!lpszPath || !lpszPath[0]) return FALSE;
strcpy(szPath, lpszPath);
PathAddBackslashA(szPath);
strcat(szPath,"*.*");
hFile = FindFirstFileA(szPath,&stffile);
if ( hFile != INVALID_HANDLE_VALUE )
{
BOOL findFinished = FALSE;
do
{
if ( !(stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
|| (dwFlags & SHCONTF_INCLUDEHIDDEN) )
{
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
dwFlags & SHCONTF_FOLDERS &&
strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, ".."))
{
pidl = _ILCreateFromFindDataA(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl);
}
else if (!(stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
&& dwFlags & SHCONTF_NONFOLDERS)
{
pidl = _ILCreateFromFindDataA(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl);
}
}
if (succeeded)
{
if (!FindNextFileA(hFile, &stffile))
{
if (GetLastError() == ERROR_NO_MORE_FILES)
findFinished = TRUE;
else
succeeded = FALSE;
}
}
} while (succeeded && !findFinished);
FindClose(hFile);
}
return succeeded;
}
/**************************************************************************
* DeleteList()
*/
static BOOL DeleteList(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
LPENUMLIST pDelete;
TRACE("(%p)->()\n",This);
while(This->mpFirst)
{ pDelete = This->mpFirst;
This->mpFirst = pDelete->pNext;
SHFree(pDelete->pidl);
SHFree(pDelete);
}
This->mpFirst = This->mpLast = This->mpCurrent = NULL;
return TRUE;
}
/**************************************************************************
* IEnumIDList_Folder_Constructor
*
*/
IEnumIDList * IEnumIDList_Constructor(void)
{
IEnumIDListImpl *lpeidl = (IEnumIDListImpl*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IEnumIDListImpl));
if (lpeidl)
{
lpeidl->ref = 1;
lpeidl->lpVtbl = &eidlvt;
}
TRACE("-- (%p)->()\n",lpeidl);
return (IEnumIDList*)lpeidl;
}
/**************************************************************************
* EnumIDList_QueryInterface
*/
static HRESULT WINAPI IEnumIDList_fnQueryInterface(
IEnumIDList * iface,
REFIID riid,
LPVOID *ppvObj)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IEnumIDList)) /*IEnumIDList*/
{ *ppvObj = (IEnumIDList*)This;
}
if(*ppvObj)
{ IEnumIDList_AddRef((IEnumIDList*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/******************************************************************************
* IEnumIDList_fnAddRef
*/
static ULONG WINAPI IEnumIDList_fnAddRef(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)->(%lu)\n",This,This->ref);
return ++(This->ref);
}
/******************************************************************************
* IEnumIDList_fnRelease
*/
static ULONG WINAPI IEnumIDList_fnRelease(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)->(%lu)\n",This,This->ref);
if (!--(This->ref)) {
TRACE(" destroying IEnumIDList(%p)\n",This);
DeleteList((IEnumIDList*)This);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
/**************************************************************************
* IEnumIDList_fnNext
*/
static HRESULT WINAPI IEnumIDList_fnNext(
IEnumIDList * iface,
ULONG celt,
LPITEMIDLIST * rgelt,
ULONG *pceltFetched)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
ULONG i;
HRESULT hr = S_OK;
LPITEMIDLIST temp;
TRACE("(%p)->(%ld,%p, %p)\n",This,celt,rgelt,pceltFetched);
/* It is valid to leave pceltFetched NULL when celt is 1. Some of explorer's
* subsystems actually use it (and so may a third party browser)
*/
if(pceltFetched)
*pceltFetched = 0;
*rgelt=0;
if(celt > 1 && !pceltFetched)
{ return E_INVALIDARG;
}
if(celt > 0 && !This->mpCurrent)
{ return S_FALSE;
}
for(i = 0; i < celt; i++)
{ if(!(This->mpCurrent))
break;
temp = ILClone(This->mpCurrent->pidl);
rgelt[i] = temp;
This->mpCurrent = This->mpCurrent->pNext;
}
if(pceltFetched)
{ *pceltFetched = i;
}
return hr;
}
/**************************************************************************
* IEnumIDList_fnSkip
*/
static HRESULT WINAPI IEnumIDList_fnSkip(
IEnumIDList * iface,ULONG celt)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
DWORD dwIndex;
HRESULT hr = S_OK;
TRACE("(%p)->(%lu)\n",This,celt);
for(dwIndex = 0; dwIndex < celt; dwIndex++)
{ if(!This->mpCurrent)
{ hr = S_FALSE;
break;
}
This->mpCurrent = This->mpCurrent->pNext;
}
return hr;
}
/**************************************************************************
* IEnumIDList_fnReset
*/
static HRESULT WINAPI IEnumIDList_fnReset(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)\n",This);
This->mpCurrent = This->mpFirst;
return S_OK;
}
/**************************************************************************
* IEnumIDList_fnClone
*/
static HRESULT WINAPI IEnumIDList_fnClone(
IEnumIDList * iface,LPENUMIDLIST * ppenum)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)->() to (%p)->() E_NOTIMPL\n",This,ppenum);
return E_NOTIMPL;
}
/**************************************************************************
* IEnumIDList_fnVTable
*/
static IEnumIDListVtbl eidlvt =
{
IEnumIDList_fnQueryInterface,
IEnumIDList_fnAddRef,
IEnumIDList_fnRelease,
IEnumIDList_fnNext,
IEnumIDList_fnSkip,
IEnumIDList_fnReset,
IEnumIDList_fnClone,
};

View File

@@ -0,0 +1,30 @@
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ENUMIDLIST_H__
#define __ENUMIDLIST_H__
#include "shlobj.h"
/* Creates an IEnumIDList; add LPITEMIDLISTs to it with AddToEnumList. */
LPENUMIDLIST IEnumIDList_Constructor(void);
BOOL AddToEnumList(IEnumIDList *list, LPITEMIDLIST pidl);
/* Enumerates the folders and/or files (depending on dwFlags) in lpszPath and
* adds them to the already-created list.
*/
BOOL CreateFolderEnumList(IEnumIDList *list, LPCSTR lpszPath, DWORD dwFlags);
#endif /* ndef __ENUMIDLIST_H__ */

View File

@@ -0,0 +1,560 @@
/*
* Copyright 1997 Marcus Meissner
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "objbase.h"
#include "undocshell.h"
#include "shlguid.h"
#include "winreg.h"
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "pidl.h"
#include "shell32_main.h"
#include "shfldr.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/***********************************************************************
* IExtractIconW implementation
*/
typedef struct
{
IExtractIconWVtbl *lpVtbl;
DWORD ref;
IPersistFileVtbl *lpvtblPersistFile;
IExtractIconAVtbl *lpvtblExtractIconA;
LPITEMIDLIST pidl;
} IExtractIconWImpl;
static struct IExtractIconAVtbl eiavt;
static struct IExtractIconWVtbl eivt;
static struct IPersistFileVtbl pfvt;
#define _IPersistFile_Offset ((int)(&(((IExtractIconWImpl*)0)->lpvtblPersistFile)))
#define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset);
#define _IExtractIconA_Offset ((int)(&(((IExtractIconWImpl*)0)->lpvtblExtractIconA)))
#define _ICOM_THIS_From_IExtractIconA(class, name) class* This = (class*)(((char*)name)-_IExtractIconA_Offset);
/**************************************************************************
* IExtractIconW_Constructor
*/
IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
{
IExtractIconWImpl* ei;
TRACE("%p\n", pidl);
ei = (IExtractIconWImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
ei->ref=1;
ei->lpVtbl = &eivt;
ei->lpvtblPersistFile = &pfvt;
ei->lpvtblExtractIconA = &eiavt;
ei->pidl=ILClone(pidl);
pdump(pidl);
TRACE("(%p)\n", ei);
return (IExtractIconW *)ei;
}
/**************************************************************************
* IExtractIconW_QueryInterface
*/
static HRESULT WINAPI IExtractIconW_fnQueryInterface(IExtractIconW *iface, REFIID riid, LPVOID *ppvObj)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n", This, debugstr_guid(riid), ppvObj);
*ppvObj = NULL;
if (IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{
*ppvObj = This;
}
else if (IsEqualIID(riid, &IID_IPersistFile)) /*IExtractIcon*/
{
*ppvObj = (IPersistFile*)&(This->lpvtblPersistFile);
}
else if (IsEqualIID(riid, &IID_IExtractIconA)) /*IExtractIcon*/
{
*ppvObj = (IExtractIconA*)&(This->lpvtblExtractIconA);
}
else if (IsEqualIID(riid, &IID_IExtractIconW)) /*IExtractIcon*/
{
*ppvObj = (IExtractIconW*)This;
}
if(*ppvObj)
{
IExtractIconW_AddRef((IExtractIconW*) *ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/**************************************************************************
* IExtractIconW_AddRef
*/
static ULONG WINAPI IExtractIconW_fnAddRef(IExtractIconW * iface)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This, This->ref );
return ++(This->ref);
}
/**************************************************************************
* IExtractIconW_Release
*/
static ULONG WINAPI IExtractIconW_fnRelease(IExtractIconW * iface)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
TRACE("(%p)->()\n",This);
if (!--(This->ref))
{
TRACE(" destroying IExtractIcon(%p)\n",This);
SHFree(This->pidl);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
static HRESULT getIconLocationForFolder(IExtractIconW *iface, UINT uFlags,
LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
DWORD dwNr;
WCHAR wszPath[MAX_PATH];
WCHAR wszCLSIDValue[CHARS_IN_GUID];
static const WCHAR shellClassInfo[] = { '.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0 };
static const WCHAR iconFile[] = { 'I','c','o','n','F','i','l','e',0 };
static const WCHAR clsid[] = { 'C','L','S','I','D',0 };
static const WCHAR clsid2[] = { 'C','L','S','I','D','2',0 };
static const WCHAR iconIndex[] = { 'I','c','o','n','I','n','d','e','x',0 };
if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, iconFile,
wszPath, MAX_PATH))
{
WCHAR wszIconIndex[10];
SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, iconIndex,
wszIconIndex, 10);
*piIndex = atoiW(wszIconIndex);
}
else if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, clsid,
wszCLSIDValue, CHARS_IN_GUID) &&
HCR_GetDefaultIconW(wszCLSIDValue, szIconFile, cchMax, &dwNr))
{
*piIndex = dwNr;
}
else if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, clsid2,
wszCLSIDValue, CHARS_IN_GUID) &&
HCR_GetDefaultIconW(wszCLSIDValue, szIconFile, cchMax, &dwNr))
{
*piIndex = dwNr;
}
else
{
static const WCHAR folder[] = { 'F','o','l','d','e','r',0 };
if (!HCR_GetDefaultIconW(folder, szIconFile, cchMax, &dwNr))
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
dwNr = 3;
}
*piIndex = (uFlags & GIL_OPENICON) ? dwNr + 1 : dwNr;
}
return S_OK;
}
WCHAR swShell32Name[MAX_PATH];
/**************************************************************************
* IExtractIconW_GetIconLocation
*
* mapping filetype to icon
*/
static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
IExtractIconW * iface,
UINT uFlags, /* GIL_ flags */
LPWSTR szIconFile,
UINT cchMax,
int * piIndex,
UINT * pwFlags) /* returned GIL_ flags */
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
char sTemp[MAX_PATH];
DWORD dwNr;
GUID const * riid;
LPITEMIDLIST pSimplePidl = ILFindLastID(This->pidl);
TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags);
if (pwFlags)
*pwFlags = 0;
if (_ILIsDesktop(pSimplePidl))
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
*piIndex = 34;
}
/* my computer and other shell extensions */
else if ((riid = _ILGetGUIDPointer(pSimplePidl)))
{
static const WCHAR fmt[] = { 'C','L','S','I','D','\\',
'{','%','0','8','l','x','-','%','0','4','x','-','%','0','4','x','-',
'%','0','2','x','%','0','2','x','-','%','0','2','x', '%','0','2','x',
'%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0 };
WCHAR xriid[50];
sprintfW(xriid, fmt,
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]);
if (HCR_GetDefaultIconW(xriid, szIconFile, cchMax, &dwNr))
{
*piIndex = dwNr;
}
else
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
*piIndex = 15;
}
}
else if (_ILIsDrive (pSimplePidl))
{
static const WCHAR drive[] = { 'D','r','i','v','e',0 };
int icon_idx = -1;
if (_ILGetDrive(pSimplePidl, sTemp, MAX_PATH))
{
switch(GetDriveTypeA(sTemp))
{
case DRIVE_REMOVABLE: icon_idx = 5; break;
case DRIVE_CDROM: icon_idx = 11; break;
case DRIVE_REMOTE: icon_idx = 9; break;
case DRIVE_RAMDISK: icon_idx = 12; break;
}
}
if (icon_idx != -1)
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
*piIndex = icon_idx;
}
else
{
if (HCR_GetDefaultIconW(drive, szIconFile, cchMax, &dwNr))
{
*piIndex = dwNr;
}
else
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
*piIndex = 8;
}
}
}
else if (_ILIsFolder (pSimplePidl))
{
getIconLocationForFolder(iface, uFlags, szIconFile, cchMax, piIndex,
pwFlags);
}
else
{
BOOL found = FALSE;
if (_ILIsCPanelStruct(pSimplePidl))
{
if (SUCCEEDED(CPanel_GetIconLocationW(pSimplePidl, szIconFile, cchMax, piIndex)))
found = TRUE;
}
else if (_ILGetExtension(pSimplePidl, sTemp, MAX_PATH))
{
if (HCR_MapTypeToValueA(sTemp, sTemp, MAX_PATH, TRUE)
&& HCR_GetDefaultIconA(sTemp, sTemp, MAX_PATH, &dwNr))
{
if (!lstrcmpA("%1", sTemp)) /* icon is in the file */
{
SHGetPathFromIDListW(This->pidl, szIconFile);
*piIndex = 0;
}
else
{
MultiByteToWideChar(CP_ACP, 0, sTemp, -1, szIconFile, cchMax);
*piIndex = dwNr;
}
found = TRUE;
}
else if (!strcasecmp(sTemp, "lnkfile"))
{
/* extract icon from shell shortcut */
IShellFolder* dsf;
IShellLinkW* psl;
if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
{
HRESULT hr = IShellFolder_GetUIObjectOf(dsf, NULL, 1, (LPCITEMIDLIST*)&This->pidl, &IID_IShellLinkW, NULL, (LPVOID*)&psl);
if (SUCCEEDED(hr))
{
hr = IShellLinkW_GetIconLocation(psl, szIconFile, MAX_PATH, piIndex);
if (SUCCEEDED(hr) && *szIconFile)
found = TRUE;
IShellLinkW_Release(psl);
}
IShellFolder_Release(dsf);
}
}
}
if (!found) /* default icon */
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
*piIndex = 0;
}
}
TRACE("-- %s %x\n", debugstr_w(szIconFile), *piIndex);
return NOERROR;
}
/**************************************************************************
* IExtractIconW_Extract
*/
static HRESULT WINAPI IExtractIconW_fnExtract(IExtractIconW * iface, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
FIXME("(%p) (file=%p index=%u %p %p size=%u) semi-stub\n", This, debugstr_w(pszFile), nIconIndex, phiconLarge, phiconSmall, nIconSize);
if (phiconLarge)
*phiconLarge = ImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
if (phiconSmall)
*phiconSmall = ImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
return S_OK;
}
static struct IExtractIconWVtbl eivt =
{
IExtractIconW_fnQueryInterface,
IExtractIconW_fnAddRef,
IExtractIconW_fnRelease,
IExtractIconW_fnGetIconLocation,
IExtractIconW_fnExtract
};
/**************************************************************************
* IExtractIconA_Constructor
*/
IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)IExtractIconW_Constructor(pidl);
IExtractIconA *eia = (IExtractIconA *)&This->lpvtblExtractIconA;
TRACE("(%p)->(%p)\n", This, eia);
return eia;
}
/**************************************************************************
* IExtractIconA_QueryInterface
*/
static HRESULT WINAPI IExtractIconA_fnQueryInterface(IExtractIconA * iface, REFIID riid, LPVOID *ppvObj)
{
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
return IExtractIconW_QueryInterface(This, riid, ppvObj);
}
/**************************************************************************
* IExtractIconA_AddRef
*/
static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface)
{
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
return IExtractIconW_AddRef(This);
}
/**************************************************************************
* IExtractIconA_Release
*/
static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface)
{
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
return IExtractIconW_AddRef(This);
}
/**************************************************************************
* IExtractIconA_GetIconLocation
*
* mapping filetype to icon
*/
static HRESULT WINAPI IExtractIconA_fnGetIconLocation(
IExtractIconA * iface,
UINT uFlags,
LPSTR szIconFile,
UINT cchMax,
int * piIndex,
UINT * pwFlags)
{
HRESULT ret;
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR));
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags);
ret = IExtractIconW_GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags);
WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL);
HeapFree(GetProcessHeap(), 0, lpwstrFile);
TRACE("-- %s %x\n", szIconFile, *piIndex);
return ret;
}
/**************************************************************************
* IExtractIconA_Extract
*/
static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
{
HRESULT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0);
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len);
ret = IExtractIconW_Extract(This, lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret;
}
static struct IExtractIconAVtbl eiavt =
{
IExtractIconA_fnQueryInterface,
IExtractIconA_fnAddRef,
IExtractIconA_fnRelease,
IExtractIconA_fnGetIconLocation,
IExtractIconA_fnExtract
};
/************************************************************************
* IEIPersistFile_QueryInterface (IUnknown)
*/
static HRESULT WINAPI IEIPersistFile_fnQueryInterface(
IPersistFile *iface,
REFIID iid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
return IExtractIconW_QueryInterface(This, iid, ppvObj);
}
/************************************************************************
* IEIPersistFile_AddRef (IUnknown)
*/
static ULONG WINAPI IEIPersistFile_fnAddRef(
IPersistFile *iface)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
return IExtractIconW_AddRef(This);
}
/************************************************************************
* IEIPersistFile_Release (IUnknown)
*/
static ULONG WINAPI IEIPersistFile_fnRelease(
IPersistFile *iface)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
return IExtractIconW_Release(This);
}
/************************************************************************
* IEIPersistFile_GetClassID (IPersist)
*/
static HRESULT WINAPI IEIPersistFile_fnGetClassID(
IPersistFile *iface,
LPCLSID lpClassId)
{
CLSID StdFolderID = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} };
if (lpClassId==NULL)
return E_POINTER;
memcpy(lpClassId, &StdFolderID, sizeof(StdFolderID));
return S_OK;
}
/************************************************************************
* IEIPersistFile_Load (IPersistFile)
*/
static HRESULT WINAPI IEIPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
FIXME("%p\n", This);
return E_NOTIMPL;
}
static struct IPersistFileVtbl pfvt =
{
IEIPersistFile_fnQueryInterface,
IEIPersistFile_fnAddRef,
IEIPersistFile_fnRelease,
IEIPersistFile_fnGetClassID,
(void *) 0xdeadbeef /* IEIPersistFile_fnIsDirty */,
IEIPersistFile_fnLoad,
(void *) 0xdeadbeef /* IEIPersistFile_fnSave */,
(void *) 0xdeadbeef /* IEIPersistFile_fnSaveCompleted */,
(void *) 0xdeadbeef /* IEIPersistFile_fnGetCurFile */
};

View File

@@ -0,0 +1,594 @@
/*
* shell icon cache (SIC)
*
* Copyright 1998, 1999 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "wine/debug.h"
#include "shellapi.h"
#include "objbase.h"
#include "shlguid.h"
#include "pidl.h"
#include "shell32_main.h"
#include "undocshell.h"
#include "shlwapi.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/********************** THE ICON CACHE ********************************/
#define INVALID_INDEX -1
typedef struct
{
LPWSTR sSourceFile; /* file (not path!) containing the icon */
DWORD dwSourceIndex; /* index within the file, if it is a resoure ID it will be negated */
DWORD dwListIndex; /* index within the iconlist */
DWORD dwFlags; /* GIL_* flags */
DWORD dwAccessTime;
} SIC_ENTRY, * LPSIC_ENTRY;
static HDPA sic_hdpa = 0;
static CRITICAL_SECTION SHELL32_SicCS;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &SHELL32_SicCS,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { 0, (DWORD)(__FILE__ ": SHELL32_SicCS") }
};
static CRITICAL_SECTION SHELL32_SicCS = { &critsect_debug, -1, 0, 0, 0, 0 };
/*****************************************************************************
* SIC_CompareEntries
*
* NOTES
* Callback for DPA_Search
*/
static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam)
{ TRACE("%p %p %8lx\n", p1, p2, lparam);
if (((LPSIC_ENTRY)p1)->dwSourceIndex != ((LPSIC_ENTRY)p2)->dwSourceIndex) /* first the faster one*/
return 1;
if (strcmpiW(((LPSIC_ENTRY)p1)->sSourceFile,((LPSIC_ENTRY)p2)->sSourceFile))
return 1;
return 0;
}
/*****************************************************************************
* SIC_IconAppend [internal]
*
* NOTES
* appends an icon pair to the end of the cache
*/
static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon)
{ LPSIC_ENTRY lpsice;
INT ret, index, index1;
WCHAR path[MAX_PATH];
TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) );
strcpyW( lpsice->sSourceFile, path );
lpsice->dwSourceIndex = dwSourceIndex;
EnterCriticalSection(&SHELL32_SicCS);
index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
if ( INVALID_INDEX == index )
{
HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
SHFree(lpsice);
ret = INVALID_INDEX;
}
else
{
index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
if (index!=index1)
{
FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1);
}
lpsice->dwListIndex = index;
ret = lpsice->dwListIndex;
}
LeaveCriticalSection(&SHELL32_SicCS);
return ret;
}
/****************************************************************************
* SIC_LoadIcon [internal]
*
* NOTES
* gets small/big icon by number from a file
*/
static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex)
{ HICON hiconLarge=0;
HICON hiconSmall=0;
#if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
if (!PrivateExtractIconExW) {
HMODULE hUser32 = GetModuleHandleA("user32");
PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
}
if (PrivateExtractIconExW)
PrivateExtractIconExW(sSourceFile, dwSourceIndex, &hiconLarge, &hiconSmall, 1);
else
#endif
{
PrivateExtractIconsW(sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, NULL, 1, 0);
PrivateExtractIconsW(sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, NULL, 1, 0);
}
if ( !hiconLarge || !hiconSmall)
{
WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall);
return -1;
}
return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge);
}
/*****************************************************************************
* SIC_GetIconIndex [internal]
*
* Parameters
* sSourceFile [IN] filename of file containing the icon
* index [IN] index/resID (negated) in this file
*
* NOTES
* look in the cache for a proper icon. if not available the icon is taken
* from the file and cached
*/
INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex )
{
SIC_ENTRY sice;
INT ret, index = INVALID_INDEX;
WCHAR path[MAX_PATH];
TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
sice.sSourceFile = path;
sice.dwSourceIndex = dwSourceIndex;
EnterCriticalSection(&SHELL32_SicCS);
if (NULL != DPA_GetPtr (sic_hdpa, 0))
{
/* search linear from position 0*/
index = DPA_Search (sic_hdpa, &sice, 0, SIC_CompareEntries, 0, 0);
}
if ( INVALID_INDEX == index )
{
ret = SIC_LoadIcon (sSourceFile, dwSourceIndex);
}
else
{
TRACE("-- found\n");
ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
}
LeaveCriticalSection(&SHELL32_SicCS);
return ret;
}
/*****************************************************************************
* SIC_Initialize [internal]
*
* NOTES
* hack to load the resources from the shell32.dll under a different dll name
* will be removed when the resource-compiler is ready
*/
BOOL SIC_Initialize(void)
{
HICON hSm, hLg;
UINT index;
int cx_small, cy_small;
int cx_large, cy_large;
cx_small = GetSystemMetrics(SM_CXSMICON);
cy_small = GetSystemMetrics(SM_CYSMICON);
cx_large = GetSystemMetrics(SM_CXICON);
cy_large = GetSystemMetrics(SM_CYICON);
TRACE("\n");
if (sic_hdpa) /* already initialized?*/
return TRUE;
sic_hdpa = DPA_Create(16);
if (!sic_hdpa)
{
return(FALSE);
}
ShellSmallIconList = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,0x20);
ShellBigIconList = ImageList_Create(32,32,ILC_COLOR32|ILC_MASK,0,0x20);
ImageList_SetBkColor(ShellSmallIconList, CLR_NONE);
ImageList_SetBkColor(ShellBigIconList, CLR_NONE);
for (index=1; index<39; index++)
{
hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_large, cy_large, LR_SHARED);
if(!hSm)
{
hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(1), IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(1), IMAGE_ICON, cx_large, cy_large, LR_SHARED);
}
SIC_IconAppend (swShell32Name, index, hSm, hLg);
}
TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
return TRUE;
}
/*************************************************************************
* SIC_Destroy
*
* frees the cache
*/
static INT CALLBACK sic_free( LPVOID ptr, LPVOID lparam )
{
HeapFree(GetProcessHeap(), 0, ((LPSIC_ENTRY)ptr)->sSourceFile);
SHFree(ptr);
return TRUE;
}
void SIC_Destroy(void)
{
TRACE("\n");
EnterCriticalSection(&SHELL32_SicCS);
if (sic_hdpa) DPA_DestroyCallback(sic_hdpa, sic_free, NULL );
sic_hdpa = NULL;
ImageList_Destroy(ShellSmallIconList);
ShellSmallIconList = 0;
ImageList_Destroy(ShellBigIconList);
ShellBigIconList = 0;
LeaveCriticalSection(&SHELL32_SicCS);
DeleteCriticalSection(&SHELL32_SicCS);
}
/*************************************************************************
* Shell_GetImageList [SHELL32.71]
*
* PARAMETERS
* imglist[1|2] [OUT] pointer which receives imagelist handles
*
*/
BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList)
{ TRACE("(%p,%p)\n",lpBigList,lpSmallList);
if (lpBigList)
{ *lpBigList = ShellBigIconList;
}
if (lpSmallList)
{ *lpSmallList = ShellSmallIconList;
}
return TRUE;
}
/*************************************************************************
* PidlToSicIndex [INTERNAL]
*
* PARAMETERS
* sh [IN] IShellFolder
* pidl [IN]
* bBigIcon [IN]
* uFlags [IN] GIL_*
* pIndex [OUT] index within the SIC
*
*/
BOOL PidlToSicIndex (
IShellFolder * sh,
LPCITEMIDLIST pidl,
BOOL bBigIcon,
UINT uFlags,
int * pIndex)
{
IExtractIconW *ei;
WCHAR szIconFile[MAX_PATH]; /* file containing the icon */
INT iSourceIndex; /* index or resID(negated) in this file */
BOOL ret = FALSE;
UINT dwFlags = 0;
TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
if (SUCCEEDED (IShellFolder_GetUIObjectOf(sh, 0, 1, &pidl, &IID_IExtractIconW, 0, (void **)&ei)))
{
if (SUCCEEDED(IExtractIconW_GetIconLocation(ei, uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
{
*pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex);
ret = TRUE;
}
IExtractIconW_Release(ei);
}
if (INVALID_INDEX == *pIndex) /* default icon when failed */
*pIndex = 0;
return ret;
}
/*************************************************************************
* SHMapPIDLToSystemImageListIndex [SHELL32.77]
*
* PARAMETERS
* sh [IN] pointer to an instance of IShellFolder
* pidl [IN]
* pIndex [OUT][OPTIONAL] SIC index for big icon
*
*/
int WINAPI SHMapPIDLToSystemImageListIndex(
IShellFolder *sh,
LPCITEMIDLIST pidl,
int *pIndex)
{
int Index;
TRACE("(SF=%p,pidl=%p,%p)\n",sh,pidl,pIndex);
pdump(pidl);
if (pIndex)
if (!PidlToSicIndex ( sh, pidl, 1, 0, pIndex))
*pIndex = -1;
if (!PidlToSicIndex ( sh, pidl, 0, 0, &Index))
return -1;
return Index;
}
/*************************************************************************
* Shell_GetCachedImageIndex [SHELL32.72]
*
*/
INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc)
{
INT ret, len;
LPWSTR szTemp;
WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc);
len = MultiByteToWideChar( CP_ACP, 0, szPath, -1, NULL, 0 );
szTemp = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, szPath, -1, szTemp, len );
ret = SIC_GetIconIndex( szTemp, nIndex );
HeapFree( GetProcessHeap(), 0, szTemp );
return ret;
}
INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc)
{
WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc);
return SIC_GetIconIndex(szPath, nIndex);
}
INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc)
{ if( SHELL_OsIsUnicode())
return Shell_GetCachedImageIndexW(szPath, nIndex, bSimulateDoc);
return Shell_GetCachedImageIndexA(szPath, nIndex, bSimulateDoc);
}
/*************************************************************************
* ExtractIconEx [SHELL32.@]
*/
UINT WINAPI ExtractIconExAW(LPCVOID lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons)
{ if (SHELL_OsIsUnicode())
return ExtractIconExW ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
return ExtractIconExA ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
}
/*************************************************************************
* ExtractIconExW [SHELL32.@]
* RETURNS
* 0 no icon found
* -1 file is not valid
* or number of icons extracted
*/
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons)
{
/* get entry point of undocumented function PrivateExtractIconExW() in user32 */
#if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
if (!PrivateExtractIconExW) {
HMODULE hUser32 = GetModuleHandleA("user32");
PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
if (!PrivateExtractIconExW)
return 0;
}
#endif
TRACE("%s %i %p %p %i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons);
return PrivateExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
}
/*************************************************************************
* ExtractIconExA [SHELL32.@]
*/
UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons)
{
UINT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0);
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
TRACE("%s %i %p %p %i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
ret = ExtractIconExW (lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret;
}
/*************************************************************************
* ExtractAssociatedIconA (SHELL32.@)
*
* Return icon for given file (either from file itself or from associated
* executable) and patch parameters if needed.
*/
HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon)
{
HICON hIcon;
WORD wDummyIcon = 0;
TRACE("\n");
if(lpiIcon == NULL)
lpiIcon = &wDummyIcon;
hIcon = ExtractIconA(hInst, lpIconPath, *lpiIcon);
if( hIcon < (HICON)2 )
{ if( hIcon == (HICON)1 ) /* no icons found in given file */
{ char tempPath[0x80];
HINSTANCE uRet = FindExecutableA(lpIconPath,NULL,tempPath);
if( uRet > (HINSTANCE)32 && tempPath[0] )
{ strcpy(lpIconPath,tempPath);
hIcon = ExtractIconA(hInst, lpIconPath, *lpiIcon);
if( hIcon > (HICON)2 )
return hIcon;
}
else hIcon = 0;
}
if( hIcon == (HICON)1 )
*lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
else
*lpiIcon = 6; /* generic icon - found nothing */
if (GetModuleFileNameA(hInst, lpIconPath, 0x80))
{
/* terminate string (GetModuleFileName doesn't do if buffer is too small) */
lpIconPath[0x80 - 1] = '\0';
hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon));
}
}
return hIcon;
}
/*************************************************************************
* ExtractAssociatedIconExW (SHELL32.@)
*
* Return icon for given file (either from file itself or from associated
* executable) and patch parameters if needed.
*/
HICON WINAPI ExtractAssociatedIconExW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
{
FIXME("%p %s %p %p): stub\n", hInst, debugstr_w(lpIconPath), lpiIconIdx, lpiIconId);
return 0;
}
/*************************************************************************
* ExtractAssociatedIconExA (SHELL32.@)
*
* Return icon for given file (either from file itself or from associated
* executable) and patch parameters if needed.
*/
HICON WINAPI ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
{
HICON ret;
INT len = MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, NULL, 0 );
LPWSTR lpwstrFile = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
TRACE("%p %s %p %p)\n", hInst, lpIconPath, lpiIconIdx, lpiIconId);
MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, lpwstrFile, len );
ret = ExtractAssociatedIconExW(hInst, lpwstrFile, lpiIconIdx, lpiIconId);
HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret;
}
/****************************************************************************
* SHDefExtractIconW [SHELL32.@]
*/
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
{
UINT ret;
HICON hIcons[2];
WARN("%s %d 0x%08x %p %p %d, semi-stub\n", debugstr_w(pszIconFile), iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
ret = PrivateExtractIconsW(pszIconFile, iIndex, nIconSize, nIconSize, hIcons, NULL, 2, LR_DEFAULTCOLOR);
/* FIXME: deal with uFlags parameter which contains GIL_ flags */
if (ret == 0xFFFFFFFF)
return E_FAIL;
if (ret > 0) {
*phiconLarge = hIcons[0];
*phiconSmall = hIcons[1];
return S_OK;
}
return S_FALSE;
}
/****************************************************************************
* SHDefExtractIconA [SHELL32.@]
*/
HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
{
HRESULT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, NULL, 0);
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
TRACE("%s %d 0x%08x %p %p %d\n", pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, lpwstrFile, len);
ret = SHDefExtractIconW(lpwstrFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret;
}

View File

@@ -0,0 +1,9 @@
# $Id: makefile 7409 2004-01-02 19:49:47Z gvg $
PATH_TO_TOP = ../..
TARGET_TYPE = winedll
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View File

@@ -0,0 +1,296 @@
/*
* this class implements a pure IStream object
* and can be used for many purposes
*
* the main reason for implementing this was
* a cleaner implementation of IShellLink which
* needs to be able to load lnk's from a IStream
* interface so it was obvious to capsule the file
* access in a IStream to.
*
* Copyright 1999 Juergen Schmied
* Copyright 2003 Mike McCormack for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "wingdi.h"
#include "shlobj.h"
#include "wine/debug.h"
#include "shell32_main.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
static const IStreamVtbl stvt;
typedef struct
{
const IStreamVtbl *lpvtst;
DWORD ref;
HANDLE handle;
} ISHFileStream;
/**************************************************************************
* CreateStreamOnFile()
*
* similar to CreateStreamOnHGlobal
*/
HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm)
{
ISHFileStream* fstr;
HANDLE handle;
DWORD access = GENERIC_READ, creat;
if( grfMode & STGM_TRANSACTED )
return E_INVALIDARG;
if( grfMode & STGM_WRITE )
access |= GENERIC_WRITE;
if( grfMode & STGM_READWRITE )
access = GENERIC_WRITE | GENERIC_READ;
if( grfMode & STGM_CREATE )
creat = CREATE_ALWAYS;
else
creat = OPEN_EXISTING;
TRACE("Opening %s\n", debugstr_w(pszFilename) );
handle = CreateFileW( pszFilename, access, FILE_SHARE_READ, NULL, creat, 0, NULL );
if( handle == INVALID_HANDLE_VALUE )
return HRESULT_FROM_WIN32(GetLastError());
fstr = (ISHFileStream*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,sizeof(ISHFileStream));
if( !fstr )
return E_OUTOFMEMORY;
fstr->lpvtst=&stvt;
fstr->ref = 1;
fstr->handle = handle;
(*ppstm) = (IStream*)fstr;
return S_OK;
}
/**************************************************************************
* IStream_fnQueryInterface
*/
static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IStream))
{
*ppvObj = This;
}
if(*ppvObj)
{
IStream_AddRef((IStream*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/**************************************************************************
* IStream_fnAddRef
*/
static ULONG WINAPI IStream_fnAddRef(IStream *iface)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)->(count=%lu)\n",This, This->ref);
return ++(This->ref);
}
/**************************************************************************
* IStream_fnRelease
*/
static ULONG WINAPI IStream_fnRelease(IStream *iface)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)->()\n",This);
if (!--(This->ref))
{
TRACE(" destroying SHFileStream (%p)\n",This);
CloseHandle(This->handle);
HeapFree(GetProcessHeap(),0,This);
}
return This->ref;
}
static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead);
if ( !pv )
return STG_E_INVALIDPOINTER;
if ( ! ReadFile( This->handle, pv, cb, pcbRead, NULL ) )
return S_FALSE;
return S_OK;
}
static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
{
DWORD dummy_count;
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
if( !pv )
return STG_E_INVALIDPOINTER;
/* WriteFile() doesn't allow to specify NULL as write count pointer */
if (!pcbWritten)
pcbWritten = &dummy_count;
if( ! WriteFile( This->handle, pv, cb, pcbWritten, NULL ) )
return E_FAIL;
return S_OK;
}
static HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
{
DWORD pos, newposlo, newposhi;
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
pos = dlibMove.QuadPart; /* FIXME: truncates */
newposhi = 0;
newposlo = SetFilePointer( This->handle, pos, &newposhi, dwOrigin );
if( newposlo == INVALID_SET_FILE_POINTER )
return E_FAIL;
plibNewPosition->QuadPart = newposlo | ( (LONGLONG)newposhi<<32);
return S_OK;
}
static HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
if( ! SetFilePointer( This->handle, libNewSize.QuadPart, NULL, FILE_BEGIN ) )
return E_FAIL;
if( ! SetEndOfFile( This->handle ) )
return E_FAIL;
return S_OK;
}
static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnRevert (IStream * iface)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnLockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
{
ISHFileStream *This = (ISHFileStream *)iface;
TRACE("(%p)\n",This);
return E_NOTIMPL;
}
static const IStreamVtbl stvt =
{
IStream_fnQueryInterface,
IStream_fnAddRef,
IStream_fnRelease,
IStream_fnRead,
IStream_fnWrite,
IStream_fnSeek,
IStream_fnSetSize,
IStream_fnCopyTo,
IStream_fnCommit,
IStream_fnRevert,
IStream_fnLockRegion,
IStream_fnUnlockRegion,
IStream_fnStat,
IStream_fnClone
};

2233
reactos/lib/shell32/pidl.c Normal file

File diff suppressed because it is too large Load Diff

253
reactos/lib/shell32/pidl.h Normal file
View File

@@ -0,0 +1,253 @@
/*
* internal pidl functions
*
* Copyright 1998 Juergen Schmied
* Copyright 2004 Juan Lang
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* NOTES:
*
* DO NOT use this definitions outside the shell32.dll !
*
* The contents of a pidl should never used from a application
* directly.
*
* Undocumented:
* MS says: the abID of SHITEMID should be treated as binary data and not
* be interpreted by applications. Applies to everyone but MS itself.
* Word95 interprets the contents of abID (Filesize/Date) so we have to go
* for binary compatibility here.
*/
#ifndef __WINE_PIDL_H
#define __WINE_PIDL_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.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 seems to be a union. The first byte of the
* PIDLDATA desribes the type of pidl.
*
* object ! first byte / ! format ! living space
* ! size
* ----------------------------------------------------------------
* my computer 0x1F/20 guid (2) (usual)
* network 0x1F guid
* bitbucket 0x1F guid
* drive 0x23/25 drive (usual)
* drive 0x25/25 drive (lnk/persistent)
* drive 0x29/25 drive
* shell extension 0x2E guid
* drive 0x2F drive (lnk/persistent)
* folder/file 0x30 folder/file (1) (lnk/persistent)
* folder 0x31 folder (usual)
* valueA 0x32 file (ANSI file name)
* valueW 0x34 file (Unicode file name)
* workgroup 0x41 network (3)
* computer 0x42 network (4)
* net provider 0x46 network
* whole network 0x47 network (5)
* MSITStore 0x61 htmlhlp (7)
* printers/ras connections 0x70 guid
* history/favorites 0xb1 file
* share 0xc3 network (6)
*
* guess: the persistent elements are non tracking
*
* (1) dummy byte is used, attributes are empty
* (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
* (3) two strings "workgroup" "Microsoft Network"
* (4) two strings "\\sirius" "Microsoft Network"
* (5) one string "Entire Network"
* (6) two strings "\\sirius\c" "Microsoft Network"
* (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
* GUID 871C5380-42A0-1069-A2EA-08002B30309D
*/
#define PT_CPLAPPLET 0x00
#define PT_GUID 0x1F
#define PT_DRIVE 0x23
#define PT_DRIVE2 0x25
#define PT_DRIVE3 0x29
#define PT_SHELLEXT 0x2E
#define PT_DRIVE1 0x2F
#define PT_FOLDER1 0x30
#define PT_FOLDER 0x31
#define PT_VALUE 0x32
#define PT_WORKGRP 0x41
#define PT_COMP 0x42
#define PT_NETPROVIDER 0x46
#define PT_NETWORK 0x47
#define PT_IESPECIAL1 0x61
#define PT_YAGUID 0x70 /* yet another guid.. */
#define PT_IESPECIAL2 0xb1
#define PT_SHARE 0xc3
#include "pshpack1.h"
typedef BYTE PIDLTYPE;
typedef struct tagPIDLCPanelStruct
{
BYTE dummy; /*01 is 0x00 */
DWORD iconIdx; /*02 negative icon ID */
WORD offsDispName; /*06*/
WORD offsComment; /*08*/
CHAR szName[1]; /*10*/ /* terminated by 0x00, followed by display name and comment string */
} PIDLCPanelStruct;
typedef struct tagGUIDStruct
{
BYTE dummy; /* offset 01 is unknown */
GUID guid; /* offset 02 */
} GUIDStruct;
typedef struct tagDriveStruct
{
CHAR szDriveName[20]; /*01*/
WORD unknown; /*21*/
} DriveStruct;
typedef struct tagFileStruct
{
BYTE dummy; /*01 is 0x00 for files or dirs */
DWORD dwFileSize; /*02*/
WORD uFileDate; /*06*/
WORD uFileTime; /*08*/
WORD uFileAttribs; /*10*/
CHAR szNames[1]; /*12*/
/* Here are coming two strings. The first is the long name.
The second the dos name when needed or just 0x00 */
} FileStruct;
typedef struct tagPIDLDATA
{ PIDLTYPE type; /*00*/
union
{
struct tagGUIDStruct guid;
struct tagDriveStruct drive;
struct tagFileStruct file;
struct
{ WORD dummy; /*01*/
CHAR szNames[1]; /*03*/
} network;
struct
{ WORD dummy; /*01*/
DWORD dummy1; /*02*/
CHAR szName[1]; /*06*/ /* terminated by 0x00 0x00 */
} htmlhelp;
struct tagPIDLCPanelStruct cpanel;
}u;
} PIDLDATA, *LPPIDLDATA;
#include "poppack.h"
/*
* getting special values from simple pidls
*/
DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize);
BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft);
DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT);
/*
* testing simple pidls
*/
BOOL _ILIsDesktop (LPCITEMIDLIST pidl);
BOOL _ILIsMyComputer (LPCITEMIDLIST pidl);
BOOL _ILIsDrive (LPCITEMIDLIST pidl);
BOOL _ILIsFolder (LPCITEMIDLIST pidl);
BOOL _ILIsValue (LPCITEMIDLIST pidl);
BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl);
BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl);
BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl);
/*
* simple pidls
*/
/* Basic PIDL constructor. Allocates size + 5 bytes, where:
* - two bytes are SHITEMID.cb
* - one byte is PIDLDATA.type
* - two bytes are the NULL PIDL terminator
* Sets type of the returned PIDL to type.
*/
LPITEMIDLIST _ILAlloc(PIDLTYPE type, size_t size);
/* Creates a PIDL with guid format and type type, which must be one of PT_GUID,
* PT_SHELLEXT, or PT_YAGUID.
*/
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid);
/* Like _ILCreateGuid, but using the string szGUID. */
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID);
/* Commonly used PIDLs representing file system objects. */
LPITEMIDLIST _ILCreateDesktop (void);
LPITEMIDLIST _ILCreateFromFindDataA(WIN32_FIND_DATAA *stffile);
HRESULT _ILCreateFromPathA (LPCSTR szPath, LPITEMIDLIST* ppidl);
/* Other helpers */
LPITEMIDLIST _ILCreateMyComputer (void);
LPITEMIDLIST _ILCreateIExplore (void);
LPITEMIDLIST _ILCreateControlPanel (void);
LPITEMIDLIST _ILCreatePrinters (void);
LPITEMIDLIST _ILCreateNetwork (void);
LPITEMIDLIST _ILCreateBitBucket (void);
LPITEMIDLIST _ILCreateDrive (LPCWSTR);
/*
* helper functions (getting struct-pointer)
*/
LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST);
LPSTR _ILGetTextPointer (LPCITEMIDLIST);
LPSTR _ILGetSTextPointer (LPCITEMIDLIST);
IID *_ILGetGUIDPointer (LPCITEMIDLIST pidl);
/*
* debug helper
*/
void pdump (LPCITEMIDLIST pidl);
BOOL pcheck (LPCITEMIDLIST pidl);
/*
* aPidl helper
*/
void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl);
LPITEMIDLIST * _ILCopyaPidl(LPCITEMIDLIST * apidlsrc, UINT cidl);
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida);
BOOL WINAPI ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type);
BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type);
HRESULT SHELL_GetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize);
HRESULT SHELL_GetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize);
#endif

View File

@@ -0,0 +1,540 @@
/*
* self-registerable dll functions for shell32.dll
*
* Copyright (C) 2003 John K. Hohm
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "ole2.h"
#include "shlguid.h"
#include "shell32_main.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
/*
* Near the bottom of this file are the exported DllRegisterServer and
* DllUnregisterServer, which make all this worthwhile.
*/
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
int num_methods; /* can be <0 to omit */
CLSID const *ps_clsid; /* can be NULL to omit */
CLSID const *ps_clsid32; /* can be NULL to omit */
};
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
LPCSTR ips32; /* can be NULL to omit */
LPCSTR ips32_tmodel; /* can be NULL to omit */
DWORD flags;
LPCSTR clsid_str; /* can be NULL to omit */
LPCSTR progid; /* can be NULL to omit */
};
/* flags for regsvr_coclass.flags */
#define SHELLEX_MAYCHANGEDEFAULTMENU 0x00000001
static HRESULT register_coclasses(struct regsvr_coclass const *list);
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
/***********************************************************************
* static string constants
*/
static WCHAR const interface_keyname[10] = {
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
static WCHAR const base_ifa_keyname[14] = {
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
'e', 0 };
static WCHAR const num_methods_keyname[11] = {
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
static WCHAR const ps_clsid_keyname[15] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', 0 };
static WCHAR const ps_clsid32_keyname[17] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', '3', '2', 0 };
static WCHAR const clsid_keyname[6] = {
'C', 'L', 'S', 'I', 'D', 0 };
static WCHAR const ips_keyname[13] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
0 };
static WCHAR const ips32_keyname[15] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
'3', '2', 0 };
static WCHAR const progid_keyname[7] = {
'P', 'r', 'o', 'g', 'I', 'D', 0 };
static WCHAR const shellex_keyname[8] = {
's', 'h', 'e', 'l', 'l', 'e', 'x', 0 };
static WCHAR const mcdm_keyname[21] = {
'M', 'a', 'y', 'C', 'h', 'a', 'n', 'g', 'e', 'D', 'e', 'f',
'a', 'u', 'l', 't', 'M', 'e', 'n', 'u', 0 };
static char const tmodel_valuename[] = "ThreadingModel";
/***********************************************************************
* static helper functions
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR const *value);
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
char const *value);
static LONG recursive_delete_key(HKEY key);
static LONG recursive_delete_keyA(HKEY base, char const *name);
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
HKEY iid_key;
StringFromGUID2(list->iid, buf, 39);
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_interface_key;
if (list->name) {
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->base_iid) {
register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (0 <= list->num_methods) {
static WCHAR const fmt[3] = { '%', 'd', 0 };
HKEY key;
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
wsprintfW(buf, fmt, list->num_methods);
res = RegSetValueExW(key, NULL, 0, REG_SZ,
(CONST BYTE*)buf,
(lstrlenW(buf) + 1) * sizeof(WCHAR));
RegCloseKey(key);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid) {
register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid32) {
register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
error_close_iid_key:
RegCloseKey(iid_key);
}
error_close_interface_key:
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
KEY_READ | KEY_WRITE, &interface_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
res = recursive_delete_keyW(interface_key, buf);
}
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
HKEY clsid_key;
StringFromGUID2(list->clsid, buf, 39);
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->name) {
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips) {
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips32) {
HKEY ips32_key;
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&ips32_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
(CONST BYTE*)list->ips32,
lstrlenA(list->ips32) + 1);
if (res == ERROR_SUCCESS && list->ips32_tmodel)
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
(CONST BYTE*)list->ips32_tmodel,
strlen(list->ips32_tmodel) + 1);
RegCloseKey(ips32_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->flags & SHELLEX_MAYCHANGEDEFAULTMENU) {
HKEY shellex_key, mcdm_key;
res = RegCreateKeyExW(clsid_key, shellex_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&shellex_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegCreateKeyExW(shellex_key, mcdm_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&mcdm_key, NULL);
RegCloseKey(shellex_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
RegCloseKey(mcdm_key);
}
if (list->clsid_str) {
res = register_key_defvalueA(clsid_key, clsid_keyname,
list->clsid_str);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->progid) {
HKEY progid_key;
res = register_key_defvalueA(clsid_key, progid_keyname,
list->progid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, list->progid, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&progid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_key_defvalueW(progid_key, clsid_keyname, buf);
RegCloseKey(progid_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
error_close_clsid_key:
RegCloseKey(clsid_key);
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
KEY_READ | KEY_WRITE, &coclass_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->clsid, buf, 39);
res = recursive_delete_keyW(coclass_key, buf);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->progid) {
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
return register_key_defvalueW(base, name, buf);
}
/***********************************************************************
* regsvr_key_defvalueW
*/
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
(lstrlenW(value) + 1) * sizeof(WCHAR));
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_key_defvalueA
*/
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
lstrlenA(value) + 1);
RegCloseKey(key);
return res;
}
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
HKEY subkey;
for (;;) {
cName = sizeof(subkey_name) / sizeof(WCHAR);
res = RegEnumKeyExW(key, 0, subkey_name, &cName,
NULL, NULL, NULL, NULL);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
res = ERROR_SUCCESS; /* presumably we're done enumerating */
break;
}
res = RegOpenKeyExW(key, subkey_name, 0,
KEY_READ | KEY_WRITE, &subkey);
if (res == ERROR_FILE_NOT_FOUND) continue;
if (res != ERROR_SUCCESS) break;
res = recursive_delete_key(subkey);
RegCloseKey(subkey);
if (res != ERROR_SUCCESS) break;
}
if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
return res;
}
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
LONG res;
HKEY key;
res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
LONG res;
HKEY key;
res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* coclass list
*/
static GUID const CLSID_Desktop = {
0x00021400, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
static GUID const CLSID_Shortcut = {
0x00021401, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
static struct regsvr_coclass const coclass_list[] = {
{ &CLSID_Desktop,
"Desktop",
NULL,
"shell32.dll",
"Apartment"
},
{ &CLSID_MyComputer,
"My Computer",
NULL,
"shell32.dll",
"Apartment"
},
{ &CLSID_Shortcut,
"Shortcut",
NULL,
"shell32.dll",
"Apartment",
SHELLEX_MAYCHANGEDEFAULTMENU
},
{ &CLSID_AutoComplete,
"AutoComplete",
NULL,
"shell32.dll",
"Apartment",
},
{ NULL } /* list terminator */
};
/***********************************************************************
* interface list
*/
static struct regsvr_interface const interface_list[] = {
{ NULL } /* list terminator */
};
/***********************************************************************
* DllRegisterServer (SHELL32.@)
*/
HRESULT WINAPI SHELL32_DllRegisterServer()
{
HRESULT hr;
TRACE("\n");
hr = register_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = register_interfaces(interface_list);
if (SUCCEEDED(hr))
hr = SHELL_RegisterShellFolders();
return hr;
}
/***********************************************************************
* DllUnregisterServer (SHELL32.@)
*/
HRESULT WINAPI SHELL32_DllUnregisterServer()
{
HRESULT hr;
TRACE("\n");
hr = unregister_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = unregister_interfaces(interface_list);
return hr;
}

View File

@@ -0,0 +1,80 @@
/*
* Copyright 2004 Martin Fuchs
*
* Pass on icon notification messages to the systray implementation
* in the currently running shell.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <malloc.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "shellapi.h"
/* copy data structure for tray notifications */
typedef struct TrayNotifyCDS_Dummy {
DWORD cookie;
DWORD notify_code;
DWORD nicon_data[1]; // placeholder for NOTIFYICONDATA structure
} TrayNotifyCDS_Dummy;
/* The only difference between Shell_NotifyIconA and Shell_NotifyIconW is the call to SendMessageA/W. */
static BOOL SHELL_NotifyIcon(DWORD dwMessage, void* pnid, HWND nid_hwnd, int nid_size, BOOL unicode)
{
HWND hwnd;
COPYDATASTRUCT data;
BOOL ret = FALSE;
int len = sizeof(TrayNotifyCDS_Dummy)-sizeof(DWORD)+nid_size;
TrayNotifyCDS_Dummy* pnotify_data = (TrayNotifyCDS_Dummy*) alloca(len);
pnotify_data->cookie = 1;
pnotify_data->notify_code = dwMessage;
memcpy(&pnotify_data->nicon_data, pnid, nid_size);
data.dwData = 1;
data.cbData = len;
data.lpData = pnotify_data;
for(hwnd=0; hwnd=FindWindowExW(0, hwnd, L"Shell_TrayWnd", NULL); )
if ((unicode?SendMessageW:SendMessageA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data))
ret = TRUE;
return ret;
}
/*************************************************************************
* Shell_NotifyIcon [SHELL32.296]
* Shell_NotifyIconA [SHELL32.297]
*/
BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid)
{
return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, FALSE);
}
/*************************************************************************
* Shell_NotifyIconW [SHELL32.298]
*/
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
{
return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, TRUE);
}

659
reactos/lib/shell32/shell.c Normal file
View File

@@ -0,0 +1,659 @@
/*
* Shell Library Functions
*
* Copyright 1998 Marcus Meissner
* Copyright 2000 Juergen Schmied
* Copyright 2002 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <ctype.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winreg.h"
#include "wownt32.h"
#include "dlgs.h"
#include "shellapi.h"
#include "winuser.h"
#include "wingdi.h"
#include "shlobj.h"
#include "shlwapi.h"
#include "ddeml.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "shell32_main.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
WINE_DECLARE_DEBUG_CHANNEL(exec);
typedef struct { /* structure for dropped files */
WORD wSize;
POINT16 ptMousePos;
BOOL16 fInNonClientArea;
/* memory block with filenames follows */
} DROPFILESTRUCT16, *LPDROPFILESTRUCT16;
static const char* lpstrMsgWndCreated = "OTHERWINDOWCREATED";
static const char* lpstrMsgWndDestroyed = "OTHERWINDOWDESTROYED";
static const char* lpstrMsgShellActivate = "ACTIVATESHELLWINDOW";
static HWND SHELL_hWnd = 0;
static HHOOK SHELL_hHook = 0;
static UINT uMsgWndCreated = 0;
static UINT uMsgWndDestroyed = 0;
static UINT uMsgShellActivate = 0;
HINSTANCE16 SHELL_hInstance = 0;
HINSTANCE SHELL_hInstance32;
static int SHELL_Attach = 0;
/***********************************************************************
* DllEntryPoint [SHELL.101]
*
* Initialization code for shell.dll. Automatically loads the
* 32-bit shell32.dll to allow thunking up to 32-bit code.
*
* RETURNS
* Success: TRUE. Initialization completed successfully.
* Failure: FALSE.
*/
BOOL WINAPI SHELL_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst,
WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n",
Reason, hInst, ds, HeapSize, res1, res2);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
if (SHELL_Attach++) break;
SHELL_hInstance = hInst;
if(!SHELL_hInstance32)
{
if(!(SHELL_hInstance32 = LoadLibraryA("shell32.dll")))
{
ERR("Could not load sibling shell32.dll\n");
return FALSE;
}
}
break;
case DLL_PROCESS_DETACH:
if(!--SHELL_Attach)
{
SHELL_hInstance = 0;
if(SHELL_hInstance32)
FreeLibrary(SHELL_hInstance32);
}
break;
}
return TRUE;
}
/*************************************************************************
* DragAcceptFiles [SHELL.9]
*/
void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b)
{
DragAcceptFiles(HWND_32(hWnd), b);
}
/*************************************************************************
* DragQueryFile [SHELL.11]
*/
UINT16 WINAPI DragQueryFile16(
HDROP16 hDrop,
WORD wFile,
LPSTR lpszFile,
WORD wLength)
{
LPSTR lpDrop;
UINT i = 0;
LPDROPFILESTRUCT16 lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop);
TRACE("(%04x, %x, %p, %u)\n", hDrop,wFile,lpszFile,wLength);
if(!lpDropFileStruct) goto end;
lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->wSize;
while (i++ < wFile)
{
while (*lpDrop++); /* skip filename */
if (!*lpDrop)
{
i = (wFile == 0xFFFF) ? i : 0;
goto end;
}
}
i = strlen(lpDrop);
i++;
if (!lpszFile ) goto end; /* needed buffer size */
i = (wLength > i) ? i : wLength;
lstrcpynA (lpszFile, lpDrop, i);
end:
GlobalUnlock16(hDrop);
return i;
}
/*************************************************************************
* DragFinish [SHELL.12]
*/
void WINAPI DragFinish16(HDROP16 h)
{
TRACE("\n");
GlobalFree16((HGLOBAL16)h);
}
/*************************************************************************
* DragQueryPoint [SHELL.13]
*/
BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p)
{
LPDROPFILESTRUCT16 lpDropFileStruct;
BOOL16 bRet;
TRACE("\n");
lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop);
memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT16));
bRet = lpDropFileStruct->fInNonClientArea;
GlobalUnlock16(hDrop);
return bRet;
}
/*************************************************************************
* FindExecutable (SHELL.21)
*/
HINSTANCE16 WINAPI FindExecutable16( LPCSTR lpFile, LPCSTR lpDirectory,
LPSTR lpResult )
{ return HINSTANCE_16(FindExecutableA( lpFile, lpDirectory, lpResult ));
}
/*************************************************************************
* AboutDlgProc (SHELL.33)
*/
BOOL16 WINAPI AboutDlgProc16( HWND16 hWnd, UINT16 msg, WPARAM16 wParam,
LPARAM lParam )
{ return (BOOL16)AboutDlgProc( HWND_32(hWnd), msg, wParam, lParam );
}
/*************************************************************************
* ShellAbout (SHELL.22)
*/
BOOL16 WINAPI ShellAbout16( HWND16 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
HICON16 hIcon )
{ return ShellAboutA( HWND_32(hWnd), szApp, szOtherStuff, HICON_32(hIcon) );
}
/*************************************************************************
* InternalExtractIcon [SHELL.39]
*
* This abortion is called directly by Progman
*/
HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
LPCSTR lpszExeFileName, UINT16 nIconIndex, WORD n )
{
HGLOBAL16 hRet = 0;
HICON16 *RetPtr = NULL;
OFSTRUCT ofs;
TRACE("(%04x,file %s,start %d,extract %d\n",
hInstance, lpszExeFileName, nIconIndex, n);
if (!n)
return 0;
hRet = GlobalAlloc16(GMEM_FIXED | GMEM_ZEROINIT, sizeof(*RetPtr) * n);
RetPtr = (HICON16*)GlobalLock16(hRet);
if (nIconIndex == (UINT16)-1) /* get number of icons */
{
RetPtr[0] = PrivateExtractIconsA(ofs.szPathName, 0, 0, 0, NULL, NULL, 0, LR_DEFAULTCOLOR);
}
else
{
UINT ret;
HICON *icons;
icons = HeapAlloc(GetProcessHeap(), 0, n * sizeof(*icons));
ret = PrivateExtractIconsA(ofs.szPathName, nIconIndex,
GetSystemMetrics(SM_CXICON),
GetSystemMetrics(SM_CYICON),
icons, NULL, n, LR_DEFAULTCOLOR);
if ((ret != 0xffffffff) && ret)
{
int i;
for (i = 0; i < n; i++) RetPtr[i] = HICON_16(icons[i]);
}
else
{
GlobalFree16(hRet);
hRet = 0;
}
HeapFree(GetProcessHeap(), 0, icons);
}
return hRet;
}
/*************************************************************************
* ExtractIcon (SHELL.34)
*/
HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
UINT16 nIconIndex )
{ TRACE("\n");
return HICON_16(ExtractIconA(HINSTANCE_32(hInstance), lpszExeFileName, nIconIndex));
}
/*************************************************************************
* ExtractIconEx (SHELL.40)
*/
HICON16 WINAPI ExtractIconEx16(
LPCSTR lpszFile, INT16 nIconIndex, HICON16 *phiconLarge,
HICON16 *phiconSmall, UINT16 nIcons
) {
HICON *ilarge,*ismall;
UINT16 ret;
int i;
if (phiconLarge)
ilarge = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ilarge = NULL;
if (phiconSmall)
ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ismall = NULL;
ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
if (ilarge) {
for (i=0;i<nIcons;i++)
phiconLarge[i]=HICON_16(ilarge[i]);
HeapFree(GetProcessHeap(),0,ilarge);
}
if (ismall) {
for (i=0;i<nIcons;i++)
phiconSmall[i]=HICON_16(ismall[i]);
HeapFree(GetProcessHeap(),0,ismall);
}
return ret;
}
/*************************************************************************
* ExtractAssociatedIcon [SHELL.36]
*
* Return icon for given file (either from file itself or from associated
* executable) and patch parameters if needed.
*/
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWORD lpiIcon)
{
return HICON_16(ExtractAssociatedIconA(HINSTANCE_32(hInst), lpIconPath,
lpiIcon));
}
/*************************************************************************
* FindEnvironmentString [SHELL.38]
*
* Returns a pointer into the DOS environment... Ugh.
*/
static LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
{ UINT16 l;
TRACE("\n");
l = strlen(entry);
for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
{ if( strncasecmp(lpEnv, entry, l) )
continue;
if( !*(lpEnv+l) )
return (lpEnv + l); /* empty entry */
else if ( *(lpEnv+l)== '=' )
return (lpEnv + l + 1);
}
return NULL;
}
/**********************************************************************/
SEGPTR WINAPI FindEnvironmentString16(LPSTR str)
{ SEGPTR spEnv;
LPSTR lpEnv,lpString;
TRACE("\n");
spEnv = GetDOSEnvironment16();
lpEnv = MapSL(spEnv);
lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL;
if( lpString ) /* offset should be small enough */
return spEnv + (lpString - lpEnv);
return (SEGPTR)NULL;
}
/*************************************************************************
* DoEnvironmentSubst [SHELL.37]
*
* Replace %KEYWORD% in the str with the value of variable KEYWORD
* from "DOS" environment.
*/
DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length)
{
LPSTR lpEnv = MapSL(GetDOSEnvironment16());
LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
LPSTR lpstr = str;
LPSTR lpbstr = lpBuffer;
CharToOemA(str,str);
TRACE("accept %s\n", str);
while( *lpstr && lpbstr - lpBuffer < length )
{
LPSTR lpend = lpstr;
if( *lpstr == '%' )
{
do { lpend++; } while( *lpend && *lpend != '%' );
if( *lpend == '%' && lpend - lpstr > 1 ) /* found key */
{
LPSTR lpKey;
*lpend = '\0';
lpKey = SHELL_FindString(lpEnv, lpstr+1);
if( lpKey ) /* found key value */
{
int l = strlen(lpKey);
if( l > length - (lpbstr - lpBuffer) - 1 )
{
WARN("-- Env subst aborted - string too short\n");
*lpend = '%';
break;
}
strcpy(lpbstr, lpKey);
lpbstr += l;
}
else break;
*lpend = '%';
lpstr = lpend + 1;
}
else break; /* back off and whine */
continue;
}
*lpbstr++ = *lpstr++;
}
*lpbstr = '\0';
if( lpstr - str == strlen(str) )
{
strncpy(str, lpBuffer, length);
length = 1;
}
else
length = 0;
TRACE("-- return %s\n", str);
OemToCharA(str,str);
HeapFree( GetProcessHeap(), 0, lpBuffer);
/* Return str length in the LOWORD
* and 1 in HIWORD if subst was successful.
*/
return (DWORD)MAKELONG(strlen(str), length);
}
/*************************************************************************
* SHELL_HookProc
*
* 32-bit version of the system-wide WH_SHELL hook.
*/
static LRESULT WINAPI SHELL_HookProc(INT code, WPARAM wParam, LPARAM lParam)
{
TRACE("%i, %x, %08lx\n", code, wParam, lParam );
if (SHELL_hWnd)
{
switch( code )
{
case HSHELL_WINDOWCREATED:
PostMessageA( SHELL_hWnd, uMsgWndCreated, wParam, 0 );
break;
case HSHELL_WINDOWDESTROYED:
PostMessageA( SHELL_hWnd, uMsgWndDestroyed, wParam, 0 );
break;
case HSHELL_ACTIVATESHELLWINDOW:
PostMessageA( SHELL_hWnd, uMsgShellActivate, wParam, 0 );
break;
}
}
return CallNextHookEx( SHELL_hHook, code, wParam, lParam );
}
/*************************************************************************
* ShellHookProc [SHELL.103]
* System-wide WH_SHELL hook.
*/
LRESULT WINAPI ShellHookProc16(INT16 code, WPARAM16 wParam, LPARAM lParam)
{
return SHELL_HookProc( code, wParam, lParam );
}
/*************************************************************************
* RegisterShellHook [SHELL.102]
*/
BOOL WINAPI RegisterShellHook16(HWND16 hWnd, UINT16 uAction)
{
TRACE("%04x [%u]\n", hWnd, uAction );
switch( uAction )
{
case 2: /* register hWnd as a shell window */
if( !SHELL_hHook )
{
SHELL_hHook = SetWindowsHookExA( WH_SHELL, SHELL_HookProc,
GetModuleHandleA("shell32.dll"), 0 );
if ( SHELL_hHook )
{
uMsgWndCreated = RegisterWindowMessageA( lpstrMsgWndCreated );
uMsgWndDestroyed = RegisterWindowMessageA( lpstrMsgWndDestroyed );
uMsgShellActivate = RegisterWindowMessageA( lpstrMsgShellActivate );
}
else
WARN("-- unable to install ShellHookProc()!\n");
}
if ( SHELL_hHook )
return ((SHELL_hWnd = HWND_32(hWnd)) != 0);
break;
default:
WARN("-- unknown code %i\n", uAction );
SHELL_hWnd = 0; /* just in case */
}
return FALSE;
}
/***********************************************************************
* DriveType (SHELL.262)
*/
UINT16 WINAPI DriveType16( UINT16 drive )
{
UINT ret;
char path[] = "A:\\";
path[0] += drive;
ret = GetDriveTypeA(path);
switch(ret) /* some values are not supported in Win16 */
{
case DRIVE_CDROM:
ret = DRIVE_REMOTE;
break;
case DRIVE_NO_ROOT_DIR:
ret = DRIVE_UNKNOWN;
break;
}
return ret;
}
/* 0 and 1 are valid rootkeys in win16 shell.dll and are used by
* some programs. Do not remove those cases. -MM
*/
static inline void fix_win16_hkey( HKEY *hkey )
{
if (*hkey == 0 || *hkey == (HKEY)1) *hkey = HKEY_CLASSES_ROOT;
}
/******************************************************************************
* RegOpenKey [SHELL.1]
*/
DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, PHKEY retkey )
{
fix_win16_hkey( &hkey );
return RegOpenKeyA( hkey, name, retkey );
}
/******************************************************************************
* RegCreateKey [SHELL.2]
*/
DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, PHKEY retkey )
{
fix_win16_hkey( &hkey );
return RegCreateKeyA( hkey, name, retkey );
}
/******************************************************************************
* RegCloseKey [SHELL.3]
*/
DWORD WINAPI RegCloseKey16( HKEY hkey )
{
fix_win16_hkey( &hkey );
return RegCloseKey( hkey );
}
/******************************************************************************
* RegDeleteKey [SHELL.4]
*/
DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name )
{
fix_win16_hkey( &hkey );
return RegDeleteKeyA( hkey, name );
}
/******************************************************************************
* RegSetValue [SHELL.5]
*/
DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count )
{
fix_win16_hkey( &hkey );
return RegSetValueA( hkey, name, type, data, count );
}
/******************************************************************************
* RegQueryValue [SHELL.6]
*
* NOTES
* Is this HACK still applicable?
*
* HACK
* The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just
* mask out the high 16 bit. This (not so much incidently) hopefully fixes
* Aldus FH4)
*/
DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count
)
{
fix_win16_hkey( &hkey );
if (count) *count &= 0xffff;
return RegQueryValueA( hkey, name, data, count );
}
/******************************************************************************
* RegEnumKey [SHELL.7]
*/
DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
{
fix_win16_hkey( &hkey );
return RegEnumKeyA( hkey, index, name, name_len );
}
/*************************************************************************
* SHELL_Execute16 [Internal]
*/
static UINT SHELL_Execute16(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out)
{
UINT ret;
char sCmd[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, lpCmd, -1, sCmd, MAX_PATH, NULL, NULL);
ret = WinExec16(sCmd, (UINT16)psei->nShow);
psei_out->hInstApp = HINSTANCE_32(ret);
return ret;
}
/*************************************************************************
* ShellExecute [SHELL.20]
*/
HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
LPCSTR lpFile, LPCSTR lpParameters,
LPCSTR lpDirectory, INT16 iShowCmd )
{
SHELLEXECUTEINFOW seiW;
WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL;
HANDLE hProcess = 0;
seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL;
seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL;
seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL;
seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL;
seiW.cbSize = sizeof(seiW);
seiW.fMask = 0;
seiW.hwnd = HWND_32(hWnd);
seiW.nShow = iShowCmd;
seiW.lpIDList = 0;
seiW.lpClass = 0;
seiW.hkeyClass = 0;
seiW.dwHotKey = 0;
seiW.hProcess = hProcess;
ShellExecuteExW32 (&seiW, SHELL_Execute16);
if (wVerb) SHFree(wVerb);
if (wFile) SHFree(wFile);
if (wParameters) SHFree(wParameters);
if (wDirectory) SHFree(wDirectory);
return HINSTANCE_16(seiW.hInstApp);
}

View File

@@ -0,0 +1,45 @@
1 pascal RegOpenKey(long str ptr) RegOpenKey16
2 pascal RegCreateKey(long str ptr) RegCreateKey16
3 pascal RegCloseKey(long) RegCloseKey16
4 pascal RegDeleteKey(long str) RegDeleteKey16
5 pascal RegSetValue(long str long str long) RegSetValue16
6 pascal RegQueryValue(long str ptr ptr) RegQueryValue16
7 pascal RegEnumKey(long long ptr long) RegEnumKey16
9 pascal -ret16 DragAcceptFiles(word word) DragAcceptFiles16
11 pascal -ret16 DragQueryFile(word s_word ptr s_word) DragQueryFile16
12 pascal -ret16 DragFinish(word) DragFinish16
13 pascal -ret16 DragQueryPoint(word ptr) DragQueryPoint16
20 pascal -ret16 ShellExecute(word str str str str s_word) ShellExecute16
21 pascal -ret16 FindExecutable(str str ptr) FindExecutable16
22 pascal -ret16 ShellAbout(word ptr ptr word) ShellAbout16
33 pascal -ret16 AboutDlgProc(word word word long) AboutDlgProc16
34 pascal -ret16 ExtractIcon(word str s_word) ExtractIcon16
36 pascal -ret16 ExtractAssociatedIcon(word ptr ptr) ExtractAssociatedIcon16
37 pascal DoEnvironmentSubst(ptr word) DoEnvironmentSubst16
38 pascal FindEnvironmentString(ptr) FindEnvironmentString16
39 pascal -ret16 InternalExtractIcon(word ptr s_word word) InternalExtractIcon16
40 pascal -ret16 ExtractIconEx(str word ptr ptr word) ExtractIconEx16
# 98 stub SHL3216_THUNKDATA16
# 99 stub SHL1632_THUNKDATA16
#100 4 0550 HERETHARBETYGARS exported, shared data
#101 8 010e FINDEXEDLGPROC exported, shared data
101 pascal DllEntryPoint(long word word word long word) SHELL_DllEntryPoint
102 pascal -ret16 RegisterShellHook(word word) RegisterShellHook16
103 pascal ShellHookProc(word word long) ShellHookProc16
157 stub RESTARTDIALOG
# 166 PICKICONDLG
262 pascal -ret16 DriveType(long) DriveType16
# 263 SH16TO32DRIVEIOCTL
# 264 SH16TO32INT2526
# 300 SHGETFILEINFO
# 400 SHFORMATDRIVE
401 stub SHCHECKDRIVE
# 402 _RUNDLLCHECKDRIVE
# 8 WEP
#32 WCI

View File

@@ -0,0 +1,441 @@
# Functions exported by the Win95 shell32.dll
# (these need to have these exact ordinals, for some
# win95 and winNT dlls import shell32.dll by ordinal)
# This list was updated to dll version 4.72
2 stdcall SHChangeNotifyRegister(long long long long long ptr)
4 stdcall SHChangeNotifyDeregister (long)
5 stdcall SHChangeNotifyUpdateEntryList (long long long long)
9 stub PifMgr_OpenProperties
10 stub PifMgr_GetProperties
11 stub PifMgr_SetProperties
13 stub PifMgr_CloseProperties
15 stdcall ILGetDisplayName(ptr ptr)
16 stdcall ILFindLastID(ptr)
17 stdcall ILRemoveLastID(ptr)
18 stdcall ILClone(ptr)
19 stdcall ILCloneFirst (ptr)
20 stdcall ILGlobalClone (ptr)
21 stdcall ILIsEqual (ptr ptr)
23 stdcall ILIsParent (ptr ptr long)
24 stdcall ILFindChild (ptr ptr)
25 stdcall ILCombine(ptr ptr)
26 stdcall ILLoadFromStream (ptr ptr)
27 stdcall ILSaveToStream(ptr ptr)
28 stdcall SHILCreateFromPath(ptr ptr ptr) SHILCreateFromPathAW
29 stdcall PathIsRoot(ptr) PathIsRootAW
30 stdcall PathBuildRoot(ptr long) PathBuildRootAW
31 stdcall PathFindExtension(ptr) PathFindExtensionAW
32 stdcall PathAddBackslash(ptr) PathAddBackslashAW
33 stdcall PathRemoveBlanks(ptr) PathRemoveBlanksAW
34 stdcall PathFindFileName(ptr) PathFindFileNameAW
35 stdcall PathRemoveFileSpec(ptr) PathRemoveFileSpecAW
36 stdcall PathAppend(ptr ptr) PathAppendAW
37 stdcall PathCombine(ptr ptr ptr) PathCombineAW
38 stdcall PathStripPath(ptr)PathStripPathAW
39 stdcall PathIsUNC (ptr) PathIsUNCAW
40 stdcall PathIsRelative (ptr) PathIsRelativeAW
41 stdcall IsLFNDriveA(str)
42 stdcall IsLFNDriveW(wstr)
43 stdcall PathIsExe (ptr) PathIsExeAW
45 stdcall PathFileExists(ptr) PathFileExistsAW
46 stdcall PathMatchSpec (ptr ptr) PathMatchSpecAW
47 stdcall PathMakeUniqueName (ptr long ptr ptr ptr)PathMakeUniqueNameAW
48 stdcall PathSetDlgItemPath (long long ptr) PathSetDlgItemPathAW
49 stdcall PathQualify (ptr) PathQualifyAW
50 stdcall PathStripToRoot (ptr) PathStripToRootAW
51 stdcall PathResolve(str long long) PathResolveAW
52 stdcall PathGetArgs(str) PathGetArgsAW
53 stdcall DoEnvironmentSubst (long long) DoEnvironmentSubstAW
54 stdcall DragAcceptFiles(long long)
55 stdcall PathQuoteSpaces (ptr) PathQuoteSpacesAW
56 stdcall PathUnquoteSpaces(str) PathUnquoteSpacesAW
57 stdcall PathGetDriveNumber (str) PathGetDriveNumberAW
58 stdcall ParseField(str long ptr long) ParseFieldAW
59 stdcall RestartDialog(long wstr long)
60 stdcall ExitWindowsDialog(long)
61 stdcall RunFileDlg(long long long str str long)
62 stdcall PickIconDlg(long long long long)
63 stdcall GetFileNameFromBrowse(long long long long str str str)
64 stdcall DriveType (long)
65 stub InvalidateDriveType
66 stdcall IsNetDrive(long)
67 stdcall Shell_MergeMenus (long long long long long long)
68 stdcall SHGetSetSettings(ptr long long)
69 stub SHGetNetResource
70 stdcall SHCreateDefClassObject(long long long long long)
71 stdcall Shell_GetImageList(ptr ptr)
72 stdcall Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW
73 stdcall SHShellFolderView_Message(long long long)
74 stdcall SHCreateStdEnumFmtEtc(long ptr ptr)
75 stdcall PathYetAnotherMakeUniqueName(ptr wstr wstr wstr)
76 stub DragQueryInfo
77 stdcall SHMapPIDLToSystemImageListIndex(ptr ptr ptr)
78 stdcall OleStrToStrN(str long wstr long) OleStrToStrNAW
79 stdcall StrToOleStrN(wstr long str long) StrToOleStrNAW
80 stdcall DragFinish(long)
81 stdcall DragQueryFile(long long ptr long) DragQueryFileA
82 stdcall DragQueryFileA(long long ptr long)
83 stdcall CIDLData_CreateFromIDArray(ptr long ptr ptr)
84 stub SHIsBadInterfacePtr
85 stdcall OpenRegStream(long str str long) shlwapi.SHOpenRegStreamA
86 stdcall SHRegisterDragDrop(long ptr)
87 stdcall SHRevokeDragDrop(long)
88 stdcall SHDoDragDrop(long ptr ptr long ptr)
89 stdcall SHCloneSpecialIDList(long long long)
90 stdcall SHFindFiles(ptr ptr)
91 stub SHFindComputer
92 stdcall PathGetShortPath (ptr) PathGetShortPathAW
93 stdcall Win32CreateDirectory(wstr ptr) Win32CreateDirectoryAW
94 stdcall Win32RemoveDirectory(wstr) Win32RemoveDirectoryAW
95 stdcall SHLogILFromFSIL (ptr)
96 stdcall StrRetToStrN (ptr long ptr ptr) StrRetToStrNAW
97 stdcall SHWaitForFileToOpen (long long long)
98 stdcall SHGetRealIDL (ptr ptr ptr)
99 stdcall SetAppStartingCursor (long long)
100 stdcall SHRestricted(long)
102 stdcall SHCoCreateInstance(wstr ptr long ptr ptr)
103 stdcall SignalFileOpen(long)
104 stdcall FileMenu_DeleteAllItems(long)
105 stdcall FileMenu_DrawItem(long ptr)
106 stdcall FileMenu_FindSubMenuByPidl(long ptr)
107 stdcall FileMenu_GetLastSelectedItemPidls(long ptr ptr)
108 stdcall FileMenu_HandleMenuChar(long long)
109 stdcall FileMenu_InitMenuPopup (long)
110 stdcall FileMenu_InsertUsingPidl (long long ptr long long ptr)
111 stdcall FileMenu_Invalidate (long)
112 stdcall FileMenu_MeasureItem(long ptr)
113 stdcall FileMenu_ReplaceUsingPidl (long long ptr long ptr)
114 stdcall FileMenu_Create (long long long long long)
115 stdcall FileMenu_AppendItem (long ptr long long long long) FileMenu_AppendItemAW
116 stdcall FileMenu_TrackPopupMenuEx (long long long long long long)
117 stdcall FileMenu_DeleteItemByCmd(long long)
118 stdcall FileMenu_Destroy (long)
119 stdcall IsLFNDrive(ptr) IsLFNDriveAW
120 stdcall FileMenu_AbortInitMenu ()
121 stdcall SHFlushClipboard ()
122 stdcall -noname RunDLL_CallEntry16(long long long str long) #name wrong?
123 stdcall SHFreeUnusedLibraries ()
124 stdcall FileMenu_AppendFilesForPidl(long ptr long)
125 stdcall FileMenu_AddFilesForPidl(long long long ptr long long ptr)
126 stdcall SHOutOfMemoryMessageBox (long long long)
127 stdcall SHWinHelp (long long long long)
128 stdcall -private DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
129 stdcall DAD_AutoScroll(long ptr ptr)
130 stdcall DAD_DragEnter(long)
131 stdcall DAD_DragEnterEx(long long long)
132 stdcall DAD_DragLeave()
133 stdcall DragQueryFileW(long long ptr long)
134 stdcall DAD_DragMove(long long)
135 stdcall DragQueryPoint(long ptr)
136 stdcall DAD_SetDragImage(long long)
137 stdcall DAD_ShowDragImage (long)
139 stub Desktop_UpdateBriefcaseOnEvent
140 stdcall FileMenu_DeleteItemByIndex(long long)
141 stdcall FileMenu_DeleteItemByFirstID(long long)
142 stdcall FileMenu_DeleteSeparator(long)
143 stdcall FileMenu_EnableItemByCmd(long long long)
144 stdcall FileMenu_GetItemExtent (long long)
145 stdcall PathFindOnPath (ptr ptr) PathFindOnPathAW
146 stdcall RLBuildListOfPaths()
147 stdcall SHCLSIDFromString(long long) SHCLSIDFromStringAW
149 stdcall SHFind_InitMenuPopup(long long long long)
151 stdcall SHLoadOLE (long)
152 stdcall ILGetSize(ptr)
153 stdcall ILGetNext(ptr)
154 stdcall ILAppend (long long long)
155 stdcall ILFree (ptr)
156 stdcall ILGlobalFree (ptr)
157 stdcall ILCreateFromPath (ptr) ILCreateFromPathAW
158 stdcall PathGetExtension(str long long) PathGetExtensionAW
159 stdcall PathIsDirectory(ptr)PathIsDirectoryAW
160 stub SHNetConnectionDialog
161 stdcall SHRunControlPanel (long long)
162 stdcall SHSimpleIDListFromPath (ptr) SHSimpleIDListFromPathAW
163 stdcall StrToOleStr (wstr str) StrToOleStrAW
164 stdcall Win32DeleteFile(str) Win32DeleteFileAW
165 stdcall SHCreateDirectory(long ptr)
166 stdcall CallCPLEntry16(long long long long long long)
167 stdcall SHAddFromPropSheetExtArray(long long long)
168 stdcall SHCreatePropSheetExtArray(long str long)
169 stdcall SHDestroyPropSheetExtArray(long)
170 stdcall SHReplaceFromPropSheetExtArray(long long long long)
171 stdcall PathCleanupSpec(ptr ptr)
172 stdcall SHCreateLinks(long str ptr long ptr)
173 stdcall SHValidateUNC(long long long)
174 stdcall SHCreateShellFolderViewEx (ptr ptr)
175 stdcall SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW
176 stdcall SHSetInstanceExplorer (long)
177 stub DAD_SetDragImageFromListView
178 stub SHObjectProperties
179 stub SHGetNewLinkInfoA
180 stub SHGetNewLinkInfoW
181 stdcall RegisterShellHook(long long)
182 varargs ShellMessageBoxW(long long long str long)
183 varargs ShellMessageBoxA(long long long str long)
184 stdcall ArrangeWindows(long long long long long)
185 stub SHHandleDiskFull
186 stdcall ILGetDisplayNameEx(ptr ptr ptr long)
187 stub ILGetPseudoNameW
188 stdcall ShellDDEInit(long)
189 stdcall ILCreateFromPathA(str)
190 stdcall ILCreateFromPathW(wstr)
191 stub SHUpdateImageA
192 stdcall SHUpdateImageW(wstr long long long)
193 stub SHHandleUpdateImage
194 stub SHCreatePropSheetExtArrayEx
195 stdcall SHFree(ptr)
196 stdcall SHAlloc(long)
197 stub SHGlobalDefect
198 stdcall SHAbortInvokeCommand ()
199 stub SHGetFileIcon
200 stub SHLocalAlloc
201 stub SHLocalFree
202 stub SHLocalReAlloc
203 stub AddCommasW
204 stub ShortSizeFormatW
205 stub Printer_LoadIconsW
206 stub Link_AddExtraDataSection
207 stub Link_ReadExtraDataSection
208 stub Link_RemoveExtraDataSection
209 stub Int64ToString
210 stub LargeIntegerToString
211 stub Printers_GetPidl
212 stub Printers_AddPrinterPropPages
213 stub Printers_RegisterWindowW
214 stub Printers_UnregisterWindow
215 stub SHStartNetConnectionDialog
243 stdcall @(long long) shell32_243
244 stdcall SHInitRestricted(ptr ptr)
247 stdcall SHGetDataFromIDListA (ptr ptr long ptr long)
248 stdcall SHGetDataFromIDListW (ptr ptr long ptr long)
249 stdcall PathParseIconLocation (ptr) PathParseIconLocationAW
250 stdcall PathRemoveExtension (ptr) PathRemoveExtensionAW
251 stdcall PathRemoveArgs (ptr) PathRemoveArgsAW
256 stdcall @(ptr ptr) SHELL32_256
271 stub SheChangeDirA
272 stub SheChangeDirExA
273 stub SheChangeDirExW
274 stdcall SheChangeDirW(wstr)
275 stub SheConvertPathW
276 stub SheFullPathA
277 stub SheFullPathW
278 stub SheGetCurDrive
279 stub SheGetDirA
280 stub SheGetDirExW
281 stdcall SheGetDirW (long long)
282 stub SheGetPathOffsetW
283 stub SheRemoveQuotesA
284 stub SheRemoveQuotesW
285 stub SheSetCurDrive
286 stub SheShortenPathA
287 stub SheShortenPathW
288 stdcall ShellAboutA(long str str long)
289 stdcall ShellAboutW(long wstr wstr long)
290 stdcall ShellExecuteA(long str str str str long)
291 stdcall ShellExecuteEx (long) ShellExecuteExAW
292 stdcall ShellExecuteExA (long)
293 stdcall ShellExecuteExW (long)
294 stdcall ShellExecuteW (long wstr wstr wstr wstr long)
296 stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA
297 stdcall Shell_NotifyIconA(long ptr)
298 stdcall Shell_NotifyIconW(long ptr)
299 stub Shl1632_ThunkData32
300 stub Shl3216_ThunkData32
301 stdcall StrChrA(str long) shlwapi.StrChrA
302 stdcall StrChrIA(str long) shlwapi.StrChrIA
303 stdcall StrChrIW(wstr long) shlwapi.StrChrIW
304 stdcall StrChrW(wstr long) shlwapi.StrChrW
305 stdcall StrCmpNA(str str long) shlwapi.StrCmpNA
306 stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA
307 stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW
308 stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW
309 stdcall StrCpyNA (ptr str long) lstrcpynA
310 stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW
311 stdcall StrNCmpA(str str long) shlwapi.StrCmpNA
312 stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA
313 stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW
314 stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW
315 stdcall StrNCpyA (ptr str long) lstrcpynA
316 stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW
317 stdcall StrRChrA(str str long) shlwapi.StrRChrA
318 stdcall StrRChrIA(str str long) shlwapi.StrRChrIA
319 stdcall StrRChrIW(str str long) shlwapi.StrRChrIW
320 stdcall StrRChrW(wstr wstr long) shlwapi.StrRChrW
321 stub StrRStrA
322 stdcall StrRStrIA(str str str) shlwapi.StrRStrIA
323 stdcall StrRStrIW(wstr wstr wstr) shlwapi.StrRStrIW
324 stub StrRStrW
325 stdcall StrStrA(str str) shlwapi.StrStrA
326 stdcall StrStrIA(str str) shlwapi.StrStrIA
327 stdcall StrStrIW(wstr wstr) shlwapi.StrStrIW
328 stdcall StrStrW(wstr wstr) shlwapi.StrStrW
505 stdcall SHRegCloseKey (long)
506 stdcall SHRegOpenKeyA (long str long)
507 stdcall SHRegOpenKeyW (long wstr long)
508 stub SHRegQueryValueA
509 stdcall SHRegQueryValueExA(long str ptr ptr ptr ptr)
510 stdcall SHRegQueryValueW (long long long long)
511 stdcall SHRegQueryValueExW (long wstr ptr ptr ptr ptr)
512 stdcall SHRegDeleteKeyW (long wstr)
520 stdcall -noname SHAllocShared (ptr long long)
521 stdcall -noname SHLockShared (long long)
522 stdcall -noname SHUnlockShared (ptr)
523 stdcall -noname SHFreeShared (long long)
524 stdcall RealDriveType (long long)
525 stub RealDriveTypeFlags
640 stdcall NTSHChangeNotifyRegister (long long long long long long)
641 stdcall NTSHChangeNotifyDeregister (long)
643 stub SHChangeNotifyReceive
644 stdcall SHChangeNotification_Lock(long long ptr ptr)
645 stdcall SHChangeNotification_Unlock(long)
646 stub SHChangeRegistrationReceive
647 stub ReceiveAddToRecentDocs
648 stub SHWaitOp_Operate
650 stdcall PathIsSameRoot(ptr ptr)PathIsSameRootAW
# nt40/win98
651 stdcall ReadCabinetState (long long) # OldReadCabinetState
652 stdcall WriteCabinetState (long)
653 stdcall PathProcessCommand (long long long long) PathProcessCommandAW
# win98
654 stdcall @(long long)shell32_654 # ReadCabinetState@8
660 stdcall FileIconInit(long)
680 stdcall IsUserAdmin()
# >= NT5
714 stdcall @(ptr)SHELL32_714 # PathIsTemporaryW
730 stdcall RestartDialogEx(long wstr long long)
1217 stub FOOBAR1217 # no joke! This is the real name!!
#
# version 4.0 (win95)
# _WIN32_IE >= 0x0200
#
@ stdcall CheckEscapesA(str long)
@ stdcall CheckEscapesW(wstr long)
@ stdcall CommandLineToArgvW(wstr ptr)
@ stdcall Control_FillCache_RunDLL(long long long long) Control_FillCache_RunDLLA
@ stdcall Control_FillCache_RunDLLA(long long long long)
@ stdcall Control_FillCache_RunDLLW(long long long long)
@ stdcall Control_RunDLL(ptr ptr str long) Control_RunDLLA
@ stdcall Control_RunDLLA(ptr ptr str long)
@ stdcall Control_RunDLLW(ptr ptr wstr long)
@ stdcall -private DllCanUnloadNow() SHELL32_DllCanUnloadNow
@ stdcall DllInstall(long wstr)SHELL32_DllInstall
@ stdcall -private DllRegisterServer() SHELL32_DllRegisterServer
@ stdcall -private DllUnregisterServer() SHELL32_DllUnregisterServer
@ stdcall DoEnvironmentSubstA(str str)
@ stdcall DoEnvironmentSubstW(wstr wstr)
@ stub DragQueryFileAorW
@ stdcall DuplicateIcon(long long)
@ stdcall ExtractAssociatedIconA(long ptr long)
@ stdcall ExtractAssociatedIconExA(long str long long)
@ stdcall ExtractAssociatedIconExW(long wstr long long)
@ stub ExtractAssociatedIconW
@ stdcall ExtractIconA(long str long)
@ stdcall ExtractIconEx(ptr long ptr ptr long)ExtractIconExAW
@ stdcall ExtractIconExA(str long ptr ptr long)
@ stdcall ExtractIconExW(wstr long ptr ptr long)
@ stdcall ExtractIconW(long wstr long)
@ stub ExtractIconResInfoA
@ stub ExtractIconResInfoW
@ stub ExtractVersionResource16W
@ stub FindExeDlgProc
@ stdcall FindExecutableA(ptr ptr ptr)
@ stdcall FindExecutableW(wstr wstr wstr)
@ stdcall FreeIconList(long)
@ stub InternalExtractIconListA
@ stub InternalExtractIconListW
@ stub OpenAs_RunDLL
@ stub OpenAs_RunDLLA
@ stub OpenAs_RunDLLW
@ stub PrintersGetCommand_RunDLL
@ stub PrintersGetCommand_RunDLLA
@ stub PrintersGetCommand_RunDLLW
@ stub RealShellExecuteA
@ stub RealShellExecuteExA
@ stub RealShellExecuteExW
@ stub RealShellExecuteW
@ stub RegenerateUserEnvironment
@ stdcall SHAddToRecentDocs (long ptr)
@ stdcall SHAppBarMessage(long ptr)
@ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
@ stdcall SHBrowseForFolderA(ptr)
@ stdcall SHBrowseForFolderW(ptr)
@ stdcall SHChangeNotify (long long ptr ptr)
@ stdcall SHCreateDirectoryExA(long str ptr)
@ stdcall SHCreateDirectoryExW(long wstr ptr)
@ stub ShellHookProc
@ stub SHEmptyRecycleBinA
@ stub SHEmptyRecycleBinW
@ stdcall SHFileOperation(ptr)SHFileOperationAW
@ stdcall SHFileOperationA(ptr)
@ stdcall SHFileOperationW(ptr)
@ stub SHFormatDrive
@ stdcall SHFreeNameMappings(ptr)
@ stdcall SHGetDesktopFolder(ptr)
@ stdcall SHGetFileInfo(ptr long ptr long long)SHGetFileInfoAW
@ stdcall SHGetFileInfoA(ptr long ptr long long)
@ stdcall SHGetFileInfoW(ptr long ptr long long)
@ stdcall SHGetInstanceExplorer(long)
@ stdcall SHGetMalloc(ptr)
@ stub SHGetNewLinkInfo
@ stdcall SHGetPathFromIDList(ptr ptr)SHGetPathFromIDListAW
@ stdcall SHGetPathFromIDListA(ptr ptr)
@ stdcall SHGetPathFromIDListW(ptr ptr)
@ stdcall SHGetSettings(ptr long)
@ stdcall SHGetSpecialFolderLocation(long long ptr)
@ stdcall SHHelpShortcuts_RunDLL(long long long long)
@ stub SHHelpShortcuts_RunDLLA
@ stub SHHelpShortcuts_RunDLLW
@ stdcall SHLoadInProc(long)
@ stub SHQueryRecycleBinA
@ stub SHQueryRecycleBinW
@ stub SHUpdateRecycleBinIcon
@ stub WOWShellExecute
#
# version 4.70 (IE3.0)
# _WIN32_IE >= 0x0300
#
#
# version 4.71 (IE4.0)
# _WIN32_IE >= 0x0400
#
@ stdcall DllGetVersion(ptr)SHELL32_DllGetVersion
@ stub SHGetFreeDiskSpace
@ stdcall SHGetSpecialFolderPathA(long ptr long long)
@ stdcall SHGetSpecialFolderPathW(long ptr long long)
#
# version 4.72 (IE4.01)
# _WIN32_IE >= 0x0401
# no new exports
#
#
# version 5.00 (Win2K)
# _WIN32_IE >= 0x0500
#
@ stdcall SHBindToParent(ptr ptr ptr ptr)
@ stdcall SHGetDiskFreeSpaceA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
@ stdcall SHGetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
@ stdcall SHGetDiskFreeSpaceExW(wstr ptr ptr ptr) kernel32.GetDiskFreeSpaceExW
@ stdcall SHGetFolderPathA(long long long long ptr)
@ stdcall SHGetFolderPathW(long long long long ptr)
@ stdcall SHGetFolderLocation(long long long long ptr)
# version 6.0 (WinXP)
# _WIN32_IE >= 0x600
@ stdcall SHDefExtractIconA(str long long ptr ptr long)
@ stdcall SHDefExtractIconW(wstr long long ptr ptr long)

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_CATALAN, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Quant a %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "D'Acord", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS ha estat construit per:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2002 Tisheng Chen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "关于 %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "确定", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "输入程序目录文件或者Internet资源名ReactOS将为您打开它。", 12289, 36, 11, 182, 18
LTEXT "打开(&O):", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "确定", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "取消", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "浏览(&B)...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/* columns in the shellview */
STRINGTABLE LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
BEGIN
IDS_SHV_COLUMN1 "文件"
IDS_SHV_COLUMN2 "大小"
IDS_SHV_COLUMN3 "类型"
IDS_SHV_COLUMN4 "修改"
IDS_SHV_COLUMN5 "属性"
IDS_SHV_COLUMN6 "使用空间"
IDS_SHV_COLUMN7 "剩余空间"
IDS_SHV_COLUMN8 "Name" /*FIXME*/
IDS_SHV_COLUMN9 "Comments" /*FIXME*/
END
#pragma code_page(default)

View File

@@ -0,0 +1,181 @@
/*
* Copyright 1998 Juergen Schmied
* Copyright 2003 Filip Navara
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "&Vedle sebe", FCIDM_SHVIEW_BIGICON
MENUITEM "&Ikony", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Seznam", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Podrobnosti", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "Z&obrazit"
BEGIN
MENUITEM "&Vedle sebe", FCIDM_SHVIEW_BIGICON
MENUITEM "&Ikony", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Seznam", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Podrobnosti", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Seøadit &ikony"
BEGIN
MENUITEM "Podle &Názvu", 0x30 /* column 0 */
MENUITEM "Podle &Typu", 0x32 /* column 2 */
MENUITEM "Podle &Velikosti", 0x31 /* ... */
MENUITEM "Podle &Data", 0x33
MENUITEM SEPARATOR
MENUITEM "&Rovnat automaticky", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Zarovnat ikony", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "A&ktualizovat", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "V&ložit", FCIDM_SHVIEW_INSERT
MENUITEM "Vložit zást&upce", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "&Nový"
BEGIN
MENUITEM "Nová &složka", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "Nový &zástupce", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "&Vlastnosti", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "P&rozkoumat", FCIDM_SHVIEW_EXPLORE
MENUITEM "O&tevøít", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "Vyj&mout", FCIDM_SHVIEW_CUT
MENUITEM "&Kopírovat", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "Vytvoøit zástupc&e", FCIDM_SHVIEW_CREATELINK
MENUITEM "O&dstranit", FCIDM_SHVIEW_DELETE
MENUITEM "&Pøejmenovat", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Vlastnosti", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Procházet..."
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Storno", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "O aplikaci %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS je d¡lem:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Zadejte název programu, složky, dokumentu, nebo zdroje v síti Internet a ReactOS jej pro vás otevøe.", 12289, 36, 11, 182, 18
LTEXT "&Otevøít:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Storno", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Procházet...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Plocha"
IDS_MYCOMPUTER "Tento poèítaè"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "&Vedle sebe"
IDS_VIEW_SMALL "&Ikony"
IDS_VIEW_LIST "&Seznam"
IDS_VIEW_DETAILS "&Podrobnosti"
IDS_SELECT "Vybrat"
IDS_OPEN "Otevøít"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Nelze vytvoøit novou složku protože pøistup byl odepøen."
IDS_CREATEFOLDER_CAPTION "Chyba pøi pokusu vytvoøit nový adresáø"
IDS_DELETEITEM_CAPTION "Potvrdit odstranìní souboru"
IDS_DELETEFOLDER_CAPTION "Potvrdit odstranìní adresáøe"
IDS_OVERWRITEFILE_CAPTION "Potvrdit pøepsání souboru"
IDS_DELETEITEM_TEXT "Opravdu chcete odstranit '%1'?"
IDS_DELETEMULTIPLE_TEXT "Opravdu chcete odstranit tìchto %1 položek?"
IDS_OVERWRITEFILE_TEXT "Pøejete si pøepsat soubor '%1'?"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Název"
IDS_SHV_COLUMN2 "Velikost"
IDS_SHV_COLUMN3 "Typ"
IDS_SHV_COLUMN4 "Zmìnìno"
IDS_SHV_COLUMN5 "Atributy"
IDS_SHV_COLUMN6 "Velikost"
IDS_SHV_COLUMN7 "Volné místo"
IDS_SHV_COLUMN8 "Jméno"
IDS_SHV_COLUMN9 "Komentáø"
END

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Om %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS havde ikke været mulig uden hjælp fra disse personer:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,190 @@
/*
* Copyright 1998 Juergen Schmied
* Copyright 2004 Henning Gerhardt
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON
MENUITEM "&Kleine Symbole", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Ansicht"
BEGIN
MENUITEM "&Große Symbole", FCIDM_SHVIEW_BIGICON
MENUITEM "&Kleine Symbole", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Symbole anordnen"
BEGIN
MENUITEM "Nach &Name", 0x30 /* column 0 */
MENUITEM "Nach &Typ", 0x32 /* column 2 */
MENUITEM "Nach &Größe", 0x31 /* ... */
MENUITEM "Nach &Datum", 0x33
MENUITEM SEPARATOR
MENUITEM "&Automatisch anordnen", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Line up Icons", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "Aktualisieren", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Einfügen", FCIDM_SHVIEW_INSERT
MENUITEM "Einfügen als Verweis", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "Neu"
BEGIN
MENUITEM "Neues Ver&zeichnis", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "Neuer Ver&weis", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "&Eigenschaften", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "E&rkunden", FCIDM_SHVIEW_EXPLORE
MENUITEM "&Öffnen", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "&Ausschneiden", FCIDM_SHVIEW_CUT
MENUITEM "&Kopieren", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "Erstelle Ver&weis", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Löschen", FCIDM_SHVIEW_DELETE
MENUITEM "&Umbenennen", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Eigenschaften", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Nach Verzeichnis durchsuchen"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Abbrechen", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Informationen über %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS wurde Ihnen zur Verfügung gestellt von:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Den Namen eines Programmes, eines Ordners, eines Dokumentes oder einer Internet Ressource eingeben, und ReactOS wird es für Sie öffnen", 12289, 36, 11, 182, 18
LTEXT "&Öffnen:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Abbrechen", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Durchsuchen...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Desktop"
IDS_MYCOMPUTER "Arbeitsplatz"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "&Große Symbole"
IDS_VIEW_SMALL "&Kleine Symbole"
IDS_VIEW_LIST "&Liste"
IDS_VIEW_DETAILS "&Details"
IDS_SELECT "Auswählen"
IDS_OPEN "Öffnen"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Es konnte kein neues Verzeichnis erstellt werden: Zugriff verweigert."
IDS_CREATEFOLDER_CAPTION "Es trat ein Fehler beim Erstellen eines neuen Verzeichnisses auf"
IDS_DELETEITEM_CAPTION "Bestätigung: Datei löschen"
IDS_DELETEFOLDER_CAPTION "Bestätigung: Verzeichnis löschen"
IDS_DELETEITEM_TEXT "Sind Sie sich sicher, dass Sie die Datei '%1' löschen möchten ?"
IDS_DELETEMULTIPLE_TEXT "Sind Sie sich sicher, dass Sie diese %1 Dateien löschen möchten ?"
IDS_OVERWRITEFILE_TEXT "Möchten Sie, dass die Datei '%1' überschrieben wird ?"
IDS_OVERWRITEFILE_CAPTION "Bestätigung: Datei überschreiben"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Datei"
IDS_SHV_COLUMN2 "Größe"
IDS_SHV_COLUMN3 "Typ"
IDS_SHV_COLUMN4 "Geändert"
IDS_SHV_COLUMN5 "Attribute"
IDS_SHV_COLUMN6 "Gesamtgröße"
IDS_SHV_COLUMN7 "Freier Speicher"
IDS_SHV_COLUMN8 "Name"
IDS_SHV_COLUMN9 "Kommentar"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Neustarten"
IDS_RESTART_PROMPT "Möchten Sie, dass ein simulierter Windows Neustart durchgeführt wird ?"
IDS_SHUTDOWN_TITLE "Anhalten"
IDS_SHUTDOWN_PROMPT "Möchten Sie die aktuelle ReactOS Sitzung beenden ?"
}

View File

@@ -0,0 +1,221 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "Lar&ge Icons", FCIDM_SHVIEW_BIGICON
MENUITEM "S&mall Icons", FCIDM_SHVIEW_SMALLICON
MENUITEM "&List", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&View"
BEGIN
MENUITEM "Lar&ge Icons", FCIDM_SHVIEW_BIGICON
MENUITEM "S&mall Icons", FCIDM_SHVIEW_SMALLICON
MENUITEM "&List", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Details", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Arrange &Icons"
BEGIN
MENUITEM "By &Name", 0x30 /* column 0 */
MENUITEM "By &Type", 0x32 /* column 2 */
MENUITEM "By &Size", 0x31 /* ... */
MENUITEM "By &Date", 0x33
MENUITEM SEPARATOR
MENUITEM "&Auto Arrange", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Line up Icons", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "Refresh", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Paste", FCIDM_SHVIEW_INSERT
MENUITEM "Paste as Link", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "New"
BEGIN
MENUITEM "New &Folder", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "New &Link", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "Properties", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "E&xplore", FCIDM_SHVIEW_EXPLORE
MENUITEM "&Open", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "C&ut", FCIDM_SHVIEW_CUT
MENUITEM "&Copy", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "Create &Link", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Delete", FCIDM_SHVIEW_DELETE
MENUITEM "&Rename", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Properties", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Browse for Folder"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Cancel", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Desktop"
IDS_MYCOMPUTER "My Computer"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "Lar&ge Icons"
IDS_VIEW_SMALL "S&mall Icons"
IDS_VIEW_LIST "&List"
IDS_VIEW_DETAILS "&Details"
IDS_SELECT "Select"
IDS_OPEN "Open"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Can not create new Folder: Permission denied."
IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder"
IDS_DELETEITEM_CAPTION "Confirm file delete"
IDS_DELETEFOLDER_CAPTION "Confirm folder delete"
IDS_DELETEITEM_TEXT "Are you sure you want to delete '%1'?"
IDS_DELETEMULTIPLE_TEXT "Are you sure you want to delete these %1 items?"
IDS_OVERWRITEFILE_TEXT "OverWrite File %1?"
IDS_OVERWRITEFILE_CAPTION "Confirm File OverWrite"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "File"
IDS_SHV_COLUMN2 "Size"
IDS_SHV_COLUMN3 "Type"
IDS_SHV_COLUMN4 "Modified"
IDS_SHV_COLUMN5 "Attributes"
IDS_SHV_COLUMN6 "Size"
IDS_SHV_COLUMN7 "Size available"
IDS_SHV_COLUMN8 "Name"
IDS_SHV_COLUMN9 "Comments"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Restart"
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
}
/* shell folder path default values */
STRINGTABLE DISCARDABLE
{
IDS_PROGRAMS "Start Menu\\Programs"
IDS_PERSONAL "My Documents"
IDS_FAVORITES "Favorites"
IDS_STARTUP "Start Menu\\Programs\\StartUp"
IDS_RECENT "Recent"
IDS_SENDTO "SendTo"
IDS_STARTMENU "Start Menu"
IDS_MYMUSIC "My Documents\\My Music"
IDS_MYVIDEO "My Documents\\My Video"
IDS_DESKTOPDIRECTORY "Desktop"
IDS_NETHOOD "NetHood"
IDS_TEMPLATES "Templates"
IDS_APPDATA "Application Data"
IDS_PRINTHOOD "PrintHood"
IDS_LOCAL_APPDATA "Local Settings\\Application Data"
IDS_INTERNET_CACHE "Temporary Internet Files"
IDS_COOKIES "Cookies"
IDS_HISTORY "History"
IDS_PROGRAM_FILES "Program Files"
IDS_MYPICTURES "My Documents\\My Pictures"
IDS_PROGRAM_FILES_COMMON "Program Files\\Common Files"
IDS_COMMON_DOCUMENTS "Documents"
IDS_ADMINTOOLS "Start Menu\\Programs\\Administrative Tools"
IDS_COMMON_MUSIC "Documents\\My Music"
IDS_COMMON_PICTURES "Documents\\My Pictures"
IDS_COMMON_VIDEO "Documents\\My Video"
IDS_CDBURN_AREA "Local Settings\\Application Data\\Microsoft\\CD Burning"
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Pri %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "Enorde", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,190 @@
/*
* Copyright 1998 Juergen Schmied
* Copyright 2003,2004 José Manuel Ferrer Ortiz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "Iconos &grandes", FCIDM_SHVIEW_BIGICON
MENUITEM "Iconos &pequeños", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Detalles", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Ver"
BEGIN
MENUITEM "Iconos &grandes", FCIDM_SHVIEW_BIGICON
MENUITEM "Iconos &pequeños", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Detalles", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Ordenar &iconos"
BEGIN
MENUITEM "Por &nombre", 0x30 /* column 0 */
MENUITEM "Por &tipo", 0x32 /* column 2 */
MENUITEM "Por t&amaño", 0x31 /* ... */
MENUITEM "Por &fecha", 0x33
MENUITEM SEPARATOR
MENUITEM "&Ordenar automáticamente", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Alinear iconos", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "Actualizar", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Pegar", FCIDM_SHVIEW_INSERT
MENUITEM "Pegar acceso directo", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "Nuevo"
BEGIN
MENUITEM "Nueva &carpeta", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "Nuevo &acceso directo", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "Propiedades", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "E&xplorar", FCIDM_SHVIEW_EXPLORE
MENUITEM "&Abrir", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "C&ortar", FCIDM_SHVIEW_CUT
MENUITEM "&Copiar", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "C&rear acceso directo", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Eliminar", FCIDM_SHVIEW_DELETE
MENUITEM "Re&nombrar", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Propiedades", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Explorar carpeta"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "Aceptar", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Cancelar", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Acerca de %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "Aceptar", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS está disponible gracias a:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Introduzca el nombre de un programa, carpeta, documento o recurso de Internet, y ReactOS lo abrirá para usted.", 12289, 36, 11, 182, 18
LTEXT "&Abrir:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "Aceptar", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancelar", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Examinar...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Escritorio"
IDS_MYCOMPUTER "Mi PC"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "Iconos &grandes"
IDS_VIEW_SMALL "Iconos &pequeños"
IDS_VIEW_LIST "&Lista"
IDS_VIEW_DETAILS "&Detalles"
IDS_SELECT "Seleccionar"
IDS_OPEN "Abrir"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "No se puede crear nueva carpeta: Permiso denegado."
IDS_CREATEFOLDER_CAPTION "Error durante la creación de una nueva carpeta"
IDS_DELETEITEM_CAPTION "Confirmar eliminación de archivo"
IDS_DELETEFOLDER_CAPTION "Confirmar eliminación de carpeta"
IDS_DELETEITEM_TEXT "¿Seguro que desea eliminar '%1'?"
IDS_DELETEMULTIPLE_TEXT "¿Seguro que desea eliminar estos %1 elementos?"
IDS_OVERWRITEFILE_TEXT "¿Sobreescribir el archivo '%1'?"
IDS_OVERWRITEFILE_CAPTION "Confirmar sobreescritura de archivo"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Archivo"
IDS_SHV_COLUMN2 "Tamaño"
IDS_SHV_COLUMN3 "Tipo"
IDS_SHV_COLUMN4 "Modificado"
IDS_SHV_COLUMN5 "Atributos"
IDS_SHV_COLUMN6 "Tamaño"
IDS_SHV_COLUMN7 "Tamaño disponible"
IDS_SHV_COLUMN8 "Nombre"
IDS_SHV_COLUMN9 "Comentarios"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Reiniciar"
IDS_RESTART_PROMPT "¿Desea simular un reinicio de Windows?"
IDS_SHUTDOWN_TITLE "Apagar"
IDS_SHUTDOWN_PROMPT "¿Desea terminar su sesión ReactOS?"
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Tietoja: %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS:n tekijät:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,224 @@
/*
* Shell32
* French language support
*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "&Grands icônes", FCIDM_SHVIEW_BIGICON
MENUITEM "&Petits icônes", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Détails", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Affichage"
BEGIN
MENUITEM "&Grands icônes", FCIDM_SHVIEW_BIGICON
MENUITEM "&Petits icônes", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Liste", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Détails", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Trier les &icônes"
BEGIN
MENUITEM "Par &nom", 0x30 /* column 0 */
MENUITEM "Par &type", 0x32 /* column 2 */
MENUITEM "Par t&aille", 0x31 /* ... */
MENUITEM "Par &date", 0x33
MENUITEM SEPARATOR
MENUITEM "T&ri automatique", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Aligner les icônes", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "Rafraîchir", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Coller", FCIDM_SHVIEW_INSERT
MENUITEM "Coller comme un lien", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "Nouveau"
BEGIN
MENUITEM "Nouveau d&ossier", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "Nouveau &lien", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "Propriétés", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "E&xplorer", FCIDM_SHVIEW_EXPLORE
MENUITEM "&Ouvrir", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "C&ouper", FCIDM_SHVIEW_CUT
MENUITEM "&Copier", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "Créer un &lien", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Supprimer", FCIDM_SHVIEW_DELETE
MENUITEM "&Renommer", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Propriétés", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Parcourir"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Annuler", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "À propos de %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS est une réalisation de :", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Entrez le nom d'un programme, d'un dossier, d'un document ou d'une ressource Internet, et ReactOS l'ouvrira pour vous.", 12289, 36, 11, 182, 18
LTEXT "&Ouvrir :", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Annuler", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Parcourir...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Bureau"
IDS_MYCOMPUTER "Poste de travail"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "&Grands icônes"
IDS_VIEW_SMALL "&Petits icônes"
IDS_VIEW_LIST "&Liste"
IDS_VIEW_DETAILS "&Détails"
IDS_SELECT "Sélectionner"
IDS_OPEN "Ouvrir"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Impossible de créer le nouveau dossier : permission refusée."
IDS_CREATEFOLDER_CAPTION "Erreur lors de la création du nouveau dossier"
IDS_DELETEITEM_CAPTION "Confirmer la suppression du fichier"
IDS_DELETEFOLDER_CAPTION "Confirmer la suppression du dossier"
IDS_DELETEITEM_TEXT "Êtes-vous sûr de vouloir supprimer '%1'?"
IDS_DELETEMULTIPLE_TEXT "Êtes-vous sût de vouloir supprimer ces %1 items ?"
IDS_OVERWRITEFILE_TEXT "Écraser le fichier %1?"
IDS_OVERWRITEFILE_CAPTION "Confirmer l'écrasement du fichier"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Fichier"
IDS_SHV_COLUMN2 "Taille"
IDS_SHV_COLUMN3 "Type"
IDS_SHV_COLUMN4 "Modifié"
IDS_SHV_COLUMN5 "Attributs"
IDS_SHV_COLUMN6 "Capacité"
IDS_SHV_COLUMN7 "Espace disponible"
IDS_SHV_COLUMN8 "Nom"
IDS_SHV_COLUMN9 "Commentaires"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Redémarrer"
IDS_RESTART_PROMPT "Voulez-vous simuler le redémarrage de Windows?"
IDS_SHUTDOWN_TITLE "Arrêter"
IDS_SHUTDOWN_PROMPT "Voulez-vous fermer la session ReactOS?"
}
/* shell folder path default values */
STRINGTABLE DISCARDABLE
{
IDS_PROGRAMS "Menu Démarrer\\Programmes"
IDS_PERSONAL "Mes documents"
IDS_FAVORITES "Favoris"
IDS_STARTUP "Menu Démarrer\\Programmes\\Démarrage"
IDS_RECENT "Recent"
IDS_SENDTO "SendTo"
IDS_STARTMENU "Menu Démarrer"
IDS_MYMUSIC "Mes documents\\Ma musique"
IDS_MYVIDEO "Mes documents\\Mes vidéos"
IDS_DESKTOPDIRECTORY "Bureau"
IDS_NETHOOD "Voisinage Réseau"
IDS_TEMPLATES "Modèles"
IDS_APPDATA "Application Data"
IDS_PRINTHOOD "Voisinage d'impression"
IDS_LOCAL_APPDATA "Local Settings\\Application Data"
IDS_INTERNET_CACHE "Temporary Internet Files"
IDS_COOKIES "Cookies"
IDS_HISTORY "Historique"
IDS_PROGRAM_FILES "Program Files"
IDS_MYPICTURES "Mes documents\\Mes images"
IDS_PROGRAM_FILES_COMMON "Program Files\\Fichiers communs"
IDS_COMMON_DOCUMENTS "Documents"
IDS_ADMINTOOLS "Menu Démarrer\\Programmes\\Outils d'administration"
IDS_COMMON_MUSIC "Documents\\Ma musique"
IDS_COMMON_PICTURES "Documents\\Mes images"
IDS_COMMON_VIDEO "Documents\\Mes vidéos"
IDS_CDBURN_AREA "Local Settings\\Application Data\\Microsoft\\CD Burning"
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "A %s-rõl"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "A ReactOS-t írták:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,191 @@
/*
* Copyright 1998 Juergen Schmied
* Copyright 2003-2004 Puoti
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "&Icone Grandi", FCIDM_SHVIEW_BIGICON
MENUITEM "&Icone Piccole", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Dettagli", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Visualizza"
BEGIN
MENUITEM "&Icone Grandi", FCIDM_SHVIEW_BIGICON
MENUITEM "&Icone Piccole", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Dettagli", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Disponi &Icone"
BEGIN
MENUITEM "Per &Nome", 0x30 /* column 0 */
MENUITEM "Per &Tipo", 0x32 /* column 2 */
MENUITEM "Per &Dimensione", 0x31 /* ... */
MENUITEM "Per &Data", 0x33
MENUITEM SEPARATOR
MENUITEM "&Disponi Automaticamente", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Allinea Icone", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "Aggiorna", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Incolla", FCIDM_SHVIEW_INSERT
MENUITEM "Crea Collegamento", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "Nuovo"
BEGIN
MENUITEM "Nuova &Cartella", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "Nuovo &Collegamento", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "Proprietà", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "E&splora", FCIDM_SHVIEW_EXPLORE
MENUITEM "&Apri", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "&Taglia", FCIDM_SHVIEW_CUT
MENUITEM "&Copia", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "&Crea Collegamento", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Cancella", FCIDM_SHVIEW_DELETE
MENUITEM "&Rinomina", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Proprietà", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Sfoglia Cartella"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Annulla", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Informazioni su %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS è disponibile grazie a:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Digitare il nome del programma, della cartella, del documento o della risorsa internet, e ReactOS la aprirà.", 12289, 36, 11, 182, 18
LTEXT "&Apri:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Annulla", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Esplora...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Desktop"
IDS_MYCOMPUTER "Risorse del Computer"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "&Icone Grandi"
IDS_VIEW_SMALL "I&cone Piccole"
IDS_VIEW_LIST "&Lista"
IDS_VIEW_DETAILS "&Dettagli"
IDS_SELECT "Selezione"
IDS_OPEN "Apri"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Impossibile creare la cartella: Accesso negato."
IDS_CREATEFOLDER_CAPTION "Errore durante la creazione della cartella"
IDS_DELETEITEM_CAPTION "Confermare la cancallazione del file"
IDS_DELETEFOLDER_CAPTION "Confermare la cancellazione della cartella"
IDS_DELETEITEM_TEXT "Sei sicuro di voler cancellare '%1'?"
IDS_DELETEMULTIPLE_TEXT "Sei sicuro di voler cancellare questi %1 elementi?"
IDS_OVERWRITEFILE_TEXT "Sovrascrivere il File %1?"
IDS_OVERWRITEFILE_CAPTION "Confermare la sovrascrizione del File"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "File"
IDS_SHV_COLUMN2 "Dimensione"
IDS_SHV_COLUMN3 "Tipo"
IDS_SHV_COLUMN4 "Modificato"
IDS_SHV_COLUMN5 "Attributi"
IDS_SHV_COLUMN6 "Dimensione"
IDS_SHV_COLUMN7 "Dimensione disponibile"
IDS_SHV_COLUMN8 "Nome"
IDS_SHV_COLUMN9 "Commenti"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Riavvia"
IDS_RESTART_PROMPT "Vuoi simulare un riavvio do Windows?"
IDS_SHUTDOWN_TITLE "Termina sessione"
IDS_SHUTDOWN_PROMPT "Vuoi terminare la sessione di ReactOS?"
}

View File

@@ -0,0 +1,140 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "大きなアイコン(&G)", FCIDM_SHVIEW_BIGICON
MENUITEM "小さなアイコン(&M)", FCIDM_SHVIEW_SMALLICON
MENUITEM "一覧(&L)", FCIDM_SHVIEW_LISTVIEW
MENUITEM "詳細(&D)", FCIDM_SHVIEW_REPORTVIEW
END
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "表\示(&V)"
BEGIN
MENUITEM "大きいアイコン(&G)", FCIDM_SHVIEW_BIGICON
MENUITEM "小さいアイコン(&M)", FCIDM_SHVIEW_SMALLICON
MENUITEM "一覧(&L)", FCIDM_SHVIEW_LISTVIEW
MENUITEM "詳細(&D)", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "アイコンの整列(&I)"
BEGIN
MENUITEM "名前順(&N)", 0x30 /* column 0 */
MENUITEM "種類順(&T)", 0x32 /* column 2 */
MENUITEM "サイズ順(&S)", 0x31 /* ... */
MENUITEM "日付順(&D)", 0x33
MENUITEM SEPARATOR
MENUITEM "アイコンの自動整列(&A)", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "等間隔に整列", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "貼\り付け", FCIDM_SHVIEW_INSERT
MENUITEM "ショートカットの貼\り付け", FCIDM_SHVIEW_INSERTLINK
POPUP "新規作成"
BEGIN
MENUITEM "新規フォルダ(&F)", 0x7053
MENUITEM "新規ショートカット(&L)", 0x7052
MENUITEM SEPARATOR
END
MENUITEM "プロパティ", FCIDM_SHVIEW_PROPERTIES
END
END
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "切り取り(&U)", FCIDM_SHVIEW_CUT
MENUITEM "コピー(&C)", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "ショートカットの作成(&L)", 0x7051
MENUITEM "削除(&D)", FCIDM_SHVIEW_DELETE
MENUITEM "名前の変更(&R)", 0x7050
MENUITEM SEPARATOR
MENUITEM "プロパティ(&P)", FCIDM_SHVIEW_PROPERTIES
END
END
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "デスクトップ"
IDS_MYCOMPUTER "マイコンピュータ"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "大きいアイコン(&G)"
IDS_VIEW_SMALL "小さいアイコン(&M)"
IDS_VIEW_LIST "一覧(&L)"
IDS_VIEW_DETAILS "詳細(&D)"
IDS_SELECT "選択"
IDS_OPEN "開く"
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "%s について"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/* columns in the shellview */
STRINGTABLE DISCARDABLE
BEGIN
IDS_SHV_COLUMN1 "名前"
IDS_SHV_COLUMN2 "サイズ"
IDS_SHV_COLUMN3 "ファイルの種類"
IDS_SHV_COLUMN4 "更新日時"
IDS_SHV_COLUMN5 "属性"
IDS_SHV_COLUMN6 "合計サイズ"
IDS_SHV_COLUMN7 "空き容量"
IDS_SHV_COLUMN8 "Name" /*FIXME*/
IDS_SHV_COLUMN9 "Comments" /*FIXME*/
END

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "%s¿¡ °üÇÏ¿©"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "È®ÀÎ", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Info %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS is geschreven door:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_NORWEGIAN, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Om %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,190 @@
/*
* Copyright 1998 Juergen Schmied
* Copyright 2004 Piotr Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "&Du¿e Ikony", FCIDM_SHVIEW_BIGICON
MENUITEM "&Ma³e Ikony", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Szczegó³y", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Widok"
BEGIN
MENUITEM "&Du¿e Ikony", FCIDM_SHVIEW_BIGICON
MENUITEM "&Ma³e Ikony", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Szczegó³y", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Rozmieœæ &ikony wed³ug"
BEGIN
MENUITEM "&Nazwy", 0x30 /* column 0 */
MENUITEM "&Typu", 0x32 /* column 2 */
MENUITEM "&Wielkoœci", 0x31 /* ... */
MENUITEM "&Daty", 0x33
MENUITEM SEPARATOR
MENUITEM "&Autorozmieszczanie", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "&Wyrównaj ikony", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "&Odœwierz", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "W&klej", FCIDM_SHVIEW_INSERT
MENUITEM "Wklej s&krót", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "&Nowy"
BEGIN
MENUITEM "&Folder", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "&Skrót", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "W³aœciwoœci", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&Eksploruj", FCIDM_SHVIEW_EXPLORE
MENUITEM "&Otwórz", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "&Wytnij", FCIDM_SHVIEW_CUT
MENUITEM "&Kopiuj", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "Utwórz &Skrót", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Usuñ", FCIDM_SHVIEW_DELETE
MENUITEM "&Zmieñ nazwê", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "W³&aœciwoœci", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Wybierz folder"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Anuluj", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "O %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "Mo¿esz korzystaæ z ReactOS'a dziêki:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Wpisz nazwê programu, katalogu, dokumentu, a ReactOS otworzy go dla ciebie.", 12289, 36, 11, 182, 18
LTEXT "&Otwórz:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Anuluj", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Przegl¹daj...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Pulpit"
IDS_MYCOMPUTER "Mój komputer"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "&Du¿e Ikony"
IDS_VIEW_SMALL "&Ma³e Ikony"
IDS_VIEW_LIST "&Lista"
IDS_VIEW_DETAILS "&Szczegó³y"
IDS_SELECT "Zaznacz"
IDS_OPEN "Otwórz"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Nie mogê utworzyæ nowego katalogu: Brak dostêpu."
IDS_CREATEFOLDER_CAPTION "B³¹d przy tworzeniu nowego katalogu."
IDS_DELETEITEM_CAPTION "PotwierdŸ usuniêcia pliku"
IDS_DELETEFOLDER_CAPTION "PotwierdŸ usuniêcie katalogu"
IDS_DELETEITEM_TEXT "Czy jesteœ pewien, ¿e chcesz usun¹æ '%1'?"
IDS_DELETEMULTIPLE_TEXT "Czy jesteœ pewien, ¿e chcesz usun¹æ te %1 pliki?"
IDS_OVERWRITEFILE_TEXT "Zast¹piæ plik %1?"
IDS_OVERWRITEFILE_CAPTION "PotwierdŸ zast¹pienie pliku"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Plik"
IDS_SHV_COLUMN2 "WielkoϾ"
IDS_SHV_COLUMN3 "Typ"
IDS_SHV_COLUMN4 "Modyfikacja"
IDS_SHV_COLUMN5 "Atrybuty"
IDS_SHV_COLUMN6 "WielkoϾ"
IDS_SHV_COLUMN7 "Dostêpna wielkoœæ"
IDS_SHV_COLUMN8 "Nazwa"
IDS_SHV_COLUMN9 "Komentarz"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Uruchom ponownie"
IDS_RESTART_PROMPT "Czy chcesz zasymulowaæ zrestartowanie Windowsa?"
IDS_SHUTDOWN_TITLE "Wy³¹cz"
IDS_SHUTDOWN_PROMPT "Czy chcesz wy³¹czyæ sesjê ReactOS'a?"
}

View File

@@ -0,0 +1,190 @@
/*
* Copyright 1998 Juergen Schmied
* Copyright 2003 Marcelo Duarte
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "Ícones &grandes", FCIDM_SHVIEW_BIGICON
MENUITEM "Ícones &pequenos", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Detalhes", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Exibir"
BEGIN
MENUITEM "Ícones &grandes", FCIDM_SHVIEW_BIGICON
MENUITEM "Ícones &pequenos", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Lista", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Detalhes", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "O&rganizar ícones"
BEGIN
MENUITEM "Por &nome", 0x30 /* column 0 */
MENUITEM "Por &tipo", 0x32 /* column 2 */
MENUITEM "Por ta&manho", 0x31 /* ... */
MENUITEM "Por &data", 0x33
MENUITEM SEPARATOR
MENUITEM "Auto organi&zar", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Alin&har ícones", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "&Atualizar", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Co&lar", FCIDM_SHVIEW_INSERT
MENUITEM "Colar a&talho", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "Novo"
BEGIN
MENUITEM "&Pasta", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "&Atalho", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "Propriedades", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&Explorar", FCIDM_SHVIEW_EXPLORE
MENUITEM "A&brir", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "C&ortar", FCIDM_SHVIEW_CUT
MENUITEM "&Copiar", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "Criar a&talho", FCIDM_SHVIEW_CREATELINK
MENUITEM "E&xcluir", FCIDM_SHVIEW_DELETE
MENUITEM "&Renomear", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Propriedades", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Procurar pasta"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Cancelar", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Sobre %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS foi disponibilizado por:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Digite o nome do programa, pasta, documento, ou endereço Internet, que o ReactOS irá abrí-lo para você.", 12289, 36, 11, 182, 18
LTEXT "&Abrir:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancelar", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Procurar...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Área de trabalho"
IDS_MYCOMPUTER "Meu computador"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "Ícones &grandes"
IDS_VIEW_SMALL "Ícones &pequenos"
IDS_VIEW_LIST "&Lista"
IDS_VIEW_DETAILS "&Detalhes"
IDS_SELECT "Selecionar"
IDS_OPEN "Abrir"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Não pode criar nova pasta: Permissão negada."
IDS_CREATEFOLDER_CAPTION "Erro durante a criação da nova pasta"
IDS_DELETEITEM_CAPTION "Confirmar exclusão de arquivo"
IDS_DELETEFOLDER_CAPTION "Confirmar exclusão de pasta"
IDS_DELETEITEM_TEXT "Você tem certeza que deseja excluir '%1'?"
IDS_DELETEMULTIPLE_TEXT "Você tem certeza que deseja excluir estes %1 itens?"
IDS_OVERWRITEFILE_TEXT "Sobreescrever arquivo %1?"
IDS_OVERWRITEFILE_CAPTION "Confirmar sobreescrever arquivo"
}
/* colunas no shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Arquivo"
IDS_SHV_COLUMN2 "Tamanho"
IDS_SHV_COLUMN3 "Tipo"
IDS_SHV_COLUMN4 "Modificado"
IDS_SHV_COLUMN5 "Atributos"
IDS_SHV_COLUMN6 "Tamanho"
IDS_SHV_COLUMN7 "Disponível"
IDS_SHV_COLUMN8 "Nome"
IDS_SHV_COLUMN9 "Comentários"
END
/* message box strings */
STRINGTABLE DISCARDABLE
{
IDS_RESTART_TITLE "Reiniciar"
IDS_RESTART_PROMPT "Você quer simular a reinicialização do Windows?"
IDS_SHUTDOWN_TITLE "Desligar"
IDS_SHUTDOWN_PROMPT "Você quer finalizar a sessão no ReactOS?"
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Î %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "Ðàçðàáîò÷èêè ReactOS:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Ââåäèòå èìÿ ïðîãðàììû, ïàïêè, äîêóìåíòà èëè ðåñóðñ Èíòåðíåòà, è ReactOS îòêðîåò èõ.", 12289, 36, 11, 182, 18
LTEXT "&Îòêðûòü:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Îòìåíà", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Îá&çîð...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright 2002-2003 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "O %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "V redu", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS so ustvarili:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Vnesite ime programa, mape, dokumenta ali spletne strani, in ReactOS ga (jo) bo odprl.", 12289, 36, 11, 182, 18
LTEXT "&Odpri:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "V redu", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Preklièi", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Pre&brskaj", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/* columns in the shellview */
STRINGTABLE LANGUAGE LANG_SLOVENIAN, SUBLANG_NEUTRAL
BEGIN
IDS_SHV_COLUMN1 "Datoteka"
IDS_SHV_COLUMN2 "Velikost"
IDS_SHV_COLUMN3 "Vrsta"
IDS_SHV_COLUMN4 "Spremenjena"
IDS_SHV_COLUMN5 "Atributi"
IDS_SHV_COLUMN6 "Toèna velikost"
IDS_SHV_COLUMN7 "Prosto"
IDS_SHV_COLUMN8 "Name" /*FIXME*/
IDS_SHV_COLUMN9 "Comments" /*FIXME*/
END

View File

@@ -0,0 +1,60 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "O programe %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "Víno pre vás pripravili:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/* columns in the shellview */
STRINGTABLE LANGUAGE LANG_SLOVAK, SUBLANG_NEUTRAL
BEGIN
IDS_SHV_COLUMN1 "Súbor"
IDS_SHV_COLUMN2 "Ve¾kos<6F>"
IDS_SHV_COLUMN3 "Typ"
IDS_SHV_COLUMN4 "Modifikovaný"
IDS_SHV_COLUMN5 "Atribúty"
IDS_SHV_COLUMN6 "Ve¾kos<6F>"
IDS_SHV_COLUMN7 "Ve¾kos<6F> k dispozícii"
IDS_SHV_COLUMN8 "Name" /*FIXME*/
IDS_SHV_COLUMN9 "Comments" /*FIXME*/
END

View File

@@ -0,0 +1,46 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Om %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS hade inte varit möjligt utan dessa personer:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Skriv namnet på ett program, en mapp eller ett dokument och ReactOS kommer att öppna det för dig.", 12289, 36, 11, 182, 18
LTEXT "&Öppna:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Avbryt", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Bläddra...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,178 @@
/*
* Copyright 2004 Ilya Korniyko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
MENU_001 MENU DISCARDABLE
BEGIN
MENUITEM "&Âåëèê³ ²êîíêè", FCIDM_SHVIEW_BIGICON
MENUITEM "&Ìàë³ ²êîíêè", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Ñïèñîê", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Ïîäðîáèö³", FCIDM_SHVIEW_REPORTVIEW
END
/*
shellview background menu
*/
MENU_002 MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
POPUP "&Âèãëÿä"
BEGIN
MENUITEM "&Âåëèê³ ²êîíêè", FCIDM_SHVIEW_BIGICON
MENUITEM "&Ìàë³ ²êîíêè", FCIDM_SHVIEW_SMALLICON
MENUITEM "&Ñïèñîê", FCIDM_SHVIEW_LISTVIEW
MENUITEM "&Ïîäðîáèö³", FCIDM_SHVIEW_REPORTVIEW
END
MENUITEM SEPARATOR
POPUP "Âïîðÿäêóâàòè &²êîíêè"
BEGIN
MENUITEM "Çà &Íàçâîþ", 0x30 /* column 0 */
MENUITEM "Çà &Òèïîì", 0x32 /* column 2 */
MENUITEM "Çà &Ðîçì³ðîì", 0x31 /* ... */
MENUITEM "Çà &Äàòîþ", 0x33
MENUITEM SEPARATOR
MENUITEM "&Àâòîìàòè÷íî", FCIDM_SHVIEW_AUTOARRANGE
END
MENUITEM "Âèð³âíÿòè ²êîíêè", FCIDM_SHVIEW_SNAPTOGRID
MENUITEM SEPARATOR
MENUITEM "Îíîâèòè", FCIDM_SHVIEW_REFRESH
MENUITEM SEPARATOR
MENUITEM "Âñòàâèòè", FCIDM_SHVIEW_INSERT
MENUITEM "Âñòàâèòè Ïîñèëàííÿ", FCIDM_SHVIEW_INSERTLINK
MENUITEM SEPARATOR
POPUP "Ñòâîðèòè"
BEGIN
MENUITEM "Íîâà &Òåêà", FCIDM_SHVIEW_NEWFOLDER
MENUITEM "Íîâå &Ïîñèëàííÿ", FCIDM_SHVIEW_NEWLINK
MENUITEM SEPARATOR
END
MENUITEM SEPARATOR
MENUITEM "Âëàñòèâîñò³", FCIDM_SHVIEW_PROPERTIES
END
END
/*
shellview item menu
*/
MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&Ïðîâ³äíèê", FCIDM_SHVIEW_EXPLORE
MENUITEM "&³äêðèòè", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
MENUITEM "Âè&ð³çàòè", FCIDM_SHVIEW_CUT
MENUITEM "&Êîï³ÿ", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
MENUITEM "&Ñòâîðèòè Ïîñèëàííÿ", FCIDM_SHVIEW_CREATELINK
MENUITEM "Âè&äàëèòè", FCIDM_SHVIEW_DELETE
MENUITEM "Ïåðå&éìåíóâàòè", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
MENUITEM "&Âëàñòèâîñò³", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME | DS_SETFONT | DS_3DLOOK
CAPTION "Îãëÿä äî òåêè"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "³äì³íà", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32",
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
WS_BORDER | WS_TABSTOP,
4, 40, 180, 120
}
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Ïðî %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "Ðîçðîáíèêè ReactOS:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Ââåä³òü ³ì'ÿ ïðîãðàìè, òåêè, äîêóìåíòó ÷è ðåñóðñ ²íòåðíåòó, ³ ReactOS â³äêðèº ¿õ.", 12289, 36, 11, 182, 18
LTEXT "&³äêðèòè:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "³äì³íà", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Îãëÿä...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/*
special folders
*/
STRINGTABLE DISCARDABLE
{
IDS_DESKTOP "Ñò³ëüíèöÿ"
IDS_MYCOMPUTER "̳é Êîìï'þòåð"
}
/*
context menus
*/
STRINGTABLE DISCARDABLE
{
IDS_VIEW_LARGE "&Âåëèê³ ²êîíêè"
IDS_VIEW_SMALL "&Ìàë³ ²êîíêè"
IDS_VIEW_LIST "&Ñïèñîê"
IDS_VIEW_DETAILS "&Ïîäðîáèö³"
IDS_SELECT "Âè&áðàòè"
IDS_OPEN "³&äêðèòè"
}
STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Íå âäàëîñÿ ñòâîðèòè íîâó òåêó: ³äìîâà ó äîñòóï³."
IDS_CREATEFOLDER_CAPTION "Ïîìèëêà ïðè ñòâîðåíí³ íîâî¿ òåêè"
IDS_DELETEITEM_CAPTION "ϳäòâåðäæåííÿ âèëó÷åííÿ ôàéëó"
IDS_DELETEFOLDER_CAPTION "ϳäòâåðäæåííÿ âèëó÷åííÿ òåêè"
IDS_DELETEITEM_TEXT "Âè âïåâíåí³, ùî õî÷åòå âèëó÷èòè '%1'?"
IDS_DELETEMULTIPLE_TEXT "Âè âïåâíåí³, ùî õî÷åòå âèëó÷èòè ö³ %1 åëåìåíòè(³â)?"
IDS_OVERWRITEFILE_TEXT "Ïåðåïèñàòè Ôàéë %1?"
IDS_OVERWRITEFILE_CAPTION "ϳäòâåðäæåííÿ Ïåðåçàïèñó Ôàéëó"
}
/* columns in the shellview */
STRINGTABLE
BEGIN
IDS_SHV_COLUMN1 "Ôàéë"
IDS_SHV_COLUMN2 "Ðîçì³ð"
IDS_SHV_COLUMN3 "Òèï"
IDS_SHV_COLUMN4 "Çì³íåíî"
IDS_SHV_COLUMN5 "Àòðèáóòè"
IDS_SHV_COLUMN6 "Ðîçì³ð"
IDS_SHV_COLUMN7 "³ëüíèé Ðîçì³ð"
END

View File

@@ -0,0 +1,51 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_WALON, SUBLANG_DEFAULT
/*
* Si vos voloz aider avou li ratoûrnaedje des libes programes è walon,
* vos poloz scrîre a l' adresse emile <linux-wa@chanae.alphanet.ch>
*/
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Å dfait di %s"
FONT 10, "MS Shell Dlg"
{
DEFPUSHBUTTON "I Va", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 30, 10, 137, 10
LTEXT "", 101, 30, 22, 137, 10
LTEXT "ReactOS a estu fwait par:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
#pragma code_page(936) /* FIXME: default for CHINESE_TRADITIONAL is 950 */
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "關於 %s"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "確定", IDOK, 153, 133, 50, 12, WS_TABSTOP
LISTBOX 99, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", 1088, 10, 10, 14, 16
LTEXT "", 100, 35, 10, 137, 10
LTEXT "ReactOS was brought to you by:", 98, 8, 55, 137, 10
}
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Shell Dlg"
{
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
LTEXT "Type the name of a program, folder, document, or Internet resource, and ReactOS will open it for you.", 12289, 36, 11, 182, 18
LTEXT "&Open:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/* columns in the shellview */
STRINGTABLE LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
BEGIN
IDS_SHV_COLUMN1 "檔案"
IDS_SHV_COLUMN2 "大小"
IDS_SHV_COLUMN3 "類型"
IDS_SHV_COLUMN4 "已修改"
IDS_SHV_COLUMN5 "屬性"
IDS_SHV_COLUMN6 "使用空間"
IDS_SHV_COLUMN7 "剩餘空間"
IDS_SHV_COLUMN8 "Name" /*FIXME*/
IDS_SHV_COLUMN9 "Comments" /*FIXME*/
END
#pragma code_page(default)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,226 @@
/*
* internal Shell32 Library definitions
*
* Copyright 1998 Marcus Meissner
* Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_SHELL_MAIN_H
#define __WINE_SHELL_MAIN_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "objbase.h"
#include "docobj.h"
#include "undocshell.h"
#include "shlobj.h"
#include "shellapi.h"
#include "wine/windef16.h"
#include "wine/unicode.h"
/*******************************************
* global SHELL32.DLL variables
*/
extern HMODULE huser32;
extern HINSTANCE shell32_hInstance;
extern HIMAGELIST ShellSmallIconList;
extern HIMAGELIST ShellBigIconList;
BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
/* Iconcache */
#define INVALID_INDEX -1
BOOL SIC_Initialize(void);
void SIC_Destroy(void);
BOOL PidlToSicIndex (IShellFolder * sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int * pIndex);
INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex );
/* Classes Root */
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, DWORD len, BOOL bPrependDot);
BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len );
BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, LPDWORD dwNr);
BOOL HCR_GetDefaultIconFromGUIDW(REFIID riid, LPWSTR szDest, DWORD len, LPDWORD dwNr);
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len);
/* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL bPrependDot);
BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr);
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len);
BOOL HCR_GetFolderAttributes(REFIID riid, LPDWORD szDest);
INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len);
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len);
/****************************************************************************
* Class constructors
*/
LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST myPidl, LPCITEMIDLIST * apidl, UINT cidl);
LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []);
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount);
IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent);
LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER);
HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IShellLink_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv);
HRESULT WINAPI ISF_Desktop_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV);
HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex);
HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UINT cchMax, int* piIndex);
HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST);
LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST);
HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm);
/* FIXME: rename the functions when the shell32.dll has it's own exports namespace */
HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
HRESULT WINAPI SHELL32_DllCanUnloadNow(void);
/* menu merging */
#define MM_ADDSEPARATOR 0x00000001L
#define MM_SUBMENUSHAVEIDS 0x00000002L
HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
/* initialisation for FORMATETC */
#define InitFormatEtc(fe, cf, med) \
{\
(fe).cfFormat=cf;\
(fe).dwAspect=DVASPECT_CONTENT;\
(fe).ptd=NULL;\
(fe).tymed=med;\
(fe).lindex=-1;\
};
#define KeyStateToDropEffect(kst)\
(((kst) & MK_CONTROL) ?\
(((kst) & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY):\
DROPEFFECT_MOVE)
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags);
/* Change Notification */
void InitChangeNotifications(void);
void FreeChangeNotifications(void);
/* file operation */
#define ASK_DELETE_FILE 1
#define ASK_DELETE_FOLDER 2
#define ASK_DELETE_MULTIPLE_ITEM 3
#define ASK_CREATE_FOLDER 4
#define ASK_OVERWRITE_FILE 5
BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI);
BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI);
BOOL SHELL_ConfirmDialog(int nKindOfDialog, LPCSTR szDir);
/* 16-bit functions */
void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b);
UINT16 WINAPI DragQueryFile16(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, WORD wLength);
void WINAPI DragFinish16(HDROP16 h);
BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p);
HINSTANCE16 WINAPI ShellExecute16(HWND16,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT16);
HICON16 WINAPI ExtractIcon16(HINSTANCE16,LPCSTR,UINT16);
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16,LPSTR,LPWORD);
HICON16 WINAPI ExtractIconEx16 ( LPCSTR, INT16, HICON16 *, HICON16 *, UINT16 );
HINSTANCE16 WINAPI FindExecutable16(LPCSTR,LPCSTR,LPSTR);
HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16,LPCSTR,UINT16,WORD);
BOOL16 WINAPI ShellAbout16(HWND16,LPCSTR,LPCSTR,HICON16);
BOOL16 WINAPI AboutDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
inline static BOOL SHELL_OsIsUnicode(void)
{
/* if high-bit of version is 0, we are emulating NT */
return !(GetVersion() & 0x80000000);
}
#define __SHFreeAndNil(ptr) \
{\
SHFree(*ptr); \
*ptr = NULL; \
};
inline static void __SHCloneStrA(char ** target,const char * source)
{
*target = SHAlloc(strlen(source)+1);
strcpy(*target, source);
}
inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source)
{
int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
*target = SHAlloc(len);
WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL);
}
inline static void __SHCloneStrW(WCHAR ** target, const WCHAR * source)
{
*target = SHAlloc( (strlenW(source)+1) * sizeof(WCHAR) );
strcpyW(*target, source);
}
inline static WCHAR * __SHCloneStrAtoW(WCHAR ** target, const char * source)
{
int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
*target = SHAlloc(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, source, -1, *target, len);
return *target;
}
/* handle conversions */
#define HICON_16(h32) (LOWORD(h32))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
#define HINSTANCE_16(h32) (LOWORD(h32))
typedef UINT (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
LPSHELLEXECUTEINFOW sei, LPSHELLEXECUTEINFOW sei_out);
BOOL WINAPI ShellExecuteExW32(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args);
extern WCHAR swShell32Name[MAX_PATH];
/* Default shell folder value registration */
HRESULT SHELL_RegisterShellFolders(void);
#endif

View File

@@ -0,0 +1,20 @@
/* Language neutral resources.
* Icons and bitmaps should go in here.
*
* Copyright 1998 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL

View File

@@ -0,0 +1,68 @@
/*
* defines helperfunctions to manipulate the contents of a IShellFolder
*
* Copyright 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_SHELLFOLDER_HELP_H
#define __WINE_SHELLFOLDER_HELP_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "shlobj.h"
/*****************************************************************************
* Predeclare the interfaces
*/
DEFINE_GUID(IID_ISFHelper, 0x1fe68efbL, 0x1874, 0x9812, 0x56, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
/*****************************************************************************
* ISFHelper interface
*/
#define INTERFACE ISFHelper
DECLARE_INTERFACE_(ISFHelper,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** ISFHelper methods ***/
STDMETHOD(GetUniqueName)(THIS_ LPSTR lpName, UINT uLen) PURE;
STDMETHOD(AddFolder)(THIS_ HWND hwnd, LPCSTR lpName, LPITEMIDLIST * ppidlOut) PURE;
STDMETHOD(DeleteItems)(THIS_ UINT cidl, LPCITEMIDLIST * apidl) PURE;
STDMETHOD(CopyItems)(THIS_ IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl) PURE;
};
#undef INTERFACE
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define ISFHelper_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ISFHelper_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ISFHelper_Release(p) (p)->lpVtbl->Release(p)
/*** ISFHelper methods ***/
#define ISFHelper_GetUniqueName(p,a,b) (p)->lpVtbl->GetUniqueName(p,a,b)
#define ISFHelper_AddFolder(p,a,b,c) (p)->lpVtbl->AddFolder(p,a,b,c)
#define ISFHelper_DeleteItems(p,a,b) (p)->lpVtbl->DeleteItems(p,a,b)
#define ISFHelper_CopyItems(p,a,b,c) (p)->lpVtbl->CopyItems(p,a,b,c)
#endif
#endif /* __WINE_SHELLFOLDER_HELP_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,802 @@
/*
* handling of SHELL32.DLL OLE-Objects
*
* Copyright 1997 Marcus Meissner
* Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "shellapi.h"
#include "wingdi.h"
#include "winuser.h"
#include "shlobj.h"
#include "shlguid.h"
#include "winreg.h"
#include "winerror.h"
#include "undocshell.h"
#include "wine/unicode.h"
#include "shell32_main.h"
#include "wine/debug.h"
#include "shlwapi.h"
#include "debughlp.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
extern HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
const WCHAR sShell32[12] = {'S','H','E','L','L','3','2','.','D','L','L','\0'};
const WCHAR sOLE32[10] = {'O','L','E','3','2','.','D','L','L','\0'};
HINSTANCE hShellOle32 = 0;
/**************************************************************************
* Default ClassFactory types
*/
typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst);
/* this table contains all CLSID's of shell32 objects */
struct {
REFIID riid;
LPFNCREATEINSTANCE lpfnCI;
} InterfaceTable[] = {
{&CLSID_ShellFSFolder, &IFSFolder_Constructor},
{&CLSID_MyComputer, &ISF_MyComputer_Constructor},
{&CLSID_ShellDesktop, &ISF_Desktop_Constructor},
{&CLSID_ShellLink, &IShellLink_Constructor},
{&CLSID_DragDropHelper, &IDropTargetHelper_Constructor},
{&CLSID_ControlPanel, &IControlPanel_Constructor},
{&CLSID_AutoComplete, &IAutoComplete_Constructor},
{NULL,NULL}
};
/*************************************************************************
* SHCoCreateInstance [SHELL32.102]
*
* NOTES
* exported by ordinal
*/
/* FIXME: this should be SHLWAPI.24 since we can't yet import by ordinal */
DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
{
WCHAR sFormat[52] = {'{','%','0','8','l','x','-','%','0','4',
'x','-','%','0','4','x','-','%','0','2',
'x','%','0','2','x','-','%','0','2','x',
'%','0','2','x','%','0','2','x','%','0',
'2','x','%','0','2','x','%','0','2','x',
'}','\0'};
return wsprintfW ( str, sFormat,
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
}
/************************************************************************/
HRESULT WINAPI SHCoCreateInstance(
LPCWSTR aclsid,
const CLSID *clsid,
LPUNKNOWN pUnkOuter,
REFIID refiid,
LPVOID *ppv)
{
DWORD hres;
IID iid;
CLSID * myclsid = (CLSID*)clsid;
WCHAR sKeyName[MAX_PATH];
const WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'};
WCHAR sClassID[60];
const WCHAR sInProcServer32[16] ={'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
const WCHAR sLoadWithoutCOM[15] ={'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
WCHAR sDllPath[MAX_PATH];
HKEY hKey;
DWORD dwSize;
BOOLEAN bLoadFromShell32 = FALSE;
BOOLEAN bLoadWithoutCOM = FALSE;
IClassFactory * pcf = NULL;
if(!ppv) return E_POINTER;
*ppv=NULL;
/* if the clsid is a string, convert it */
if (!clsid)
{
if (!aclsid) return REGDB_E_CLASSNOTREG;
SHCLSIDFromStringW(aclsid, &iid);
myclsid = &iid;
}
TRACE("(%p,%s,unk:%p,%s,%p)\n",
aclsid,shdebugstr_guid(myclsid),pUnkOuter,shdebugstr_guid(refiid),ppv);
/* we look up the dll path in the registry */
__SHGUIDToStringW(myclsid, sClassID);
lstrcpyW(sKeyName, sCLSID);
lstrcatW(sKeyName, sClassID);
lstrcatW(sKeyName, sInProcServer32);
if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) {
dwSize = sizeof(sDllPath);
SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
/* if a special registry key is set, we load a shell extension without help of OLE32 */
bLoadWithoutCOM = (ERROR_SUCCESS == SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0));
/* if the com object is inside shell32, omit use of ole32 */
bLoadFromShell32 = (0==lstrcmpiW( PathFindFileNameW(sDllPath), sShell32));
RegCloseKey (hKey);
} else {
/* since we can't find it in the registry we try internally */
bLoadFromShell32 = TRUE;
}
TRACE("WithoutCom=%u FromShell=%u\n", bLoadWithoutCOM, bLoadFromShell32);
/* now we create a instance */
if (bLoadFromShell32) {
if (! SUCCEEDED(SHELL32_DllGetClassObject(myclsid, &IID_IClassFactory,(LPVOID*)&pcf))) {
ERR("LoadFromShell failed for CLSID=%s\n", shdebugstr_guid(myclsid));
}
} else if (bLoadWithoutCOM) {
/* load a external dll without ole32 */
HANDLE hLibrary;
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
DllGetClassObjectFunc DllGetClassObject;
if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
hres = E_ACCESSDENIED;
goto end;
} else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
FreeLibrary( hLibrary );
hres = E_ACCESSDENIED;
goto end;
} else if (! SUCCEEDED(hres = DllGetClassObject(myclsid, &IID_IClassFactory, (LPVOID*)&pcf))) {
TRACE("GetClassObject failed 0x%08lx\n", hres);
goto end;
}
} else {
/* load a external dll in the usual way */
hres = CoCreateInstance(myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
goto end;
}
/* here we should have a ClassFactory */
if (!pcf) return E_ACCESSDENIED;
hres = IClassFactory_CreateInstance(pcf, pUnkOuter, refiid, ppv);
IClassFactory_Release(pcf);
end:
if(hres!=S_OK)
{
ERR("failed (0x%08lx) to create CLSID:%s IID:%s\n",
hres, shdebugstr_guid(myclsid), shdebugstr_guid(refiid));
ERR("class not found in registry\n");
}
TRACE("-- instance: %p\n",*ppv);
return hres;
}
/*************************************************************************
* DllGetClassObject [SHELL32.128]
*/
HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{
HRESULT hres = E_OUTOFMEMORY;
IClassFactory * pcf = NULL;
int i;
TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid));
if (!ppv) return E_INVALIDARG;
*ppv = NULL;
/* search our internal interface table */
for(i=0;InterfaceTable[i].riid;i++) {
if(IsEqualIID(InterfaceTable[i].riid, rclsid)) {
TRACE("index[%u]\n", i);
pcf = IDefClF_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL);
}
}
if (!pcf) {
FIXME("failed for CLSID=%s\n", shdebugstr_guid(rclsid));
return CLASS_E_CLASSNOTAVAILABLE;
}
hres = IClassFactory_QueryInterface(pcf, iid, ppv);
IClassFactory_Release(pcf);
TRACE("-- pointer to class factory: %p\n",*ppv);
return hres;
}
/*************************************************************************
* SHCLSIDFromString [SHELL32.147]
*
* NOTES
* exported by ordinal
*/
DWORD WINAPI SHCLSIDFromStringA (LPCSTR clsid, CLSID *id)
{
WCHAR buffer[40];
TRACE("(%p(%s) %p)\n", clsid, clsid, id);
if (!MultiByteToWideChar( CP_ACP, 0, clsid, -1, buffer, sizeof(buffer)/sizeof(WCHAR) ))
return CO_E_CLASSSTRING;
return CLSIDFromString( buffer, id );
}
DWORD WINAPI SHCLSIDFromStringW (LPCWSTR clsid, CLSID *id)
{
TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
return CLSIDFromString((LPWSTR)clsid, id);
}
DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id)
{
if (SHELL_OsIsUnicode())
return SHCLSIDFromStringW (clsid, id);
return SHCLSIDFromStringA (clsid, id);
}
/*************************************************************************
* Shell Memory Allocator
*/
/* set the vtable later */
static IMallocVtbl VT_Shell_IMalloc32;
/* this is the static object instance */
typedef struct {
IMallocVtbl *lpVtbl;
DWORD dummy;
} _ShellMalloc;
static _ShellMalloc Shell_Malloc = { &VT_Shell_IMalloc32,1};
/* this is the global allocator of shell32 */
static IMalloc * ShellTaskAllocator = NULL;
/******************************************************************************
* IShellMalloc_QueryInterface [VTABLE]
*/
static HRESULT WINAPI IShellMalloc_fnQueryInterface(LPMALLOC iface, REFIID refiid, LPVOID *obj)
{
TRACE("(%s,%p)\n",shdebugstr_guid(refiid),obj);
if (IsEqualIID(refiid, &IID_IUnknown) || IsEqualIID(refiid, &IID_IMalloc)) {
*obj = (LPMALLOC) &Shell_Malloc;
return S_OK;
}
return E_NOINTERFACE;
}
/******************************************************************************
* IShellMalloc_AddRefRelease [VTABLE]
*/
static ULONG WINAPI IShellMalloc_fnAddRefRelease(LPMALLOC iface)
{
return 1;
}
/******************************************************************************
* IShellMalloc_Alloc [VTABLE]
*/
static LPVOID WINAPI IShellMalloc_fnAlloc(LPMALLOC iface, DWORD cb)
{
LPVOID addr;
addr = (LPVOID) LocalAlloc(GMEM_ZEROINIT, cb);
TRACE("(%p,%ld);\n",addr,cb);
return addr;
}
/******************************************************************************
* IShellMalloc_Realloc [VTABLE]
*/
static LPVOID WINAPI IShellMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, DWORD cb)
{
LPVOID addr;
if (pv) {
if (cb) {
addr = (LPVOID) LocalReAlloc((HANDLE) pv, cb, GMEM_ZEROINIT | GMEM_MOVEABLE);
} else {
LocalFree((HANDLE) pv);
addr = NULL;
}
} else {
if (cb) {
addr = (LPVOID) LocalAlloc(GMEM_ZEROINIT, cb);
} else {
addr = NULL;
}
}
TRACE("(%p->%p,%ld)\n",pv,addr,cb);
return addr;
}
/******************************************************************************
* IShellMalloc_Free [VTABLE]
*/
static VOID WINAPI IShellMalloc_fnFree(LPMALLOC iface, LPVOID pv)
{
TRACE("(%p)\n",pv);
LocalFree((HANDLE) pv);
}
/******************************************************************************
* IShellMalloc_GetSize [VTABLE]
*/
static DWORD WINAPI IShellMalloc_fnGetSize(LPMALLOC iface, LPVOID pv)
{
DWORD cb = (DWORD) LocalSize((HANDLE)pv);
TRACE("(%p,%ld)\n", pv, cb);
return cb;
}
/******************************************************************************
* IShellMalloc_DidAlloc [VTABLE]
*/
static INT WINAPI IShellMalloc_fnDidAlloc(LPMALLOC iface, LPVOID pv)
{
TRACE("(%p)\n",pv);
return -1;
}
/******************************************************************************
* IShellMalloc_HeapMinimize [VTABLE]
*/
static VOID WINAPI IShellMalloc_fnHeapMinimize(LPMALLOC iface)
{
TRACE("()\n");
}
static IMallocVtbl VT_Shell_IMalloc32 =
{
IShellMalloc_fnQueryInterface,
IShellMalloc_fnAddRefRelease,
IShellMalloc_fnAddRefRelease,
IShellMalloc_fnAlloc,
IShellMalloc_fnRealloc,
IShellMalloc_fnFree,
IShellMalloc_fnGetSize,
IShellMalloc_fnDidAlloc,
IShellMalloc_fnHeapMinimize
};
/*************************************************************************
* SHGetMalloc [SHELL32.@]
*
* Return the shell IMalloc interface.
*
* PARAMS
* lpmal [O] Destination for IMalloc interface.
*
* RETURNS
* Success: S_OK. lpmal contains the shells IMalloc interface.
* Failure. An HRESULT error code.
*
* NOTES
* This function will use CoGetMalloc() if OLE32.DLL is already loaded.
* If not it uses an internal implementation as a fallback.
*/
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
{
TRACE("(%p)\n", lpmal);
if (!ShellTaskAllocator)
{
HMODULE hOle32 = GetModuleHandleA("OLE32.DLL");
/* this is very suspect. we should not being using a different
* allocator from deallocator based on something undeterministic
* like whether ole32 is loaded. as it happens currently, they
* both map to the same allocator deep down, but this could
* change in the future. */
if(hOle32) {
CoGetMalloc(MEMCTX_TASK, &ShellTaskAllocator);
TRACE("got ole32 IMalloc\n");
}
if(!ShellTaskAllocator) {
ShellTaskAllocator = (IMalloc* ) &Shell_Malloc;
TRACE("use fallback allocator\n");
}
}
*lpmal = ShellTaskAllocator;
return S_OK;
}
/*************************************************************************
* SHAlloc [SHELL32.196]
*
* NOTES
* exported by ordinal
*/
LPVOID WINAPI SHAlloc(DWORD len)
{
IMalloc * ppv;
LPBYTE ret;
if (!ShellTaskAllocator) SHGetMalloc(&ppv);
ret = (LPVOID) IMalloc_Alloc(ShellTaskAllocator, len);
TRACE("%lu bytes at %p\n",len, ret);
return (LPVOID)ret;
}
/*************************************************************************
* SHFree [SHELL32.195]
*
* NOTES
* exported by ordinal
*/
void WINAPI SHFree(LPVOID pv)
{
IMalloc * ppv;
TRACE("%p\n",pv);
if (!ShellTaskAllocator) SHGetMalloc(&ppv);
IMalloc_Free(ShellTaskAllocator, pv);
}
/*************************************************************************
* SHGetDesktopFolder [SHELL32.@]
*/
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
{
HRESULT hres = S_OK;
TRACE("\n");
if(!psf) return E_INVALIDARG;
*psf = NULL;
hres = ISF_Desktop_Constructor(NULL, &IID_IShellFolder,(LPVOID*)psf);
TRACE("-- %p->(%p)\n",psf, *psf);
return hres;
}
/**************************************************************************
* Default ClassFactory Implementation
*
* SHCreateDefClassObject
*
* NOTES
* helper function for dll's without a own classfactory
* a generic classfactory is returned
* when the CreateInstance of the cf is called the callback is executed
*/
typedef struct
{
IClassFactoryVtbl *lpVtbl;
DWORD ref;
CLSID *rclsid;
LPFNCREATEINSTANCE lpfnCI;
const IID * riidInst;
ULONG * pcRefDll; /* pointer to refcounter in external dll (ugrrr...) */
} IDefClFImpl;
static IClassFactoryVtbl dclfvt;
/**************************************************************************
* IDefClF_fnConstructor
*/
IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
{
IDefClFImpl* lpclf;
lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
lpclf->ref = 1;
lpclf->lpVtbl = &dclfvt;
lpclf->lpfnCI = lpfnCI;
lpclf->pcRefDll = pcRefDll;
if (pcRefDll) InterlockedIncrement(pcRefDll);
lpclf->riidInst = riidInst;
TRACE("(%p)%s\n",lpclf, shdebugstr_guid(riidInst));
return (LPCLASSFACTORY)lpclf;
}
/**************************************************************************
* IDefClF_fnQueryInterface
*/
static HRESULT WINAPI IDefClF_fnQueryInterface(
LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
{
IDefClFImpl *This = (IDefClFImpl *)iface;
TRACE("(%p)->(%s)\n",This,shdebugstr_guid(riid));
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) {
*ppvObj = This;
InterlockedIncrement(&This->ref);
return S_OK;
}
TRACE("-- E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/******************************************************************************
* IDefClF_fnAddRef
*/
static ULONG WINAPI IDefClF_fnAddRef(LPCLASSFACTORY iface)
{
IDefClFImpl *This = (IDefClFImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This,This->ref);
return InterlockedIncrement(&This->ref);
}
/******************************************************************************
* IDefClF_fnRelease
*/
static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface)
{
IDefClFImpl *This = (IDefClFImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This,This->ref);
if (!InterlockedDecrement(&This->ref))
{
if (This->pcRefDll) InterlockedDecrement(This->pcRefDll);
TRACE("-- destroying IClassFactory(%p)\n",This);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
/******************************************************************************
* IDefClF_fnCreateInstance
*/
static HRESULT WINAPI IDefClF_fnCreateInstance(
LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
{
IDefClFImpl *This = (IDefClFImpl *)iface;
TRACE("%p->(%p,%s,%p)\n",This,pUnkOuter,shdebugstr_guid(riid),ppvObject);
*ppvObject = NULL;
if ( This->riidInst==NULL ||
IsEqualCLSID(riid, This->riidInst) ||
IsEqualCLSID(riid, &IID_IUnknown) )
{
return This->lpfnCI(pUnkOuter, riid, ppvObject);
}
ERR("unknown IID requested %s\n",shdebugstr_guid(riid));
return E_NOINTERFACE;
}
/******************************************************************************
* IDefClF_fnLockServer
*/
static HRESULT WINAPI IDefClF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
{
IDefClFImpl *This = (IDefClFImpl *)iface;
TRACE("%p->(0x%x), not implemented\n",This, fLock);
return E_NOTIMPL;
}
static IClassFactoryVtbl dclfvt =
{
IDefClF_fnQueryInterface,
IDefClF_fnAddRef,
IDefClF_fnRelease,
IDefClF_fnCreateInstance,
IDefClF_fnLockServer
};
/******************************************************************************
* SHCreateDefClassObject [SHELL32.70]
*/
HRESULT WINAPI SHCreateDefClassObject(
REFIID riid,
LPVOID* ppv,
LPFNCREATEINSTANCE lpfnCI, /* [in] create instance callback entry */
LPDWORD pcRefDll, /* [in/out] ref count of the dll */
REFIID riidInst) /* [in] optional interface to the instance */
{
IClassFactory * pcf;
TRACE("%s %p %p %p %s\n",
shdebugstr_guid(riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(riidInst));
if (! IsEqualCLSID(riid, &IID_IClassFactory) ) return E_NOINTERFACE;
if (! (pcf = IDefClF_fnConstructor(lpfnCI, pcRefDll, riidInst))) return E_OUTOFMEMORY;
*ppv = pcf;
return NOERROR;
}
/*************************************************************************
* DragAcceptFiles [SHELL32.54]
*/
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
{
LONG exstyle;
if( !IsWindow(hWnd) ) return;
exstyle = GetWindowLongA(hWnd,GWL_EXSTYLE);
if (b)
exstyle |= WS_EX_ACCEPTFILES;
else
exstyle &= ~WS_EX_ACCEPTFILES;
SetWindowLongA(hWnd,GWL_EXSTYLE,exstyle);
}
/*************************************************************************
* DragFinish [SHELL32.80]
*/
void WINAPI DragFinish(HDROP h)
{
TRACE("\n");
GlobalFree((HGLOBAL)h);
}
/*************************************************************************
* DragQueryPoint [SHELL32.135]
*/
BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
{
DROPFILES *lpDropFileStruct;
BOOL bRet;
TRACE("\n");
lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
*p = lpDropFileStruct->pt;
bRet = lpDropFileStruct->fNC;
GlobalUnlock(hDrop);
return bRet;
}
/*************************************************************************
* DragQueryFile [SHELL32.81]
* DragQueryFileA [SHELL32.82]
*/
UINT WINAPI DragQueryFileA(
HDROP hDrop,
UINT lFile,
LPSTR lpszFile,
UINT lLength)
{
LPSTR lpDrop;
UINT i = 0;
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
if(!lpDropFileStruct) goto end;
lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
if(lpDropFileStruct->fWide == TRUE) {
LPWSTR lpszFileW = NULL;
if(lpszFile) {
lpszFileW = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
if(lpszFileW == NULL) {
goto end;
}
}
i = DragQueryFileW(hDrop, lFile, lpszFileW, lLength);
if(lpszFileW) {
WideCharToMultiByte(CP_ACP, 0, lpszFileW, -1, lpszFile, lLength, 0, NULL);
HeapFree(GetProcessHeap(), 0, lpszFileW);
}
goto end;
}
while (i++ < lFile)
{
while (*lpDrop++); /* skip filename */
if (!*lpDrop)
{
i = (lFile == 0xFFFFFFFF) ? i : 0;
goto end;
}
}
i = strlen(lpDrop);
i++;
if (!lpszFile ) goto end; /* needed buffer size */
i = (lLength > i) ? i : lLength;
lstrcpynA (lpszFile, lpDrop, i);
end:
GlobalUnlock(hDrop);
return i;
}
/*************************************************************************
* DragQueryFileW [SHELL32.133]
*/
UINT WINAPI DragQueryFileW(
HDROP hDrop,
UINT lFile,
LPWSTR lpszwFile,
UINT lLength)
{
LPWSTR lpwDrop;
UINT i = 0;
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
if(!lpDropFileStruct) goto end;
lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
if(lpDropFileStruct->fWide == FALSE) {
LPSTR lpszFileA = NULL;
if(lpszwFile) {
lpszFileA = (LPSTR) HeapAlloc(GetProcessHeap(), 0, lLength);
if(lpszFileA == NULL) {
goto end;
}
}
i = DragQueryFileA(hDrop, lFile, lpszFileA, lLength);
if(lpszFileA) {
MultiByteToWideChar(CP_ACP, 0, lpszFileA, -1, lpszwFile, lLength);
HeapFree(GetProcessHeap(), 0, lpszFileA);
}
goto end;
}
i = 0;
while (i++ < lFile)
{
while (*lpwDrop++); /* skip filename */
if (!*lpwDrop)
{
i = (lFile == 0xFFFFFFFF) ? i : 0;
goto end;
}
}
i = strlenW(lpwDrop);
i++;
if ( !lpszwFile) goto end; /* needed buffer size */
i = (lLength > i) ? i : lLength;
lstrcpynW (lpszwFile, lpwDrop, i);
end:
GlobalUnlock(hDrop);
return i;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
/*
* Shell Registry Access
*
* Copyright 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "shellapi.h"
#include "wingdi.h"
#include "winuser.h"
#include "shlobj.h"
#include "winerror.h"
#include "winreg.h"
#include "winnls.h"
#include "undocshell.h"
#include "wine/winbase16.h"
#include "shell32_main.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/*************************************************************************
* SHRegOpenKeyA [SHELL32.506]
*
*/
HRESULT WINAPI SHRegOpenKeyA(
HKEY hKey,
LPSTR lpSubKey,
PHKEY phkResult)
{
TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
return RegOpenKeyA(hKey, lpSubKey, phkResult);
}
/*************************************************************************
* SHRegOpenKeyW [SHELL32.507] NT 4.0
*
*/
HRESULT WINAPI SHRegOpenKeyW (
HKEY hkey,
LPCWSTR lpszSubKey,
PHKEY retkey)
{
WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
return RegOpenKeyW( hkey, lpszSubKey, retkey );
}
/*************************************************************************
* SHRegQueryValueExA [SHELL32.509]
*
*/
HRESULT WINAPI SHRegQueryValueExA(
HKEY hkey,
LPSTR lpValueName,
LPDWORD lpReserved,
LPDWORD lpType,
LPBYTE lpData,
LPDWORD lpcbData)
{
TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
}
/*************************************************************************
* SHRegQueryValueW [SHELL32.510] NT4.0
*
*/
HRESULT WINAPI SHRegQueryValueW(
HKEY hkey,
LPWSTR lpszSubKey,
LPWSTR lpszData,
LPDWORD lpcbData )
{
WARN("%p %s %p %p semi-stub\n",
hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
}
/*************************************************************************
* SHRegQueryValueExW [SHELL32.511] NT4.0
*
* FIXME
* if the datatype REG_EXPAND_SZ then expand the string and change
* *pdwType to REG_SZ.
*/
HRESULT WINAPI SHRegQueryValueExW (
HKEY hkey,
LPWSTR pszValue,
LPDWORD pdwReserved,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData)
{
DWORD ret;
WARN("%p %s %p %p %p %p semi-stub\n",
hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
return ret;
}
/*************************************************************************
* SHRegDeleteKeyA [SHELL32.?]
*/
HRESULT WINAPI SHRegDeleteKeyA(
HKEY hkey,
LPCSTR pszSubKey)
{
FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey));
return 0;
}
/*************************************************************************
* SHRegDeleteKeyW [SHELL32.512]
*/
HRESULT WINAPI SHRegDeleteKeyW(
HKEY hkey,
LPCWSTR pszSubKey)
{
FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
return 0;
}
/*************************************************************************
* SHRegCloseKey [SHELL32.505] NT 4.0
*
*/
HRESULT WINAPI SHRegCloseKey (HKEY hkey)
{
TRACE("%p\n",hkey);
return RegCloseKey( hkey );
}

View File

@@ -0,0 +1,286 @@
/*
* Copyright 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winerror.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "shlobj.h"
#include "shellapi.h"
#include "shlwapi.h"
#include "shell32_main.h"
#include "undocshell.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/************************* STRRET functions ****************************/
BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
{
TRACE("dest=%p len=0x%lx strret=%p(%s) pidl=%p\n",
dest,len,src,
(src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
(src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
(src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
pidl);
if (!dest)
return FALSE;
switch (src->uType)
{
case STRRET_WSTR:
WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, dest, len, NULL, NULL);
CoTaskMemFree(src->u.pOleStr);
break;
case STRRET_CSTR:
lstrcpynA(dest, src->u.cStr, len);
break;
case STRRET_OFFSET:
lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
break;
default:
FIXME("unknown type!\n");
if (len) *dest = '\0';
return FALSE;
}
TRACE("-- %s\n", debugstr_a(dest) );
return TRUE;
}
/************************************************************************/
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
{
TRACE("dest=%p len=0x%lx strret=%p(%s) pidl=%p\n",
dest,len,src,
(src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
(src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
(src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
pidl);
if (!dest)
return FALSE;
switch (src->uType)
{
case STRRET_WSTR:
lstrcpynW(dest, src->u.pOleStr, len);
CoTaskMemFree(src->u.pOleStr);
break;
case STRRET_CSTR:
if (!MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ) && len)
dest[len-1] = 0;
break;
case STRRET_OFFSET:
if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset, -1, dest, len ) && len)
dest[len-1] = 0;
break;
default:
FIXME("unknown type!\n");
if (len) *dest = '\0';
return FALSE;
}
return TRUE;
}
/*************************************************************************
* StrRetToStrN [SHELL32.96]
*
* converts a STRRET to a normal string
*
* NOTES
* the pidl is for STRRET OFFSET
*/
BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
{
if(SHELL_OsIsUnicode())
return StrRetToStrNW(dest, len, src, pidl);
else
return StrRetToStrNA(dest, len, src, pidl);
}
/************************* OLESTR functions ****************************/
/************************************************************************
* StrToOleStr [SHELL32.163]
*
*/
int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
{
TRACE("(%p, %p %s)\n",
lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
}
int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
{
TRACE("(%p, %p %s)\n",
lpWideCharStr, lpWString, debugstr_w(lpWString));
strcpyW (lpWideCharStr, lpWString );
return strlenW(lpWideCharStr);
}
BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
{
if (SHELL_OsIsUnicode())
return StrToOleStrW (lpWideCharStr, lpString);
return StrToOleStrA (lpWideCharStr, lpString);
}
/*************************************************************************
* StrToOleStrN [SHELL32.79]
* lpMulti, nMulti, nWide [IN]
* lpWide [OUT]
*/
BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr)
{
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
}
BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
{
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
if (lstrcpynW (lpWide, lpStrW, nWide))
{ return lstrlenW (lpWide);
}
return 0;
}
BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
{
if (SHELL_OsIsUnicode())
return StrToOleStrNW (lpWide, nWide, lpStr, nStr);
return StrToOleStrNA (lpWide, nWide, lpStr, nStr);
}
/*************************************************************************
* OleStrToStrN [SHELL32.78]
*/
BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle)
{
TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
}
BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
{
TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
if (lstrcpynW ( lpwStr, lpOle, nwStr))
{ return lstrlenW (lpwStr);
}
return 0;
}
BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
{
if (SHELL_OsIsUnicode())
return OleStrToStrNW (lpOut, nOut, lpIn, nIn);
return OleStrToStrNA (lpOut, nOut, lpIn, nIn);
}
/*************************************************************************
* CheckEscapesA [SHELL32.@]
*
* Checks a string for special characters which are not allowed in a path
* and encloses it in quotes if that is the case.
*
* PARAMS
* string [I/O] string to check and on return eventually quoted
* len [I] length of string
*
* RETURNS
* length of actual string
*
* NOTES
* Not really sure if this function returns actually a value at all.
*/
DWORD WINAPI CheckEscapesA(
LPSTR string, /* [I/O] string to check ??*/
DWORD len) /* [I] is 0 */
{
LPWSTR wString;
DWORD ret = 0;
TRACE("(%s %ld)\n", debugstr_a(string), len);
wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
if (wString)
{
MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);
ret = CheckEscapesW(wString, len);
WideCharToMultiByte(CP_ACP, 0, wString, len, string, len, NULL, NULL);
LocalFree(wString);
}
return ret;
}
static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0};
/*************************************************************************
* CheckEscapesW [SHELL32.@]
*
* see CheckEscapesA
*/
DWORD WINAPI CheckEscapesW(
LPWSTR string,
DWORD len)
{
DWORD size = lstrlenW(string);
LPWSTR s, d;
TRACE("(%s %ld) stub\n", debugstr_w(string), len);
if (StrPBrkW(string, strEscapedChars) && size + 2 <= len)
{
s = &string[size - 1];
d = &string[size + 2];
*d-- = 0;
*d-- = '"';
for (;d > string;)
*d-- = *s--;
*d = '"';
return size + 2;
}
return size;
}

View File

@@ -0,0 +1,58 @@
/*
* Virtual Folder
* common definitions
*
* Copyright 1997 Marcus Meissner
* Copyright 1998, 1999, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define CHARS_IN_GUID 39
typedef struct {
int colnameid;
int pcsFlags;
int fmt;
int cxChar;
} shvheader;
#define GET_SHGDN_FOR(dwFlags) ((DWORD)dwFlags & (DWORD)0x0000FF00)
#define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
BOOL SHELL32_GetCustomFolderAttribute (LPCITEMIDLIST pidl, LPCWSTR pwszHeading, LPCWSTR pwszAttribute, LPWSTR pwszValue, DWORD cchValue);
LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut);
HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut,
LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes);
HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes);
HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTR szOut,
DWORD dwOutLen);
HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut);
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
{
return sprintf(str, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
}
void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags);

View File

@@ -0,0 +1,739 @@
/*
* Virtual Desktop Folder
*
* Copyright 1997 Marcus Meissner
* Copyright 1998, 1999, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "shlguid.h"
#include "enumidlist.h"
#include "pidl.h"
#include "undocshell.h"
#include "shell32_main.h"
#include "shresdef.h"
#include "shlwapi.h"
#include "shellfolder.h"
#include "wine/debug.h"
#include "debughlp.h"
#include "shfldr.h"
WINE_DEFAULT_DEBUG_CHANNEL (shell);
/***********************************************************************
* Desktopfolder implementation
*/
typedef struct {
IShellFolder2Vtbl *lpVtbl;
DWORD ref;
CLSID *pclsid;
/* both paths are parsible from the desktop */
LPSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
LPITEMIDLIST pidlRoot; /* absolute pidl */
int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
UINT cfShellIDList; /* clipboardformat for IDropTarget */
BOOL fAcceptFmt; /* flag for pending Drop */
} IGenericSFImpl;
#define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
static struct IShellFolder2Vtbl vt_MCFldr_ShellFolder2;
static shvheader DesktopSFHeader[] = {
{IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
{IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN4, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 12},
{IDS_SHV_COLUMN5, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 5}
};
#define DESKTOPSHELLVIEWCOLUMNS 5
/**************************************************************************
* ISF_Desktop_Constructor
*/
HRESULT WINAPI ISF_Desktop_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
IGenericSFImpl *sf;
char szMyPath[MAX_PATH];
TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
if (!ppv)
return E_POINTER;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
if (!SHGetSpecialFolderPathA (0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE))
return E_UNEXPECTED;
sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf)
return E_OUTOFMEMORY;
sf->ref = 0;
sf->lpVtbl = &vt_MCFldr_ShellFolder2;
sf->pidlRoot = _ILCreateDesktop (); /* my qualified pidl */
sf->sPathTarget = SHAlloc (strlen (szMyPath) + 1);
lstrcpyA (sf->sPathTarget, szMyPath);
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
IUnknown_Release (_IUnknown_ (sf));
return E_NOINTERFACE;
}
TRACE ("--(%p)\n", sf);
return S_OK;
}
/**************************************************************************
* ISF_Desktop_fnQueryInterface
*
* NOTES supports not IPersist/IPersistFolder
*/
static HRESULT WINAPI ISF_Desktop_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
*ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IShellFolder)
|| IsEqualIID (riid, &IID_IShellFolder2)) {
*ppvObj = This;
}
if (*ppvObj) {
IUnknown_AddRef ((IUnknown *) (*ppvObj));
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
TRACE ("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
static ULONG WINAPI ISF_Desktop_fnAddRef (IShellFolder2 * iface)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return ++(This->ref);
}
static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
if (!--(This->ref)) {
TRACE ("-- destroying IShellFolder(%p)\n", This);
if (This->pidlRoot)
SHFree (This->pidlRoot);
if (This->sPathTarget)
SHFree (This->sPathTarget);
LocalFree ((HLOCAL) This);
return 0;
}
return This->ref;
}
/**************************************************************************
* ISF_Desktop_fnParseDisplayName
*
* NOTES
* "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
* to MyComputer
*/
static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner,
LPBC pbc,
LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
WCHAR szElement[MAX_PATH];
LPCWSTR szNext = NULL;
LPITEMIDLIST pidlTemp = NULL;
HRESULT hr = S_OK;
char szPath[MAX_PATH];
DWORD len;
CLSID clsid;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
if (!lpszDisplayName || !ppidl)
return E_INVALIDARG;
*ppidl = 0;
if (pchEaten)
*pchEaten = 0; /* strange but like the original */
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement));
SHCLSIDFromStringW (szElement + 2, &clsid);
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
} else if (PathGetDriveNumberW (lpszDisplayName) >= 0) {
/* it's a filesystem path with a drive. Let MyComputer parse it */
pidlTemp = _ILCreateMyComputer ();
szNext = lpszDisplayName;
} else if (PathIsUNCW(lpszDisplayName)) {
pidlTemp = _ILCreateNetwork();
szNext = lpszDisplayName;
} else {
/* it's a filesystem path on the desktop. Let a FSFolder parse it */
if (*lpszDisplayName) {
/* build a complete path to create a simple pidl */
lstrcpyA(szPath, This->sPathTarget);
PathAddBackslashA(szPath);
len = lstrlenA(szPath);
WideCharToMultiByte(CP_ACP, 0, lpszDisplayName, -1, szPath + len, MAX_PATH - len, NULL, NULL);
hr = _ILCreateFromPathA(szPath, &pidlTemp);
} else {
pidlTemp = _ILCreateMyComputer();
}
szNext = NULL;
}
if (SUCCEEDED(hr) && pidlTemp) {
if (szNext && *szNext) {
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
} else {
if (pdwAttributes && *pdwAttributes) {
hr = SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
}
}
}
*ppidl = pidlTemp;
TRACE ("(%p)->(-- ret=0x%08lx)\n", This, hr);
return hr;
}
/**************************************************************************
* CreateDesktopEnumList()
*/
static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
{
BOOL ret = TRUE;
char szPath[MAX_PATH];
TRACE("(%p)->(flags=0x%08lx) \n",list,dwFlags);
/*enumerate the root folders */
if(dwFlags & SHCONTF_FOLDERS)
{
HKEY hkey;
/*create the pidl for This item */
ret = AddToEnumList(list, _ILCreateMyComputer());
if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\desktop\\NameSpace",
0, KEY_READ, &hkey))
{
char iid[50];
int i=0;
BOOL moreKeys = TRUE;
while (ret && moreKeys)
{
DWORD size = sizeof (iid);
LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
NULL);
if (ERROR_SUCCESS == apiRet)
{
ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
i++;
}
else if (ERROR_NO_MORE_ITEMS == apiRet)
moreKeys = FALSE;
else
ret = FALSE;
}
RegCloseKey(hkey);
}
}
/*enumerate the elements in %windir%\desktop */
SHGetSpecialFolderPathA(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ret = ret && CreateFolderEnumList(list, szPath, dwFlags);
return ret;
}
/**************************************************************************
* ISF_Desktop_fnEnumObjects
*/
static HRESULT WINAPI ISF_Desktop_fnEnumObjects (IShellFolder2 * iface,
HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
*ppEnumIDList = IEnumIDList_Constructor();
if (*ppEnumIDList)
CreateDesktopEnumList(*ppEnumIDList, dwFlags);
TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
return *ppEnumIDList ? S_OK : E_OUTOFMEMORY;
}
/**************************************************************************
* ISF_Desktop_fnBindToObject
*/
static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
}
/**************************************************************************
* ISF_Desktop_fnBindToStorage
*/
static HRESULT WINAPI ISF_Desktop_fnBindToStorage (IShellFolder2 * iface,
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
*ppvOut = NULL;
return E_NOTIMPL;
}
/**************************************************************************
* ISF_Desktop_fnCompareIDs
*/
static HRESULT WINAPI ISF_Desktop_fnCompareIDs (IShellFolder2 * iface,
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
int nReturn;
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2);
TRACE ("-- %i\n", nReturn);
return nReturn;
}
/**************************************************************************
* ISF_Desktop_fnCreateViewObject
*/
static HRESULT WINAPI ISF_Desktop_fnCreateViewObject (IShellFolder2 * iface,
HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPSHELLVIEW pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
if (ppvOut) {
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IDropTarget)) {
WARN ("IDropTarget not implemented\n");
hr = E_NOTIMPL;
} else if (IsEqualIID (riid, &IID_IContextMenu)) {
WARN ("IContextMenu not implemented\n");
hr = E_NOTIMPL;
} else if (IsEqualIID (riid, &IID_IShellView)) {
pShellView = IShellView_Constructor ((IShellFolder *) iface);
if (pShellView) {
hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
IShellView_Release (pShellView);
}
}
}
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnGetAttributesOf
*/
static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
if ((!cidl) || (!apidl) || (!rgfInOut))
return E_INVALIDARG;
if (*rgfInOut == 0)
*rgfInOut = ~0;
while (cidl > 0 && *apidl) {
pdump (*apidl);
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
apidl++;
cidl--;
}
TRACE ("-- result=0x%08lx\n", *rgfInOut);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnGetUIObjectOf
*
* PARAMETERS
* HWND hwndOwner, //[in ] Parent window for any output
* UINT cidl, //[in ] array size
* LPCITEMIDLIST* apidl, //[in ] simple pidl array
* REFIID riid, //[in ] Requested Interface
* UINT* prgfInOut, //[ ] reserved
* LPVOID* ppvObject) //[out] Resulting Interface
*
*/
static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
HWND hwndOwner,
UINT cidl,
LPCITEMIDLIST * apidl,
REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPITEMIDLIST pidl;
IUnknown *pObj = NULL;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
if (ppvOut) {
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IContextMenu)) {
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) {
hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
} else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
&& (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]);
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
SHFree (pidl);
} else {
hr = E_NOINTERFACE;
}
if (SUCCEEDED(hr) && !pObj)
hr = E_OUTOFMEMORY;
*ppvOut = pObj;
}
TRACE ("(%p)->hr=0x%08lx\n", This, hr);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnGetDisplayNameOf
*
* NOTES
* special case: pidl = null gives desktop-name back
*/
static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
CHAR szPath[MAX_PATH];
GUID const *clsid;
HRESULT hr = S_OK;
*szPath = '\0';
TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This, pidl, dwFlags, strRet);
pdump (pidl);
if (!strRet)
return E_INVALIDARG;
if (_ILIsDesktop (pidl)) {
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)) {
lstrcpyA (szPath, This->sPathTarget);
} else {
HCR_GetClassNameA(&CLSID_ShellDesktop, szPath, MAX_PATH);
}
} else if (_ILIsPidlSimple (pidl)) {
if ((clsid = _ILGetGUIDPointer (pidl))) {
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
int bWantsForParsing;
/*
* we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
* CLSID\\{...}\\shellfolder exists
* exception: the MyComputer folder has this keys not but like any filesystem backed
* folder it needs these behaviour
*/
if (IsEqualIID (clsid, &CLSID_MyComputer)) {
bWantsForParsing = 1;
} else {
/* get the "WantsFORPARSING" flag from the registry */
char szRegPath[100];
lstrcpyA (szRegPath, "CLSID\\");
SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
lstrcatA (szRegPath, "\\shellfolder");
bWantsForParsing =
(ERROR_SUCCESS ==
SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
}
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && bWantsForParsing) {
/* we need the filesystem path to the destination folder. Only the folder itself can know it */
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
} else {
/* parsing name like ::{...} */
lstrcpyA (szPath, "::");
SHELL32_GUIDToStringA (clsid, &szPath[2]);
}
} else {
/* user friendly name */
HCR_GetClassNameA (clsid, szPath, MAX_PATH);
}
} else {
/* file system folder */
_ILSimpleGetText (pidl, szPath, MAX_PATH);
if (!_ILIsFolder(pidl))
SHELL_FS_ProcessDisplayFilename(szPath, dwFlags);
}
} else {
/* a complex pidl, let the subfolder do the work */
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
}
if (SUCCEEDED (hr)) {
strRet->uType = STRRET_CSTR;
lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
}
TRACE ("-- (%p)->(%s,0x%08lx)\n", This, szPath, hr);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnSetNameOf
* Changes the name of a file object or subfolder, possibly changing its item
* identifier in the process.
*
* PARAMETERS
* HWND hwndOwner, //[in ] Owner window for output
* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
* LPCOLESTR lpszName, //[in ] the items new display name
* DWORD dwFlags, //[in ] SHGNO formatting flags
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
*/
static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
return E_FAIL;
}
static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_Desktop_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface,
DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (pSort)
*pSort = 0;
if (pDisplay)
*pDisplay = 0;
return S_OK;
}
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (!pcsFlags || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
return E_INVALIDARG;
*pcsFlags = DesktopSFHeader[iColumn].pcsFlags;
return S_OK;
}
static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface,
LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = E_FAIL;
TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
return E_INVALIDARG;
if (!pidl) {
psd->fmt = DesktopSFHeader[iColumn].fmt;
psd->cxChar = DesktopSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, DesktopSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
return S_OK;
} else {
/* the data from the pidl */
switch (iColumn) {
case 0: /* name */
hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break;
case 1: /* size */
_ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 2: /* type */
_ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 3: /* date */
_ILGetFileDate (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 4: /* attributes */
_ILGetFileAttributes (pidl, psd->str.u.cStr, MAX_PATH);
break;
}
hr = S_OK;
psd->str.uType = STRRET_CSTR;
}
return hr;
}
static HRESULT WINAPI ISF_Desktop_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static IShellFolder2Vtbl vt_MCFldr_ShellFolder2 =
{
ISF_Desktop_fnQueryInterface,
ISF_Desktop_fnAddRef,
ISF_Desktop_fnRelease,
ISF_Desktop_fnParseDisplayName,
ISF_Desktop_fnEnumObjects,
ISF_Desktop_fnBindToObject,
ISF_Desktop_fnBindToStorage,
ISF_Desktop_fnCompareIDs,
ISF_Desktop_fnCreateViewObject,
ISF_Desktop_fnGetAttributesOf,
ISF_Desktop_fnGetUIObjectOf,
ISF_Desktop_fnGetDisplayNameOf,
ISF_Desktop_fnSetNameOf,
/* ShellFolder2 */
ISF_Desktop_fnGetDefaultSearchGUID,
ISF_Desktop_fnEnumSearches,
ISF_Desktop_fnGetDefaultColumn,
ISF_Desktop_fnGetDefaultColumnState,
ISF_Desktop_fnGetDetailsEx,
ISF_Desktop_fnGetDetailsOf,
ISF_Desktop_fnMapColumnToSCID};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,833 @@
/*
* Virtual Workplace folder
*
* Copyright 1997 Marcus Meissner
* Copyright 1998, 1999, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "pidl.h"
#include "shlguid.h"
#include "enumidlist.h"
#include "undocshell.h"
#include "shell32_main.h"
#include "shresdef.h"
#include "shlwapi.h"
#include "shellfolder.h"
#include "wine/debug.h"
#include "debughlp.h"
#include "shfldr.h"
WINE_DEFAULT_DEBUG_CHANNEL (shell);
/***********************************************************************
* IShellFolder implementation
*/
typedef struct {
IShellFolder2Vtbl *lpVtbl;
DWORD ref;
IPersistFolder2Vtbl *lpVtblPersistFolder2;
/* both paths are parsible from the desktop */
LPITEMIDLIST pidlRoot; /* absolute pidl */
int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
} IGenericSFImpl;
static struct IShellFolder2Vtbl vt_ShellFolder2;
static struct IPersistFolder2Vtbl vt_PersistFolder2;
#define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2)))
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset);
/*
converts This to a interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl)
#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2)
#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2)
#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2)
/***********************************************************************
* IShellFolder [MyComputer] implementation
*/
static shvheader MyComputerSFHeader[] = {
{IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
{IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN6, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN7, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
};
#define MYCOMPUTERSHELLVIEWCOLUMNS 4
/**************************************************************************
* ISF_MyComputer_Constructor
*/
HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
IGenericSFImpl *sf;
TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
if (!ppv)
return E_POINTER;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf)
return E_OUTOFMEMORY;
sf->ref = 0;
sf->lpVtbl = &vt_ShellFolder2;
sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
sf->pidlRoot = _ILCreateMyComputer (); /* my qualified pidl */
if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
IUnknown_Release (_IUnknown_ (sf));
return E_NOINTERFACE;
}
TRACE ("--(%p)\n", sf);
return S_OK;
}
/**************************************************************************
* ISF_MyComputer_fnQueryInterface
*
* NOTES supports not IPersist/IPersistFolder
*/
static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
*ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IShellFolder) || IsEqualIID (riid, &IID_IShellFolder2)) {
*ppvObj = This;
} else if (IsEqualIID (riid, &IID_IPersist) ||
IsEqualIID (riid, &IID_IPersistFolder) || IsEqualIID (riid, &IID_IPersistFolder2)) {
*ppvObj = _IPersistFolder2_ (This);
}
if (*ppvObj) {
IUnknown_AddRef ((IUnknown *) (*ppvObj));
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
TRACE ("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
static ULONG WINAPI ISF_MyComputer_fnAddRef (IShellFolder2 * iface)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return ++(This->ref);
}
static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
if (!--(This->ref)) {
TRACE ("-- destroying IShellFolder(%p)\n", This);
if (This->pidlRoot)
SHFree (This->pidlRoot);
LocalFree ((HLOCAL) This);
return 0;
}
return This->ref;
}
/**************************************************************************
* ISF_MyComputer_fnParseDisplayName
*/
static HRESULT WINAPI
ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner,
LPBC pbc,
LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL;
WCHAR szElement[MAX_PATH];
LPITEMIDLIST pidlTemp = NULL;
CLSID clsid;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
*ppidl = 0;
if (pchEaten)
*pchEaten = 0; /* strange but like the original */
/* handle CLSID paths */
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement));
SHCLSIDFromStringW (szElement + 2, &clsid);
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
}
/* do we have an absolute path name ? */
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && lpszDisplayName[2] == (WCHAR) '\\') {
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
szElement[0] = toupper(szElement[0]); /* make drive letter uppercase to enable PIDL comparison */
pidlTemp = _ILCreateDrive (szElement);
}
if (szNext && *szNext) {
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
} else {
if (pdwAttributes && *pdwAttributes) {
SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
}
hr = S_OK;
}
*ppidl = pidlTemp;
TRACE ("(%p)->(-- ret=0x%08lx)\n", This, hr);
return hr;
}
/**************************************************************************
* CreateMyCompEnumList()
*/
static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
{
BOOL ret = TRUE;
TRACE("(%p)->(flags=0x%08lx) \n",list,dwFlags);
/*enumerate the folders*/
if(dwFlags & SHCONTF_FOLDERS)
{
WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
DWORD dwDrivemap = GetLogicalDrives();
HKEY hkey;
while (ret && wszDriveName[0]<='Z')
{
if(dwDrivemap & 0x00000001L)
ret = AddToEnumList(list, _ILCreateDrive(wszDriveName));
wszDriveName[0]++;
dwDrivemap = dwDrivemap >> 1;
}
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list);
if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\mycomputer\\NameSpace",
0, KEY_READ, &hkey))
{
char iid[50];
int i=0;
while (ret)
{
DWORD size = sizeof (iid);
LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
NULL);
if (ERROR_SUCCESS == apiRet)
{
/* FIXME: shell extensions, shouldn't the type be
* PT_SHELLEXT? */
ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
i++;
}
else if (ERROR_NO_MORE_ITEMS == apiRet)
break;
else
ret = FALSE;
}
RegCloseKey(hkey);
}
}
return ret;
}
/**************************************************************************
* ISF_MyComputer_fnEnumObjects
*/
static HRESULT WINAPI
ISF_MyComputer_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
*ppEnumIDList = IEnumIDList_Constructor();
if (*ppEnumIDList)
CreateMyCompEnumList(*ppEnumIDList, dwFlags);
TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
return (*ppEnumIDList) ? S_OK : E_OUTOFMEMORY;
}
/**************************************************************************
* ISF_MyComputer_fnBindToObject
*/
static HRESULT WINAPI
ISF_MyComputer_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
}
/**************************************************************************
* ISF_MyComputer_fnBindToStorage
*/
static HRESULT WINAPI
ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
*ppvOut = NULL;
return E_NOTIMPL;
}
/**************************************************************************
* ISF_MyComputer_fnCompareIDs
*/
static HRESULT WINAPI
ISF_MyComputer_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
int nReturn;
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2);
TRACE ("-- %i\n", nReturn);
return nReturn;
}
/**************************************************************************
* ISF_MyComputer_fnCreateViewObject
*/
static HRESULT WINAPI
ISF_MyComputer_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPSHELLVIEW pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
if (ppvOut) {
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IDropTarget)) {
WARN ("IDropTarget not implemented\n");
hr = E_NOTIMPL;
} else if (IsEqualIID (riid, &IID_IContextMenu)) {
WARN ("IContextMenu not implemented\n");
hr = E_NOTIMPL;
} else if (IsEqualIID (riid, &IID_IShellView)) {
pShellView = IShellView_Constructor ((IShellFolder *) iface);
if (pShellView) {
hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
IShellView_Release (pShellView);
}
}
}
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
return hr;
}
/**************************************************************************
* ISF_MyComputer_fnGetAttributesOf
*/
static HRESULT WINAPI
ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
if ((!cidl) || (!apidl) || (!rgfInOut))
return E_INVALIDARG;
if (*rgfInOut == 0)
*rgfInOut = ~0;
while (cidl > 0 && *apidl) {
pdump (*apidl);
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
apidl++;
cidl--;
}
TRACE ("-- result=0x%08lx\n", *rgfInOut);
return hr;
}
/**************************************************************************
* ISF_MyComputer_fnGetUIObjectOf
*
* PARAMETERS
* HWND hwndOwner, //[in ] Parent window for any output
* UINT cidl, //[in ] array size
* LPCITEMIDLIST* apidl, //[in ] simple pidl array
* REFIID riid, //[in ] Requested Interface
* UINT* prgfInOut, //[ ] reserved
* LPVOID* ppvObject) //[out] Resulting Interface
*
*/
static HRESULT WINAPI
ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
HWND hwndOwner,
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPITEMIDLIST pidl;
IUnknown *pObj = NULL;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
if (ppvOut) {
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
} else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) {
hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
} else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
&& (cidl == 1)) {
pidl = ILCombine (This->pidlRoot, apidl[0]);
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
SHFree (pidl);
} else {
hr = E_NOINTERFACE;
}
if (SUCCEEDED(hr) && !pObj)
hr = E_OUTOFMEMORY;
*ppvOut = pObj;
}
TRACE ("(%p)->hr=0x%08lx\n", This, hr);
return hr;
}
/**************************************************************************
* ISF_MyComputer_fnGetDisplayNameOf
*/
static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
char szPath[MAX_PATH],
szDrive[18];
int len = 0;
BOOL bSimplePidl;
HRESULT hr = S_OK;
TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This, pidl, dwFlags, strRet);
pdump (pidl);
if (!strRet)
return E_INVALIDARG;
szPath[0] = 0x00;
szDrive[0] = 0x00;
bSimplePidl = _ILIsPidlSimple (pidl);
if (!pidl->mkid.cb) {
/* parsing name like ::{...} */
lstrcpyA (szPath, "::");
SHELL32_GUIDToStringA(&CLSID_MyComputer, &szPath[2]);
} else if (_ILIsSpecialFolder (pidl)) {
/* take names of special folders only if its only this folder */
if (bSimplePidl) {
GUID const *clsid;
if ((clsid = _ILGetGUIDPointer (pidl))) {
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
int bWantsForParsing;
/*
* we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
* CLSID\\{...}\\shellfolder exists
* exception: the MyComputer folder has this keys not but like any filesystem backed
* folder it needs these behaviour
*/
/* get the "WantsFORPARSING" flag from the registry */
char szRegPath[100];
lstrcpyA (szRegPath, "CLSID\\");
SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
lstrcatA (szRegPath, "\\shellfolder");
bWantsForParsing =
(ERROR_SUCCESS ==
SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && bWantsForParsing) {
/* we need the filesystem path to the destination folder. Only the folder itself can know it */
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
} else {
LPSTR p;
/* parsing name like ::{...} */
p = lstrcpyA(szPath, "::") + 2;
p += SHELL32_GUIDToStringA(&CLSID_MyComputer, p);
lstrcatA(p, "\\::");
p += 3;
SHELL32_GUIDToStringA(clsid, p);
}
} else {
/* user friendly name */
HCR_GetClassNameA (clsid, szPath, MAX_PATH);
}
} else
_ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
} else {
FIXME ("special folder\n");
}
} else {
if (!_ILIsDrive (pidl)) {
ERR ("Wrong pidl type\n");
return E_INVALIDARG;
}
_ILSimpleGetText (pidl, szPath, MAX_PATH); /* append my own path */
/* long view "lw_name (C:)" */
if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING)) {
DWORD dwVolumeSerialNumber,
dwMaximumComponetLength,
dwFileSystemFlags;
GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6, &dwVolumeSerialNumber,
&dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0);
strcat (szDrive, " (");
strncat (szDrive, szPath, 2);
strcat (szDrive, ")");
strcpy (szPath, szDrive);
}
}
if (!bSimplePidl) { /* go deeper if needed */
PathAddBackslashA (szPath);
len = strlen (szPath);
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
}
if (SUCCEEDED (hr)) {
strRet->uType = STRRET_CSTR;
lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
}
TRACE ("-- (%p)->(%s)\n", This, szPath);
return hr;
}
/**************************************************************************
* ISF_MyComputer_fnSetNameOf
* Changes the name of a file object or subfolder, possibly changing its item
* identifier in the process.
*
* PARAMETERS
* HWND hwndOwner, //[in ] Owner window for output
* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
* LPCOLESTR lpszName, //[in ] the items new display name
* DWORD dwFlags, //[in ] SHGNO formatting flags
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
*/
static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
return E_FAIL;
}
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (pSort) *pSort = 0;
if (pDisplay) *pDisplay = 0;
return S_OK;
}
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) return E_INVALIDARG;
*pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
return S_OK;
}
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
/* FIXME: drive size >4GB is rolling over */
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr;
TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG;
if (!pidl) {
psd->fmt = MyComputerSFHeader[iColumn].fmt;
psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
return S_OK;
} else {
char szPath[MAX_PATH];
ULARGE_INTEGER ulBytes;
psd->str.u.cStr[0] = 0x00;
psd->str.uType = STRRET_CSTR;
switch (iColumn) {
case 0: /* name */
hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break;
case 1: /* type */
_ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 2: /* total size */
if (_ILIsDrive (pidl)) {
_ILSimpleGetText (pidl, szPath, MAX_PATH);
GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL);
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
}
break;
case 3: /* free size */
if (_ILIsDrive (pidl)) {
_ILSimpleGetText (pidl, szPath, MAX_PATH);
GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL);
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
}
break;
}
hr = S_OK;
}
return hr;
}
static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static IShellFolder2Vtbl vt_ShellFolder2 =
{
ISF_MyComputer_fnQueryInterface,
ISF_MyComputer_fnAddRef,
ISF_MyComputer_fnRelease,
ISF_MyComputer_fnParseDisplayName,
ISF_MyComputer_fnEnumObjects,
ISF_MyComputer_fnBindToObject,
ISF_MyComputer_fnBindToStorage,
ISF_MyComputer_fnCompareIDs,
ISF_MyComputer_fnCreateViewObject,
ISF_MyComputer_fnGetAttributesOf,
ISF_MyComputer_fnGetUIObjectOf,
ISF_MyComputer_fnGetDisplayNameOf,
ISF_MyComputer_fnSetNameOf,
/* ShellFolder2 */
ISF_MyComputer_fnGetDefaultSearchGUID,
ISF_MyComputer_fnEnumSearches,
ISF_MyComputer_fnGetDefaultColumn,
ISF_MyComputer_fnGetDefaultColumnState,
ISF_MyComputer_fnGetDetailsEx,
ISF_MyComputer_fnGetDetailsOf,
ISF_MyComputer_fnMapColumnToSCID
};
/************************************************************************
* IMCFldr_PersistFolder2_QueryInterface
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)\n", This);
return IUnknown_QueryInterface (_IUnknown_ (This), iid, ppvObj);
}
/************************************************************************
* IMCFldr_PersistFolder2_AddRef
*/
static ULONG WINAPI IMCFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return IUnknown_AddRef (_IUnknown_ (This));
}
/************************************************************************
* ISFPersistFolder_Release
*/
static ULONG WINAPI IMCFldr_PersistFolder2_Release (IPersistFolder2 * iface)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
return IUnknown_Release (_IUnknown_ (This));
}
/************************************************************************
* IMCFldr_PersistFolder2_GetClassID
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (IPersistFolder2 * iface, CLSID * lpClassId)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)\n", This);
if (!lpClassId)
return E_POINTER;
*lpClassId = CLSID_MyComputer;
return S_OK;
}
/************************************************************************
* IMCFldr_PersistFolder2_Initialize
*
* NOTES: it makes no sense to change the pidl
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (IPersistFolder2 * iface, LPCITEMIDLIST pidl)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)->(%p)\n", This, pidl);
return E_NOTIMPL;
}
/**************************************************************************
* IPersistFolder2_fnGetCurFolder
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (IPersistFolder2 * iface, LPITEMIDLIST * pidl)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
TRACE ("(%p)->(%p)\n", This, pidl);
if (!pidl)
return E_POINTER;
*pidl = ILClone (This->pidlRoot);
return S_OK;
}
static IPersistFolder2Vtbl vt_PersistFolder2 =
{
IMCFldr_PersistFolder2_QueryInterface,
IMCFldr_PersistFolder2_AddRef,
IMCFldr_PersistFolder2_Release,
IMCFldr_PersistFolder2_GetClassID,
IMCFldr_PersistFolder2_Initialize,
IMCFldr_PersistFolder2_GetCurFolder
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,516 @@
/*
* Shell Folder stuff
*
* Copyright 1997 Marcus Meissner
* Copyright 1998, 1999, 2002 Juergen Schmied
*
* IShellFolder2 and related interfaces
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "shlguid.h"
#include "pidl.h"
#include "undocshell.h"
#include "shell32_main.h"
#include "shresdef.h"
#include "shlwapi.h"
#include "shellfolder.h"
#include "wine/debug.h"
#include "debughlp.h"
#include "shfldr.h"
WINE_DEFAULT_DEBUG_CHANNEL (shell);
/***************************************************************************
* debughelper: print out the return address
* helps especially to track down unbalanced AddRef/Release
*/
#define MEM_DEBUG 0
#if MEM_DEBUG
#define _CALL_TRACE TRACE("called from: 0x%08x\n", *( ((UINT*)&iface)-1 ));
#else
#define _CALL_TRACE
#endif
static const WCHAR wszDotShellClassInfo[] = {'.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0};
/***************************************************************************
* SHELL32_GetCustomFolderAttribute (internal function)
*
* Gets a value from the folder's desktop.ini file, if one exists.
*
* PARAMETERS
* pidl [I] Folder containing the desktop.ini file.
* pwszHeading [I] Heading in .ini file.
* pwszAttribute [I] Attribute in .ini file.
* pwszValue [O] Buffer to store value into.
* cchValue [I] Size in characters including NULL of buffer pointed to
* by pwszValue.
*
* RETURNS
* TRUE if returned non-NULL value.
* FALSE otherwise.
*/
BOOL SHELL32_GetCustomFolderAttribute(
LPCITEMIDLIST pidl, LPCWSTR pwszHeading, LPCWSTR pwszAttribute,
LPWSTR pwszValue, DWORD cchValue)
{
#if 0 /* Hack around not having system attribute on non-Windows file systems */
DWORD dwAttrib = _ILGetFileAttributes(pidl, NULL, 0);
#else
DWORD dwAttrib = FILE_ATTRIBUTE_SYSTEM;
#endif
if (dwAttrib & FILE_ATTRIBUTE_SYSTEM)
{
DWORD ret;
WCHAR wszDesktopIniPath[MAX_PATH];
static const WCHAR wszDesktopIni[] =
{'d','e','s','k','t','o','p','.','i','n','i',0};
static const WCHAR wszDefault[] =
{0};
if (!SHGetPathFromIDListW(pidl, wszDesktopIniPath))
return FALSE;
PathAppendW(wszDesktopIniPath, wszDesktopIni);
ret = GetPrivateProfileStringW(pwszHeading, pwszAttribute,
wszDefault, pwszValue, cchValue, wszDesktopIniPath);
if (!ret) return FALSE;
return TRUE;
}
return FALSE;
}
/***************************************************************************
* GetNextElement (internal function)
*
* gets a part of a string till the first backslash
*
* PARAMETERS
* pszNext [IN] string to get the element from
* pszOut [IN] pointer to buffer whitch receives string
* dwOut [IN] length of pszOut
*
* RETURNS
* LPSTR pointer to first, not yet parsed char
*/
LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut)
{
LPCWSTR pszTail = pszNext;
DWORD dwCopy;
TRACE ("(%s %p 0x%08lx)\n", debugstr_w (pszNext), pszOut, dwOut);
*pszOut = 0x0000;
if (!pszNext || !*pszNext)
return NULL;
while (*pszTail && (*pszTail != (WCHAR) '\\'))
pszTail++;
dwCopy = (const WCHAR *) pszTail - (const WCHAR *) pszNext + 1;
lstrcpynW (pszOut, pszNext, (dwOut < dwCopy) ? dwOut : dwCopy);
if (*pszTail)
pszTail++;
else
pszTail = NULL;
TRACE ("--(%s %s 0x%08lx %p)\n", debugstr_w (pszNext), debugstr_w (pszOut), dwOut, pszTail);
return pszTail;
}
HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes)
{
HRESULT hr = E_INVALIDARG;
LPITEMIDLIST pidlOut = NULL,
pidlTemp = NULL;
IShellFolder *psfChild;
TRACE ("(%p, %p, %p, %s)\n", psf, pbc, pidlInOut ? *pidlInOut : NULL, debugstr_w (szNext));
/* get the shellfolder for the child pidl and let it analyse further */
hr = IShellFolder_BindToObject (psf, *pidlInOut, pbc, &IID_IShellFolder, (LPVOID *) & psfChild);
if (SUCCEEDED(hr)) {
hr = IShellFolder_ParseDisplayName (psfChild, hwndOwner, pbc, szNext, pEaten, &pidlOut, pdwAttributes);
IShellFolder_Release (psfChild);
if (SUCCEEDED(hr)) {
pidlTemp = ILCombine (*pidlInOut, pidlOut);
if (!pidlTemp)
hr = E_OUTOFMEMORY;
}
if (pidlOut)
ILFree (pidlOut);
}
ILFree (*pidlInOut);
*pidlInOut = pidlTemp;
TRACE ("-- pidl=%p ret=0x%08lx\n", pidlInOut ? *pidlInOut : NULL, hr);
return hr;
}
/***********************************************************************
* SHELL32_CoCreateInitSF
*
* Creates a shell folder and initializes it with a pidl and a root folder
* via IPersistFolder3 or IPersistFolder.
*
* NOTES
* pathRoot can be NULL for Folders beeing a drive.
* In this case the absolute path is build from pidlChild (eg. C:)
*/
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCSTR pathRoot,
LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID riid, LPVOID * ppvOut)
{
HRESULT hr;
TRACE ("%p %s %p\n", pidlRoot, pathRoot, pidlChild);
if (SUCCEEDED ((hr = SHCoCreateInstance (NULL, clsid, NULL, riid, ppvOut)))) {
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
IPersistFolder *pPF;
IPersistFolder3 *ppf;
if (SUCCEEDED (IUnknown_QueryInterface ((IUnknown *) * ppvOut, &IID_IPersistFolder3, (LPVOID *) & ppf))) {
PERSIST_FOLDER_TARGET_INFO ppfti;
char szDestPath[MAX_PATH];
ZeroMemory (&ppfti, sizeof (ppfti));
/* build path */
if (pathRoot) {
lstrcpyA (szDestPath, pathRoot);
PathAddBackslashA(szDestPath); /* FIXME: why have drives a backslash here ? */
} else {
szDestPath[0] = '\0';
}
if (pidlChild) {
LPSTR pszChild = _ILGetTextPointer(pidlChild);
if (pszChild)
lstrcatA (szDestPath, pszChild);
else
hr = E_INVALIDARG;
}
/* fill the PERSIST_FOLDER_TARGET_INFO */
ppfti.dwAttributes = -1;
ppfti.csidl = -1;
MultiByteToWideChar (CP_ACP, 0, szDestPath, -1, ppfti.szTargetParsingName, MAX_PATH);
IPersistFolder3_InitializeEx (ppf, NULL, pidlAbsolute, &ppfti);
IPersistFolder3_Release (ppf);
}
else if (SUCCEEDED ((hr = IUnknown_QueryInterface ((IUnknown *) * ppvOut, &IID_IPersistFolder, (LPVOID *) & pPF)))) {
IPersistFolder_Initialize (pPF, pidlAbsolute);
IPersistFolder_Release (pPF);
}
ILFree (pidlAbsolute);
}
TRACE ("-- (%p) ret=0x%08lx\n", *ppvOut, hr);
return hr;
}
/***********************************************************************
* SHELL32_BindToChild
*
* Common code for IShellFolder_BindToObject.
* Creates a shell folder by binding to a root pidl.
*/
HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut)
{
GUID const *clsid;
IShellFolder *pSF;
HRESULT hr;
LPITEMIDLIST pidlChild;
if (!pidlRoot || !ppvOut)
return E_INVALIDARG;
*ppvOut = NULL;
pidlChild = ILCloneFirst (pidlComplete);
if ((clsid = _ILGetGUIDPointer (pidlChild))) {
/* virtual folder */
hr = SHELL32_CoCreateInitSF (pidlRoot, pathRoot, pidlChild, clsid, &IID_IShellFolder, (LPVOID *) & pSF);
} else {
/* file system folder */
CLSID clsidFolder = CLSID_ShellFSFolder;
static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
WCHAR wszCLSIDValue[CHARS_IN_GUID];
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
/* see if folder CLSID should be overridden by desktop.ini file */
if (SHELL32_GetCustomFolderAttribute (pidlAbsolute,
wszDotShellClassInfo, wszCLSID, wszCLSIDValue, CHARS_IN_GUID))
CLSIDFromString (wszCLSIDValue, &clsidFolder);
ILFree (pidlAbsolute);
hr = SHELL32_CoCreateInitSF (pidlRoot, pathRoot, pidlChild,
&clsidFolder, &IID_IShellFolder, (LPVOID *)&pSF);
}
ILFree (pidlChild);
if (SUCCEEDED (hr)) {
if (_ILIsPidlSimple (pidlComplete)) {
/* no sub folders */
hr = IShellFolder_QueryInterface (pSF, riid, ppvOut);
} else {
/* go deeper */
hr = IShellFolder_BindToObject (pSF, ILGetNext (pidlComplete), NULL, riid, ppvOut);
}
IShellFolder_Release (pSF);
}
TRACE ("-- returning (%p) %08lx\n", *ppvOut, hr);
return hr;
}
/***********************************************************************
* SHELL32_GetDisplayNameOfChild
*
* Retrives the display name of a child object of a shellfolder.
*
* For a pidl eg. [subpidl1][subpidl2][subpidl3]:
* - it binds to the child shellfolder [subpidl1]
* - asks it for the displayname of [subpidl2][subpidl3]
*
* Is possible the pidl is a simple pidl. In this case it asks the
* subfolder for the displayname of a empty pidl. The subfolder
* returns the own displayname eg. "::{guid}". This is used for
* virtual folders with the registry key WantsFORPARSING set.
*/
HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTR szOut, DWORD dwOutLen)
{
LPITEMIDLIST pidlFirst;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(pidl=%p 0x%08lx %p 0x%08lx)\n", psf, pidl, dwFlags, szOut, dwOutLen);
pdump (pidl);
pidlFirst = ILCloneFirst (pidl);
if (pidlFirst) {
IShellFolder2 *psfChild;
hr = IShellFolder_BindToObject (psf, pidlFirst, NULL, &IID_IShellFolder, (LPVOID *) & psfChild);
if (SUCCEEDED (hr)) {
STRRET strTemp;
LPITEMIDLIST pidlNext = ILGetNext (pidl);
hr = IShellFolder_GetDisplayNameOf (psfChild, pidlNext, dwFlags, &strTemp);
if (SUCCEEDED (hr)) {
hr = StrRetToStrNA (szOut, dwOutLen, &strTemp, pidlNext);
}
IShellFolder_Release (psfChild);
}
ILFree (pidlFirst);
} else
hr = E_OUTOFMEMORY;
TRACE ("-- ret=0x%08lx %s\n", hr, szOut);
return hr;
}
/***********************************************************************
* SHELL32_GetItemAttributes
*
* NOTES
* observerd values:
* folder: 0xE0000177 FILESYSTEM | HASSUBFOLDER | FOLDER
* file: 0x40000177 FILESYSTEM
* drive: 0xf0000144 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR
* mycomputer: 0xb0000154 HASSUBFOLDER | FOLDER | FILESYSANCESTOR
* (seems to be default for shell extensions if no registry entry exists)
*
* win2k:
* folder: 0xF0400177 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR | CANMONIKER
* file: 0x40400177 FILESYSTEM | CANMONIKER
* drive 0xF0400154 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR | CANMONIKER | CANRENAME (LABEL)
*
* This function does not set flags!! It only resets flags when necessary.
*/
HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
{
GUID const *clsid;
DWORD dwAttributes;
DWORD dwSupportedAttr=SFGAO_CANCOPY | /*0x00000001 */
SFGAO_CANMOVE | /*0x00000002 */
SFGAO_CANLINK | /*0x00000004 */
SFGAO_CANRENAME | /*0x00000010 */
SFGAO_CANDELETE | /*0x00000020 */
SFGAO_HASPROPSHEET | /*0x00000040 */
SFGAO_DROPTARGET | /*0x00000100 */
SFGAO_LINK | /*0x00010000 */
SFGAO_READONLY | /*0x00040000 */
SFGAO_HIDDEN | /*0x00080000 */
SFGAO_FILESYSANCESTOR | /*0x10000000 */
SFGAO_FOLDER | /*0x20000000 */
SFGAO_FILESYSTEM | /*0x40000000 */
SFGAO_HASSUBFOLDER; /*0x80000000 */
TRACE ("0x%08lx\n", *pdwAttributes);
if (*pdwAttributes & ~dwSupportedAttr)
{
WARN ("attributes 0x%08lx not implemented\n", (*pdwAttributes & ~dwSupportedAttr));
*pdwAttributes &= dwSupportedAttr;
}
if (_ILIsDrive (pidl)) {
*pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK;
} else if ((clsid = _ILGetGUIDPointer (pidl))) {
if (HCR_GetFolderAttributes (clsid, &dwAttributes)) {
*pdwAttributes &= dwAttributes;
} else {
*pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK;
}
} else if (_ILGetDataPointer (pidl)) {
dwAttributes = _ILGetFileAttributes (pidl, NULL, 0);
*pdwAttributes &= ~SFGAO_FILESYSANCESTOR;
if ((SFGAO_FOLDER & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
*pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER);
if ((SFGAO_HIDDEN & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_HIDDEN))
*pdwAttributes &= ~SFGAO_HIDDEN;
if ((SFGAO_READONLY & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_READONLY))
*pdwAttributes &= ~SFGAO_READONLY;
if (SFGAO_LINK & *pdwAttributes) {
char ext[MAX_PATH];
if (!_ILGetExtension(pidl, ext, MAX_PATH) || strcasecmp(ext, "lnk"))
*pdwAttributes &= ~SFGAO_LINK;
}
} else {
*pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK;
}
TRACE ("-- 0x%08lx\n", *pdwAttributes);
return S_OK;
}
/***********************************************************************
* SHELL32_CompareIDs
*/
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{
int type1,
type2;
char szTemp1[MAX_PATH];
char szTemp2[MAX_PATH];
HRESULT nReturn;
LPITEMIDLIST firstpidl,
nextpidl1,
nextpidl2;
IShellFolder *psf;
/* test for empty pidls */
BOOL isEmpty1 = _ILIsDesktop (pidl1);
BOOL isEmpty2 = _ILIsDesktop (pidl2);
if (isEmpty1 && isEmpty2)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 0 );
if (isEmpty1)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
if (isEmpty2)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
/* test for different types. Sort order is the PT_* constant */
type1 = _ILGetDataPointer (pidl1)->type;
type2 = _ILGetDataPointer (pidl2)->type;
if (type1 < type2)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
else if (type1 > type2)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
/* test for name of pidl */
_ILSimpleGetText (pidl1, szTemp1, MAX_PATH);
_ILSimpleGetText (pidl2, szTemp2, MAX_PATH);
nReturn = strcasecmp (szTemp1, szTemp2);
if (nReturn < 0)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
else if (nReturn > 0)
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
/* test of complex pidls */
firstpidl = ILCloneFirst (pidl1);
nextpidl1 = ILGetNext (pidl1);
nextpidl2 = ILGetNext (pidl2);
/* optimizing: test special cases and bind not deeper */
/* the deeper shellfolder would do the same */
isEmpty1 = _ILIsDesktop (nextpidl1);
isEmpty2 = _ILIsDesktop (nextpidl2);
if (isEmpty1 && isEmpty2) {
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 0 );
} else if (isEmpty1) {
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 );
} else if (isEmpty2) {
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
/* optimizing end */
} else if (SUCCEEDED (IShellFolder_BindToObject (iface, firstpidl, NULL, &IID_IShellFolder, (LPVOID *) & psf))) {
nReturn = IShellFolder_CompareIDs (psf, lParam, nextpidl1, nextpidl2);
IShellFolder_Release (psf);
}
ILFree (firstpidl);
return nReturn;
}
/***********************************************************************
* SHCreateLinks
*
* Undocumented.
*/
HRESULT WINAPI SHCreateLinks( HWND hWnd, LPCSTR lpszDir, LPDATAOBJECT lpDataObject,
UINT uFlags, LPITEMIDLIST *lppidlLinks)
{
FIXME("%p %s %p %08x %p\n",hWnd,lpszDir,lpDataObject,uFlags,lppidlLinks);
return E_NOTIMPL;
}

View File

@@ -0,0 +1,223 @@
/*
* File System Bind Data object to use as parameter for the bind context to
* IShellFolder_ParseDisplayName
*
* Copyright 2003 Rolf Kalbermatter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlobj.h"
#include "shell32_main.h"
#include "debughlp.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(pidl);
/***********************************************************************
* IFileSystemBindData implementation
*/
typedef struct
{
IFileSystemBindDataVtbl *lpVtbl;
DWORD ref;
WIN32_FIND_DATAW findFile;
} IFileSystemBindDataImpl;
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *iface, REFIID riid, LPVOID* ppvObj);
static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *iface);
static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface);
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd);
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd);
static struct IFileSystemBindDataVtbl sbvt =
{
IFileSystemBindData_fnQueryInterface,
IFileSystemBindData_fnAddRef,
IFileSystemBindData_fnRelease,
IFileSystemBindData_fnSetFindData,
IFileSystemBindData_fnGetFindData,
};
static const WCHAR wFileSystemBindData[] = {'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
{
IFileSystemBindDataImpl *sb;
HRESULT ret = E_OUTOFMEMORY;
TRACE("%p, %p\n", pfd, ppV);
if (!ppV)
return E_INVALIDARG;
*ppV = NULL;
sb = (IFileSystemBindDataImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileSystemBindDataImpl));
if (!sb)
return ret;
sb->lpVtbl = &sbvt;
sb->ref = 1;
IFileSystemBindData_fnSetFindData((IFileSystemBindData*)sb, pfd);
ret = CreateBindCtx(0, ppV);
if (SUCCEEDED(ret))
{
BIND_OPTS bindOpts;
bindOpts.cbStruct = sizeof(BIND_OPTS);
bindOpts.grfFlags = 0;
bindOpts.grfMode = STGM_CREATE;
bindOpts.dwTickCountDeadline = 0;
IBindCtx_SetBindOptions(*ppV, &bindOpts);
IBindCtx_RegisterObjectParam(*ppV, (LPOLESTR)wFileSystemBindData, (LPUNKNOWN)sb);
IFileSystemBindData_Release((IFileSystemBindData*)sb);
}
else
HeapFree(GetProcessHeap(), 0, sb);
return ret;
}
HRESULT WINAPI FileSystemBindData_GetFindData(LPBC pbc, WIN32_FIND_DATAW *pfd)
{
LPUNKNOWN pUnk;
IFileSystemBindData *pfsbd = NULL;
HRESULT ret;
TRACE("%p, %p\n", pbc, pfd);
if (!pfd)
return E_INVALIDARG;
ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk);
if (SUCCEEDED(ret))
{
ret = IUnknown_QueryInterface(pUnk, &IID_IFileSystemBindData, (LPVOID *)&pfsbd);
if (SUCCEEDED(ret))
{
ret = IFileSystemBindData_GetFindData(pfsbd, pfd);
IFileSystemBindData_Release(pfsbd);
}
IUnknown_Release(pUnk);
}
return ret;
}
HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *pfd)
{
LPUNKNOWN pUnk;
IFileSystemBindData *pfsbd = NULL;
HRESULT ret;
TRACE("%p, %p\n", pbc, pfd);
ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk);
if (SUCCEEDED(ret))
{
ret = IUnknown_QueryInterface(pUnk, &IID_IFileSystemBindData, (LPVOID *)&pfsbd);
if (SUCCEEDED(ret))
{
ret = IFileSystemBindData_SetFindData(pfsbd, pfd);
IFileSystemBindData_Release(pfsbd);
}
IUnknown_Release(pUnk);
}
return ret;}
static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *iface, REFIID riid, LPVOID *ppV)
{
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s, %p)\n", This, debugstr_guid(riid), ppV);
*ppV = NULL;
if (IsEqualIID(riid, &IID_IUnknown))
{
*ppV = This;
}
else if (IsEqualIID(riid, &IID_IFileSystemBindData))
{
*ppV = (IFileSystemBindData*)This;
}
if (*ppV)
{
IUnknown_AddRef((IUnknown*)(*ppV));
TRACE("-- Interface: (%p)->(%p)\n", ppV, *ppV);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *iface)
{
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p)\n", This);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface)
{
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p)\n", This);
if (!InterlockedDecrement(&This->ref))
{
TRACE(" destroying ISFBindPidl(%p)\n",This);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}
return This->ref;
}
static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd)
{
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p), %p\n", This, pfd);
if (!pfd)
return E_INVALIDARG;
memcpy(pfd, &This->findFile, sizeof(WIN32_FIND_DATAW));
return NOERROR;
}
static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd)
{
IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
TRACE("(%p), %p\n", This, pfd);
if (pfd)
memcpy(&This->findFile, pfd, sizeof(WIN32_FIND_DATAW));
else
memset(&This->findFile, 0, sizeof(WIN32_FIND_DATAW));
return NOERROR;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,915 @@
/*
* shpolicy.c - Data for shell/system policies.
*
* Copyright 1999 Ian Schmidt <ischmidt@cfl.rr.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* NOTES:
*
* Some of these policies can be tweaked via the System Policy
* Editor which came with the Win95 Migration Guide, although
* there doesn't appear to be an updated Win98 version that
* would handle the many new policies introduced since then.
* You could easily write one with the information in
* this file...
*
* Up to date as of SHELL32 v5.00 (W2K)
*/
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winreg.h"
#include "shell32_main.h"
#include "shlobj.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define SHELL_NO_POLICY 0xffffffff
typedef struct tagPOLICYDAT
{
DWORD policy; /* policy value passed to SHRestricted */
LPCSTR appstr; /* application str such as "Explorer" */
LPCSTR keystr; /* name of the actual registry key / policy */
DWORD cache; /* cached value or 0xffffffff for invalid */
} POLICYDATA, *LPPOLICYDATA;
/* registry strings */
static const CHAR strRegistryPolicyA[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies";
static const WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o',
's','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n',
'\\','P','o','l','i','c','i','e','s',0};
static const CHAR strPolicyA[] = "Policy";
static const WCHAR strPolicyW[] = {'P','o','l','i','c','y',0};
/* application strings */
static const char strExplorer[] = {"Explorer"};
static const char strActiveDesk[] = {"ActiveDesktop"};
static const char strWinOldApp[] = {"WinOldApp"};
static const char strAddRemoveProgs[] = {"AddRemoveProgs"};
/* key strings */
static const char strNoFileURL[] = {"NoFileUrl"};
static const char strNoFolderOptions[] = {"NoFolderOptions"};
static const char strNoChangeStartMenu[] = {"NoChangeStartMenu"};
static const char strNoWindowsUpdate[] = {"NoWindowsUpdate"};
static const char strNoSetActiveDesktop[] = {"NoSetActiveDesktop"};
static const char strNoForgetSoftwareUpdate[] = {"NoForgetSoftwareUpdate"};
static const char strNoMSAppLogo[] = {"NoMSAppLogo5ChannelNotify"};
static const char strForceCopyACLW[] = {"ForceCopyACLWithFile"};
static const char strNoResolveTrk[] = {"NoResolveTrack"};
static const char strNoResolveSearch[] = {"NoResolveSearch"};
static const char strNoEditComponent[] = {"NoEditingComponents"};
static const char strNoMovingBand[] = {"NoMovingBands"};
static const char strNoCloseDragDrop[] = {"NoCloseDragDropBands"};
static const char strNoCloseComponent[] = {"NoClosingComponents"};
static const char strNoDelComponent[] = {"NoDeletingComponents"};
static const char strNoAddComponent[] = {"NoAddingComponents"};
static const char strNoComponent[] = {"NoComponents"};
static const char strNoChangeWallpaper[] = {"NoChangingWallpaper"};
static const char strNoHTMLWallpaper[] = {"NoHTMLWallpaper"};
static const char strNoCustomWebView[] = {"NoCustomizeWebView"};
static const char strClassicShell[] = {"ClassicShell"};
static const char strClearRecentDocs[] = {"ClearRecentDocsOnExit"};
static const char strNoFavoritesMenu[] = {"NoFavoritesMenu"};
static const char strNoActiveDesktopChanges[] = {"NoActiveDesktopChanges"};
static const char strNoActiveDesktop[] = {"NoActiveDesktop"};
static const char strNoRecentDocMenu[] = {"NoRecentDocsMenu"};
static const char strNoRecentDocHistory[] = {"NoRecentDocsHistory"};
static const char strNoInetIcon[] = {"NoInternetIcon"};
static const char strNoSettingsWizard[] = {"NoSettingsWizards"};
static const char strNoLogoff[] = {"NoLogoff"};
static const char strNoNetConDis[] = {"NoNetConnectDisconnect"};
static const char strNoViewContextMenu[] = {"NoViewContextMenu"};
static const char strNoTrayContextMenu[] = {"NoTrayContextMenu"};
static const char strNoWebMenu[] = {"NoWebMenu"};
static const char strLnkResolveIgnoreLnkInfo[] = {"LinkResolveIgnoreLinkInfo"};
static const char strNoCommonGroups[] = {"NoCommonGroups"};
static const char strEnforceShlExtSecurity[] = {"EnforceShellExtensionSecurity"};
static const char strNoRealMode[] = {"NoRealMode"};
static const char strMyDocsOnNet[] = {"MyDocsOnNet"};
static const char strNoStartMenuSubfolder[] = {"NoStartMenuSubFolders"};
static const char strNoAddPrinters[] = {"NoAddPrinter"};
static const char strNoDeletePrinters[] = {"NoDeletePrinter"};
static const char strNoPrintTab[] = {"NoPrinterTabs"};
static const char strRestrictRun[] = {"RestrictRun"};
static const char strNoStartBanner[] = {"NoStartBanner"};
static const char strNoNetworkNeighborhood[] = {"NoNetHood"};
static const char strNoDriveTypeAtRun[] = {"NoDriveTypeAutoRun"};
static const char strNoDrivesAutoRun[] = {"NoDriveAutoRun"};
static const char strSeparateProcess[] = {"SeparateProcess"};
static const char strNoDrives[] = {"NoDrives"};
static const char strNoFind[] = {"NoFind"};
static const char strNoDesktop[] = {"NoDesktop"};
static const char strNoSetTaskBar[] = {"NoSetTaskbar"};
static const char strNoSetFld[] = {"NoSetFolders"};
static const char strNoFileMenu[] = {"NoFileMenu"};
static const char strNoSaveSetting[] = {"NoSaveSettings"};
static const char strNoClose[] = {"NoClose"};
static const char strNoRun[] = {"NoRun"};
/* policy data array */
POLICYDATA sh32_policy_table[] =
{
{
REST_NORUN,
strExplorer,
strNoRun,
SHELL_NO_POLICY
},
{
REST_NOCLOSE,
strExplorer,
strNoClose,
SHELL_NO_POLICY
},
{
REST_NOSAVESET,
strExplorer,
strNoSaveSetting,
SHELL_NO_POLICY
},
{
REST_NOFILEMENU,
strExplorer,
strNoFileMenu,
SHELL_NO_POLICY
},
{
REST_NOSETFOLDERS,
strExplorer,
strNoSetFld,
SHELL_NO_POLICY
},
{
REST_NOSETTASKBAR,
strExplorer,
strNoSetTaskBar,
SHELL_NO_POLICY
},
{
REST_NODESKTOP,
strExplorer,
strNoDesktop,
SHELL_NO_POLICY
},
{
REST_NOFIND,
strExplorer,
strNoFind,
SHELL_NO_POLICY
},
{
REST_NODRIVES,
strExplorer,
strNoDrives,
SHELL_NO_POLICY
},
{
REST_NODRIVEAUTORUN,
strExplorer,
strNoDrivesAutoRun,
SHELL_NO_POLICY
},
{
REST_NODRIVETYPEAUTORUN,
strExplorer,
strNoDriveTypeAtRun,
SHELL_NO_POLICY
},
{
REST_NONETHOOD,
strExplorer,
strNoNetworkNeighborhood,
SHELL_NO_POLICY
},
{
REST_STARTBANNER,
strExplorer,
strNoStartBanner,
SHELL_NO_POLICY
},
{
REST_RESTRICTRUN,
strExplorer,
strRestrictRun,
SHELL_NO_POLICY
},
{
REST_NOPRINTERTABS,
strExplorer,
strNoPrintTab,
SHELL_NO_POLICY
},
{
REST_NOPRINTERDELETE,
strExplorer,
strNoDeletePrinters,
SHELL_NO_POLICY
},
{
REST_NOPRINTERADD,
strExplorer,
strNoAddPrinters,
SHELL_NO_POLICY
},
{
REST_NOSTARTMENUSUBFOLDERS,
strExplorer,
strNoStartMenuSubfolder,
SHELL_NO_POLICY
},
{
REST_MYDOCSONNET,
strExplorer,
strMyDocsOnNet,
SHELL_NO_POLICY
},
{
REST_NOEXITTODOS,
strWinOldApp,
strNoRealMode,
SHELL_NO_POLICY
},
{
REST_ENFORCESHELLEXTSECURITY,
strExplorer,
strEnforceShlExtSecurity,
SHELL_NO_POLICY
},
{
REST_LINKRESOLVEIGNORELINKINFO,
strExplorer,
strLnkResolveIgnoreLnkInfo,
SHELL_NO_POLICY
},
{
REST_NOCOMMONGROUPS,
strExplorer,
strNoCommonGroups,
SHELL_NO_POLICY
},
{
REST_SEPARATEDESKTOPPROCESS,
strExplorer,
strSeparateProcess,
SHELL_NO_POLICY
},
{
REST_NOWEB,
strExplorer,
strNoWebMenu,
SHELL_NO_POLICY
},
{
REST_NOTRAYCONTEXTMENU,
strExplorer,
strNoTrayContextMenu,
SHELL_NO_POLICY
},
{
REST_NOVIEWCONTEXTMENU,
strExplorer,
strNoViewContextMenu,
SHELL_NO_POLICY
},
{
REST_NONETCONNECTDISCONNECT,
strExplorer,
strNoNetConDis,
SHELL_NO_POLICY
},
{
REST_STARTMENULOGOFF,
strExplorer,
strNoLogoff,
SHELL_NO_POLICY
},
{
REST_NOSETTINGSASSIST,
strExplorer,
strNoSettingsWizard,
SHELL_NO_POLICY
},
{
REST_NOINTERNETICON,
strExplorer,
strNoInetIcon,
SHELL_NO_POLICY
},
{
REST_NORECENTDOCSHISTORY,
strExplorer,
strNoRecentDocHistory,
SHELL_NO_POLICY
},
{
REST_NORECENTDOCSMENU,
strExplorer,
strNoRecentDocMenu,
SHELL_NO_POLICY
},
{
REST_NOACTIVEDESKTOP,
strExplorer,
strNoActiveDesktop,
SHELL_NO_POLICY
},
{
REST_NOACTIVEDESKTOPCHANGES,
strExplorer,
strNoActiveDesktopChanges,
SHELL_NO_POLICY
},
{
REST_NOFAVORITESMENU,
strExplorer,
strNoFavoritesMenu,
SHELL_NO_POLICY
},
{
REST_CLEARRECENTDOCSONEXIT,
strExplorer,
strClearRecentDocs,
SHELL_NO_POLICY
},
{
REST_CLASSICSHELL,
strExplorer,
strClassicShell,
SHELL_NO_POLICY
},
{
REST_NOCUSTOMIZEWEBVIEW,
strExplorer,
strNoCustomWebView,
SHELL_NO_POLICY
},
{
REST_NOHTMLWALLPAPER,
strActiveDesk,
strNoHTMLWallpaper,
SHELL_NO_POLICY
},
{
REST_NOCHANGINGWALLPAPER,
strActiveDesk,
strNoChangeWallpaper,
SHELL_NO_POLICY
},
{
REST_NODESKCOMP,
strActiveDesk,
strNoComponent,
SHELL_NO_POLICY
},
{
REST_NOADDDESKCOMP,
strActiveDesk,
strNoAddComponent,
SHELL_NO_POLICY
},
{
REST_NODELDESKCOMP,
strActiveDesk,
strNoDelComponent,
SHELL_NO_POLICY
},
{
REST_NOCLOSEDESKCOMP,
strActiveDesk,
strNoCloseComponent,
SHELL_NO_POLICY
},
{
REST_NOCLOSE_DRAGDROPBAND,
strActiveDesk,
strNoCloseDragDrop,
SHELL_NO_POLICY
},
{
REST_NOMOVINGBAND,
strActiveDesk,
strNoMovingBand,
SHELL_NO_POLICY
},
{
REST_NOEDITDESKCOMP,
strActiveDesk,
strNoEditComponent,
SHELL_NO_POLICY
},
{
REST_NORESOLVESEARCH,
strExplorer,
strNoResolveSearch,
SHELL_NO_POLICY
},
{
REST_NORESOLVETRACK,
strExplorer,
strNoResolveTrk,
SHELL_NO_POLICY
},
{
REST_FORCECOPYACLWITHFILE,
strExplorer,
strForceCopyACLW,
SHELL_NO_POLICY
},
{
REST_NOLOGO3CHANNELNOTIFY,
strExplorer,
strNoMSAppLogo,
SHELL_NO_POLICY
},
{
REST_NOFORGETSOFTWAREUPDATE,
strExplorer,
strNoForgetSoftwareUpdate,
SHELL_NO_POLICY
},
{
REST_NOSETACTIVEDESKTOP,
strExplorer,
strNoSetActiveDesktop,
SHELL_NO_POLICY
},
{
REST_NOUPDATEWINDOWS,
strExplorer,
strNoWindowsUpdate,
SHELL_NO_POLICY
},
{
REST_NOCHANGESTARMENU,
strExplorer,
strNoChangeStartMenu,
SHELL_NO_POLICY
},
{
REST_NOFOLDEROPTIONS,
strExplorer,
strNoFolderOptions,
SHELL_NO_POLICY
},
{
REST_HASFINDCOMPUTERS,
strExplorer,
"FindComputers",
SHELL_NO_POLICY
},
{
REST_INTELLIMENUS,
strExplorer,
"IntelliMenus",
SHELL_NO_POLICY
},
{
REST_RUNDLGMEMCHECKBOX,
strExplorer,
"MemCheckBoxInRunDlg",
SHELL_NO_POLICY
},
{
REST_ARP_ShowPostSetup,
strAddRemoveProgs,
"ShowPostSetup",
SHELL_NO_POLICY
},
{
REST_NOCSC,
strExplorer,
"NoSyncAll",
SHELL_NO_POLICY
},
{
REST_NOCONTROLPANEL,
strExplorer,
"NoControlPanel",
SHELL_NO_POLICY
},
{
REST_ENUMWORKGROUP,
strExplorer,
"EnumWorkgroup",
SHELL_NO_POLICY
},
{
REST_ARP_NOARP,
strAddRemoveProgs,
"NoAddRemovePrograms",
SHELL_NO_POLICY
},
{
REST_ARP_NOREMOVEPAGE,
strAddRemoveProgs,
"NoRemovePage",
SHELL_NO_POLICY
},
{
REST_ARP_NOADDPAGE,
strAddRemoveProgs,
"NoAddPage",
SHELL_NO_POLICY
},
{
REST_ARP_NOWINSETUPPAGE,
strAddRemoveProgs,
"NoWindowsSetupPage",
SHELL_NO_POLICY
},
{
REST_GREYMSIADS,
strExplorer,
"",
SHELL_NO_POLICY
},
{
REST_NOCHANGEMAPPEDDRIVELABEL,
strExplorer,
"NoChangeMappedDriveLabel",
SHELL_NO_POLICY
},
{
REST_NOCHANGEMAPPEDDRIVECOMMENT,
strExplorer,
"NoChangeMappedDriveComment",
SHELL_NO_POLICY
},
{
REST_MaxRecentDocs,
strExplorer,
"MaxRecentDocs",
SHELL_NO_POLICY
},
{
REST_NONETWORKCONNECTIONS,
strExplorer,
"NoNetworkConnections",
SHELL_NO_POLICY
},
{
REST_FORCESTARTMENULOGOFF,
strExplorer,
"ForceStartMenuLogoff",
SHELL_NO_POLICY
},
{
REST_NOWEBVIEW,
strExplorer,
"NoWebView",
SHELL_NO_POLICY
},
{
REST_NOCUSTOMIZETHISFOLDER,
strExplorer,
"NoCustomizeThisFolder",
SHELL_NO_POLICY
},
{
REST_NOENCRYPTION,
strExplorer,
"NoEncryption",
SHELL_NO_POLICY
},
{
REST_ALLOWFRENCHENCRYPTION,
strExplorer,
"AllowFrenchEncryption",
SHELL_NO_POLICY
},
{
REST_DONTSHOWSUPERHIDDEN,
strExplorer,
"DontShowSuperHidden",
SHELL_NO_POLICY
},
{
REST_NOSHELLSEARCHBUTTON,
strExplorer,
"NoShellSearchButton",
SHELL_NO_POLICY
},
{
REST_NOHARDWARETAB,
strExplorer,
"NoHardwareTab",
SHELL_NO_POLICY
},
{
REST_NORUNASINSTALLPROMPT,
strExplorer,
"NoRunasInstallPrompt",
SHELL_NO_POLICY
},
{
REST_PROMPTRUNASINSTALLNETPATH,
strExplorer,
"PromptRunasInstallNetPath",
SHELL_NO_POLICY
},
{
REST_NOMANAGEMYCOMPUTERVERB,
strExplorer,
"NoManageMyComputerVerb",
SHELL_NO_POLICY
},
{
REST_NORECENTDOCSNETHOOD,
strExplorer,
"NoRecentDocsNetHood",
SHELL_NO_POLICY
},
{
REST_DISALLOWRUN,
strExplorer,
"DisallowRun",
SHELL_NO_POLICY
},
{
REST_NOWELCOMESCREEN,
strExplorer,
"NoWelcomeScreen",
SHELL_NO_POLICY
},
{
REST_RESTRICTCPL,
strExplorer,
"RestrictCpl",
SHELL_NO_POLICY
},
{
REST_DISALLOWCPL,
strExplorer,
"DisallowCpl",
SHELL_NO_POLICY
},
{
REST_NOSMBALLOONTIP,
strExplorer,
"NoSMBalloonTip",
SHELL_NO_POLICY
},
{
REST_NOSMHELP,
strExplorer,
"NoSMHelp",
SHELL_NO_POLICY
},
{
REST_NOWINKEYS,
strExplorer,
"NoWinKeys",
SHELL_NO_POLICY
},
{
REST_NOENCRYPTONMOVE,
strExplorer,
"NoEncryptOnMove",
SHELL_NO_POLICY
},
{
REST_NOLOCALMACHINERUN,
strExplorer,
"DisableLocalMachineRun",
SHELL_NO_POLICY
},
{
REST_NOCURRENTUSERRUN,
strExplorer,
"DisableCurrentUserRun",
SHELL_NO_POLICY
},
{
REST_NOLOCALMACHINERUNONCE,
strExplorer,
"DisableLocalMachineRunOnce",
SHELL_NO_POLICY
},
{
REST_NOCURRENTUSERRUNONCE,
strExplorer,
"DisableCurrentUserRunOnce",
SHELL_NO_POLICY
},
{
REST_FORCEACTIVEDESKTOPON,
strExplorer,
"ForceActiveDesktopOn",
SHELL_NO_POLICY
},
{
REST_NOCOMPUTERSNEARME,
strExplorer,
"NoComputersNearMe",
SHELL_NO_POLICY
},
{
REST_NOVIEWONDRIVE,
strExplorer,
"NoViewOnDrive",
SHELL_NO_POLICY
},
{
REST_NONETCRAWL,
strExplorer,
"NoNetCrawl",
SHELL_NO_POLICY
},
{
REST_NOSHAREDDOCUMENTS,
strExplorer,
"NoSharedDocs",
SHELL_NO_POLICY
},
{
REST_NOSMMYDOCS,
strExplorer,
"NoSMMyDocs",
SHELL_NO_POLICY
},
/* 0x4000050 - 0x4000060 */
{
REST_NONLEGACYSHELLMODE,
strExplorer,
"NoneLegacyShellMode",
SHELL_NO_POLICY
},
{
REST_STARTRUNNOHOMEPATH,
strExplorer,
"StartRunNoHOMEPATH",
SHELL_NO_POLICY
},
/* 0x4000061 - 0x4000086 */
{
REST_NODISCONNECT,
strExplorer,
"NoDisconnect",
SHELL_NO_POLICY
},
{
REST_NOSECURITY,
strExplorer,
"NoNTSecurity",
SHELL_NO_POLICY
},
{
REST_NOFILEASSOCIATE,
strExplorer,
"NoFileAssociate",
SHELL_NO_POLICY
},
{
0x50000024,
strExplorer,
strNoFileURL,
SHELL_NO_POLICY
},
{
0,
0,
0,
SHELL_NO_POLICY
}
};
/*************************************************************************
* SHRestricted [SHELL32.100]
*
* Get the value associated with a policy Id.
*
* PARAMS
* pol [I] Policy Id
*
* RETURNS
* The queried value for the policy.
*
* NOTES
* Exported by ordinal.
* This function caches the retrieved values to prevent unnecessary registry access,
* if SHInitRestricted() was previously called.
*
* REFERENCES
* a: MS System Policy Editor.
* b: 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/
* c: 'The Windows 95 Registry', by John Woram, 1996 MIS: Press
*/
DWORD WINAPI SHRestricted (RESTRICTIONS policy)
{
char regstr[256];
HKEY xhkey;
DWORD retval, datsize = 4;
LPPOLICYDATA p;
TRACE("(%08x)\n", policy);
/* scan to see if we know this policy ID */
for (p = sh32_policy_table; p->policy; p++)
{
if (policy == p->policy)
{
break;
}
}
if (p->policy == 0)
{
/* we don't know this policy, return 0 */
TRACE("unknown policy: (%08x)\n", policy);
return 0;
}
/* we have a known policy */
/* first check if this policy has been cached, return it if so */
if (p->cache != SHELL_NO_POLICY)
{
return p->cache;
}
lstrcpyA(regstr, strRegistryPolicyA);
lstrcatA(regstr, p->appstr);
/* return 0 and don't set the cache if any registry errors occur */
retval = 0;
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
{
if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
{
p->cache = retval;
}
RegCloseKey(xhkey);
}
return retval;
}
/*************************************************************************
* SHInitRestricted [SHELL32.244]
*
* Initialise the policy cache to speed up calls to SHRestricted().
*
* PARAMS
* unused [I] Reserved.
* inpRegKey [I] Registry key to scan.
*
* RETURNS
* Success: -1. The policy cache is initialised.
* Failure: 0, if inpRegKey is any value other than NULL, "Policy", or
* "Software\Microsoft\Windows\CurrentVersion\Policies".
*
* NOTES
* Exported by ordinal. Introduced in Win98.
*/
BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey)
{
TRACE("(%p, %p)\n", unused, inpRegKey);
/* first check - if input is non-NULL and points to the secret
key string, then pass. Otherwise return 0.
*/
if (inpRegKey != NULL)
{
if (SHELL_OsIsUnicode())
{
if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) &&
lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW))
/* doesn't match, fail */
return 0;
}
else
{
if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) &&
lstrcmpiA((LPCSTR)inpRegKey, strPolicyA))
/* doesn't match, fail */
return 0;
}
}
return TRUE;
}

16642
reactos/lib/shell32/shres.rc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,92 @@
/*
* Copyright 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_SHELL_RES_H
#define __WINE_SHELL_RES_H
/*
columntitles for the shellview
*/
#define IDS_SHV_COLUMN1 7
#define IDS_SHV_COLUMN2 8
#define IDS_SHV_COLUMN3 9
#define IDS_SHV_COLUMN4 10
#define IDS_SHV_COLUMN5 11
#define IDS_SHV_COLUMN6 12
#define IDS_SHV_COLUMN7 13
#define IDS_SHV_COLUMN8 14
#define IDS_SHV_COLUMN9 15
#define IDS_DESKTOP 20
#define IDS_MYCOMPUTER 21
#define IDS_SELECT 22
#define IDS_OPEN 23
#define IDS_VIEW_LARGE 24
#define IDS_VIEW_SMALL 25
#define IDS_VIEW_LIST 26
#define IDS_VIEW_DETAILS 27
#define IDS_CREATEFOLDER_DENIED 30
#define IDS_CREATEFOLDER_CAPTION 31
#define IDS_DELETEITEM_CAPTION 32
#define IDS_DELETEFOLDER_CAPTION 33
#define IDS_DELETEITEM_TEXT 34
#define IDS_DELETEMULTIPLE_TEXT 35
#define IDS_OVERWRITEFILE_CAPTION 36
#define IDS_OVERWRITEFILE_TEXT 37
#define IDS_RESTART_TITLE 40
#define IDS_RESTART_PROMPT 41
#define IDS_SHUTDOWN_TITLE 42
#define IDS_SHUTDOWN_PROMPT 43
#define IDS_PROGRAMS 45
#define IDS_PERSONAL 46
#define IDS_FAVORITES 47
#define IDS_STARTUP 48
#define IDS_RECENT 49
#define IDS_SENDTO 50
#define IDS_STARTMENU 51
#define IDS_MYMUSIC 52
#define IDS_MYVIDEO 53
#define IDS_DESKTOPDIRECTORY 54
#define IDS_NETHOOD 55
#define IDS_TEMPLATES 56
#define IDS_APPDATA 57
#define IDS_PRINTHOOD 58
#define IDS_LOCAL_APPDATA 59
#define IDS_INTERNET_CACHE 60
#define IDS_COOKIES 61
#define IDS_HISTORY 62
#define IDS_PROGRAM_FILES 63
#define IDS_MYPICTURES 64
#define IDS_PROGRAM_FILES_COMMON 65
#define IDS_COMMON_DOCUMENTS 66
#define IDS_ADMINTOOLS 67
#define IDS_COMMON_MUSIC 68
#define IDS_COMMON_PICTURES 69
#define IDS_COMMON_VIDEO 70
#define IDS_CDBURN_AREA 71
/* browse for folder dialog box */
#define IDD_STATUS 0x3743
#define IDD_TITLE 0x3742
#define IDD_TREEVIEW 0x3741
#endif

View File

@@ -0,0 +1,445 @@
/*
* IContextMenu
* ShellView Background Context Menu (shv_bg_cm)
*
* Copyright 1999 Juergen Schmied <juergen.schmied@metronet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "wine/debug.h"
#include "windef.h"
#include "wingdi.h"
#include "pidl.h"
#include "shlguid.h"
#include "shlobj.h"
#include "shell32_main.h"
#include "shellfolder.h"
#include "undocshell.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/**************************************************************************
* IContextMenu Implementation
*/
typedef struct
{
IContextMenu2Vtbl *lpVtbl;
IShellFolder* pSFParent;
DWORD ref;
} BgCmImpl;
static struct IContextMenu2Vtbl cmvt;
/**************************************************************************
* ISVBgCm_Constructor()
*/
IContextMenu2 *ISvBgCm_Constructor(IShellFolder* pSFParent)
{
BgCmImpl* cm;
cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pSFParent = pSFParent;
if(pSFParent) IShellFolder_AddRef(pSFParent);
TRACE("(%p)->()\n",cm);
return (IContextMenu2*)cm;
}
/**************************************************************************
* ISVBgCm_fnQueryInterface
*/
static HRESULT WINAPI ISVBgCm_fnQueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj)
{
BgCmImpl *This = (BgCmImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IContextMenu) ||
IsEqualIID(riid, &IID_IContextMenu2))
{
*ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/
{
FIXME("-- LPSHELLEXTINIT pointer requested\n");
}
if(*ppvObj)
{
IUnknown_AddRef((IUnknown*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/**************************************************************************
* ISVBgCm_fnAddRef
*/
static ULONG WINAPI ISVBgCm_fnAddRef(IContextMenu2 *iface)
{
BgCmImpl *This = (BgCmImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This, This->ref);
return ++(This->ref);
}
/**************************************************************************
* ISVBgCm_fnRelease
*/
static ULONG WINAPI ISVBgCm_fnRelease(IContextMenu2 *iface)
{
BgCmImpl *This = (BgCmImpl *)iface;
TRACE("(%p)->()\n",This);
if (!--(This->ref))
{
TRACE(" destroying IContextMenu(%p)\n",This);
if(This->pSFParent)
IShellFolder_Release(This->pSFParent);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
/**************************************************************************
* ISVBgCm_fnQueryContextMenu()
*/
static HRESULT WINAPI ISVBgCm_fnQueryContextMenu(
IContextMenu2 *iface,
HMENU hMenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags)
{
HMENU hMyMenu;
UINT idMax;
HRESULT hr;
BgCmImpl *This = (BgCmImpl *)iface;
TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",
This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
hMyMenu = LoadMenuA(shell32_hInstance, "MENU_002");
if (uFlags & CMF_DEFAULTONLY)
{
HMENU ourMenu = GetSubMenu(hMyMenu,0);
UINT oldDef = GetMenuDefaultItem(hMenu,TRUE,GMDI_USEDISABLED);
UINT newDef = GetMenuDefaultItem(ourMenu,TRUE,GMDI_USEDISABLED);
if (newDef != oldDef)
SetMenuDefaultItem(hMenu,newDef,TRUE);
if (newDef!=0xFFFFFFFF)
hr = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, newDef+1);
else
hr = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0);
}
else
{
idMax = Shell_MergeMenus (hMenu, GetSubMenu(hMyMenu,0), indexMenu,
idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS);
hr = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idMax-idCmdFirst+1);
}
DestroyMenu(hMyMenu);
TRACE("(%p)->returning 0x%lx\n",This,hr);
return hr;
}
/**************************************************************************
* DoNewFolder
*/
static void DoNewFolder(
IContextMenu2 *iface,
IShellView *psv)
{
BgCmImpl *This = (BgCmImpl *)iface;
ISFHelper * psfhlp;
char szName[MAX_PATH];
IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp);
if (psfhlp)
{
LPITEMIDLIST pidl;
ISFHelper_GetUniqueName(psfhlp, szName, MAX_PATH);
ISFHelper_AddFolder(psfhlp, 0, szName, &pidl);
if(psv)
{
/* if we are in a shellview do labeledit */
IShellView_SelectItem(psv,
pidl,(SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE
|SVSI_FOCUSED|SVSI_SELECT));
}
SHFree(pidl);
ISFHelper_Release(psfhlp);
}
}
/**************************************************************************
* DoPaste
*/
static BOOL DoPaste(
IContextMenu2 *iface)
{
BgCmImpl *This = (BgCmImpl *)iface;
BOOL bSuccess = FALSE;
IDataObject * pda;
TRACE("\n");
if(SUCCEEDED(OleGetClipboard(&pda)))
{
STGMEDIUM medium;
FORMATETC formatetc;
TRACE("pda=%p\n", pda);
/* Set the FORMATETC structure*/
InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL);
/* Get the pidls from IDataObject */
if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium)))
{
LPITEMIDLIST * apidl;
LPITEMIDLIST pidl;
IShellFolder *psfFrom = NULL, *psfDesktop;
LPIDA lpcida = GlobalLock(medium.u.hGlobal);
TRACE("cida=%p\n", lpcida);
apidl = _ILCopyCidaToaPidl(&pidl, lpcida);
/* bind to the source shellfolder */
SHGetDesktopFolder(&psfDesktop);
if(psfDesktop)
{
IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom);
IShellFolder_Release(psfDesktop);
}
if (psfFrom)
{
/* get source and destination shellfolder */
ISFHelper *psfhlpdst, *psfhlpsrc;
IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst);
IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc);
/* do the copy/move */
if (psfhlpdst && psfhlpsrc)
{
ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl);
/* FIXME handle move
ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl);
*/
}
if(psfhlpdst) ISFHelper_Release(psfhlpdst);
if(psfhlpsrc) ISFHelper_Release(psfhlpsrc);
IShellFolder_Release(psfFrom);
}
_ILFreeaPidl(apidl, lpcida->cidl);
SHFree(pidl);
/* release the medium*/
ReleaseStgMedium(&medium);
}
IDataObject_Release(pda);
}
#if 0
HGLOBAL hMem;
OpenClipboard(NULL);
hMem = GetClipboardData(CF_HDROP);
if(hMem)
{
char * pDropFiles = (char *)GlobalLock(hMem);
if(pDropFiles)
{
int len, offset = sizeof(DROPFILESTRUCT);
while( pDropFiles[offset] != 0)
{
len = strlen(pDropFiles + offset);
TRACE("%s\n", pDropFiles + offset);
offset += len+1;
}
}
GlobalUnlock(hMem);
}
CloseClipboard();
#endif
return bSuccess;
}
/**************************************************************************
* ISVBgCm_fnInvokeCommand()
*/
static HRESULT WINAPI ISVBgCm_fnInvokeCommand(
IContextMenu2 *iface,
LPCMINVOKECOMMANDINFO lpcmi)
{
BgCmImpl *This = (BgCmImpl *)iface;
LPSHELLBROWSER lpSB;
LPSHELLVIEW lpSV = NULL;
HWND hWndSV = 0;
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
/* get the active IShellView */
if((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0)))
{
if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV)))
{
IShellView_GetWindow(lpSV, &hWndSV);
}
}
if(HIWORD(lpcmi->lpVerb))
{
TRACE("%s\n",lpcmi->lpVerb);
if (! strcmp(lpcmi->lpVerb,CMDSTR_NEWFOLDERA))
{
DoNewFolder(iface, lpSV);
}
else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLISTA))
{
if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_LISTVIEW,0),0 );
}
else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILSA))
{
if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 );
}
else
{
FIXME("please report: unknown verb %s\n",lpcmi->lpVerb);
}
}
else
{
switch(LOWORD(lpcmi->lpVerb))
{
case FCIDM_SHVIEW_NEWFOLDER:
DoNewFolder(iface, lpSV);
break;
case FCIDM_SHVIEW_INSERT:
DoPaste(iface);
break;
default:
/* if it's a id just pass it to the parent shv */
SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 );
break;
}
}
if (lpSV)
IShellView_Release(lpSV); /* QueryActiveShellView does AddRef*/
return NOERROR;
}
/**************************************************************************
* ISVBgCm_fnGetCommandString()
*
*/
static HRESULT WINAPI ISVBgCm_fnGetCommandString(
IContextMenu2 *iface,
UINT idCommand,
UINT uFlags,
UINT* lpReserved,
LPSTR lpszName,
UINT uMaxNameLen)
{
BgCmImpl *This = (BgCmImpl *)iface;
TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
/* test the existence of the menu items, the file dialog enables
the buttons according to this */
if (uFlags == GCS_VALIDATEA)
{
if(HIWORD(idCommand))
{
if (!strcmp((LPSTR)idCommand, CMDSTR_VIEWLISTA) ||
!strcmp((LPSTR)idCommand, CMDSTR_VIEWDETAILSA) ||
!strcmp((LPSTR)idCommand, CMDSTR_NEWFOLDERA))
{
return NOERROR;
}
}
}
FIXME("unknown command string\n");
return E_FAIL;
}
/**************************************************************************
* ISVBgCm_fnHandleMenuMsg()
*/
static HRESULT WINAPI ISVBgCm_fnHandleMenuMsg(
IContextMenu2 *iface,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
BgCmImpl *This = (BgCmImpl *)iface;
FIXME("(%p)->(msg=%x wp=%x lp=%lx)\n",This, uMsg, wParam, lParam);
return E_NOTIMPL;
}
/**************************************************************************
* IContextMenu2 VTable
*
*/
static struct IContextMenu2Vtbl cmvt =
{
ISVBgCm_fnQueryInterface,
ISVBgCm_fnAddRef,
ISVBgCm_fnRelease,
ISVBgCm_fnQueryContextMenu,
ISVBgCm_fnInvokeCommand,
ISVBgCm_fnGetCommandString,
ISVBgCm_fnHandleMenuMsg
};

View File

@@ -0,0 +1,531 @@
/*
* IContextMenu for items in the shellview
*
* Copyright 1998, 2000 Juergen Schmied <juergen.schmied@debitel.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "winerror.h"
#include "wine/debug.h"
#include "windef.h"
#include "wingdi.h"
#include "pidl.h"
#include "shlguid.h"
#include "undocshell.h"
#include "shlobj.h"
#include "shell32_main.h"
#include "shellfolder.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/**************************************************************************
* IContextMenu Implementation
*/
typedef struct
{ IContextMenu2Vtbl *lpVtbl;
DWORD ref;
IShellFolder* pSFParent;
LPITEMIDLIST pidl; /* root pidl */
LPITEMIDLIST *apidl; /* array of child pidls */
UINT cidl;
BOOL bAllValues;
} ItemCmImpl;
static struct IContextMenu2Vtbl cmvt;
/**************************************************************************
* ISvItemCm_CanRenameItems()
*/
static BOOL ISvItemCm_CanRenameItems(ItemCmImpl *This)
{ UINT i;
DWORD dwAttributes;
TRACE("(%p)->()\n",This);
if(This->apidl)
{
for(i = 0; i < This->cidl; i++){}
if(i > 1) return FALSE; /* can't rename more than one item at a time*/
dwAttributes = SFGAO_CANRENAME;
IShellFolder_GetAttributesOf(This->pSFParent, 1, (LPCITEMIDLIST*)This->apidl, &dwAttributes);
return dwAttributes & SFGAO_CANRENAME;
}
return FALSE;
}
/**************************************************************************
* ISvItemCm_Constructor()
*/
IContextMenu2 *ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl)
{ ItemCmImpl* cm;
UINT u;
cm = (ItemCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pidl = ILClone(pidl);
cm->pSFParent = pSFParent;
if(pSFParent) IShellFolder_AddRef(pSFParent);
cm->apidl = _ILCopyaPidl(apidl, cidl);
cm->cidl = cidl;
cm->bAllValues = 1;
for(u = 0; u < cidl; u++)
{
cm->bAllValues &= (_ILIsValue(apidl[u]) ? 1 : 0);
}
TRACE("(%p)->()\n",cm);
return (IContextMenu2*)cm;
}
/**************************************************************************
* ISvItemCm_fnQueryInterface
*/
static HRESULT WINAPI ISvItemCm_fnQueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IContextMenu) ||
IsEqualIID(riid, &IID_IContextMenu2))
{
*ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/
{
FIXME("-- LPSHELLEXTINIT pointer requested\n");
}
if(*ppvObj)
{
IUnknown_AddRef((IUnknown*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/**************************************************************************
* ISvItemCm_fnAddRef
*/
static ULONG WINAPI ISvItemCm_fnAddRef(IContextMenu2 *iface)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
TRACE("(%p)->(count=%lu)\n",This, This->ref);
return ++(This->ref);
}
/**************************************************************************
* ISvItemCm_fnRelease
*/
static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu2 *iface)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
TRACE("(%p)->()\n",This);
if (!--(This->ref))
{
TRACE(" destroying IContextMenu(%p)\n",This);
if(This->pSFParent)
IShellFolder_Release(This->pSFParent);
if(This->pidl)
SHFree(This->pidl);
/*make sure the pidl is freed*/
_ILFreeaPidl(This->apidl, This->cidl);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
/**************************************************************************
* ICM_InsertItem()
*/
void WINAPI _InsertMenuItem (
HMENU hmenu,
UINT indexMenu,
BOOL fByPosition,
UINT wID,
UINT fType,
LPSTR dwTypeData,
UINT fState)
{
MENUITEMINFOA mii;
ZeroMemory(&mii, sizeof(mii));
mii.cbSize = sizeof(mii);
if (fType == MFT_SEPARATOR)
{
mii.fMask = MIIM_ID | MIIM_TYPE;
}
else
{
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
mii.dwTypeData = dwTypeData;
mii.fState = fState;
}
mii.wID = wID;
mii.fType = fType;
InsertMenuItemA( hmenu, indexMenu, fByPosition, &mii);
}
/**************************************************************************
* ISvItemCm_fnQueryContextMenu()
* FIXME: load menu MENU_SHV_FILE out of resources instead if creating
* each menu item by calling _InsertMenuItem()
*/
static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
IContextMenu2 *iface,
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
if (idCmdFirst != 0)
FIXME("We should use idCmdFirst=%d and idCmdLast=%d for command ids\n", idCmdFirst, idCmdLast);
if(!(CMF_DEFAULTONLY & uFlags) && This->cidl>0)
{
if(!(uFlags & CMF_EXPLORE))
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_OPEN, MFT_STRING, "&Select", MFS_ENABLED);
if(This->bAllValues)
{
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_OPEN, MFT_STRING, "&Open", MFS_ENABLED);
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_EXPLORE, MFT_STRING, "&Explore", MFS_ENABLED);
}
else
{
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_EXPLORE, MFT_STRING, "&Explore", MFS_ENABLED);
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_OPEN, MFT_STRING, "&Open", MFS_ENABLED);
}
SetMenuDefaultItem(hmenu, 0, MF_BYPOSITION);
_InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_COPY, MFT_STRING, "&Copy", MFS_ENABLED);
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_CUT, MFT_STRING, "&Cut", MFS_ENABLED);
_InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_DELETE, MFT_STRING, "&Delete", MFS_ENABLED);
if(uFlags & CMF_CANRENAME)
_InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_RENAME, MFT_STRING, "&Rename", ISvItemCm_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED);
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (FCIDM_SHVIEWLAST));
}
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
}
/**************************************************************************
* DoOpenExplore
*
* for folders only
*/
static void DoOpenExplore(
IContextMenu2 *iface,
HWND hwnd,
LPCSTR verb)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
UINT i, bFolderFound = FALSE;
LPITEMIDLIST pidlFQ;
SHELLEXECUTEINFOA sei;
/* Find the first item in the list that is not a value. These commands
should never be invoked if there isn't at least one folder item in the list.*/
for(i = 0; i<This->cidl; i++)
{
if(!_ILIsValue(This->apidl[i]))
{
bFolderFound = TRUE;
break;
}
}
if (!bFolderFound) return;
pidlFQ = ILCombine(This->pidl, This->apidl[i]);
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.fMask = SEE_MASK_IDLIST | SEE_MASK_CLASSNAME;
sei.lpIDList = pidlFQ;
sei.lpClass = "Folder";
sei.hwnd = hwnd;
sei.nShow = SW_SHOWNORMAL;
sei.lpVerb = verb;
ShellExecuteExA(&sei);
SHFree(pidlFQ);
}
/**************************************************************************
* DoRename
*/
static void DoRename(
IContextMenu2 *iface,
HWND hwnd)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
LPSHELLBROWSER lpSB;
LPSHELLVIEW lpSV;
TRACE("(%p)->(wnd=%p)\n",This, hwnd);
/* get the active IShellView */
if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0)))
{
if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV)))
{
TRACE("(sv=%p)\n",lpSV);
IShellView_SelectItem(lpSV, This->apidl[0],
SVSI_DESELECTOTHERS|SVSI_EDIT|SVSI_ENSUREVISIBLE|SVSI_FOCUSED|SVSI_SELECT);
IShellView_Release(lpSV);
}
}
}
/**************************************************************************
* DoDelete
*
* deletes the currently selected items
*/
static void DoDelete(IContextMenu2 *iface)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
ISFHelper * psfhlp;
IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp);
if (psfhlp)
{
ISFHelper_DeleteItems(psfhlp, This->cidl, (LPCITEMIDLIST *)This->apidl);
ISFHelper_Release(psfhlp);
}
}
/**************************************************************************
* DoCopyOrCut
*
* copies the currently selected items into the clipboard
*/
static BOOL DoCopyOrCut(
IContextMenu2 *iface,
HWND hwnd,
BOOL bCut)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
LPSHELLBROWSER lpSB;
LPSHELLVIEW lpSV;
LPDATAOBJECT lpDo;
TRACE("(%p)->(wnd=%p,bCut=0x%08x)\n",This, hwnd, bCut);
/* get the active IShellView */
if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0)))
{
if (SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV)))
{
if (SUCCEEDED(IShellView_GetItemObject(lpSV, SVGIO_SELECTION, &IID_IDataObject, (LPVOID*)&lpDo)))
{
OleSetClipboard(lpDo);
IDataObject_Release(lpDo);
}
IShellView_Release(lpSV);
}
}
return TRUE;
}
/**************************************************************************
* ISvItemCm_fnInvokeCommand()
*/
static HRESULT WINAPI ISvItemCm_fnInvokeCommand(
IContextMenu2 *iface,
LPCMINVOKECOMMANDINFO lpcmi)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
if (lpcmi->cbSize != sizeof(CMINVOKECOMMANDINFO))
FIXME("Is an EX structure\n");
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
if( HIWORD(lpcmi->lpVerb)==0 && LOWORD(lpcmi->lpVerb) > FCIDM_SHVIEWLAST)
{
TRACE("Invalid Verb %x\n",LOWORD(lpcmi->lpVerb));
return E_INVALIDARG;
}
if (HIWORD(lpcmi->lpVerb) == 0)
{
switch(LOWORD(lpcmi->lpVerb))
{
case FCIDM_SHVIEW_EXPLORE:
TRACE("Verb FCIDM_SHVIEW_EXPLORE\n");
DoOpenExplore(iface, lpcmi->hwnd, "explore");
break;
case FCIDM_SHVIEW_OPEN:
TRACE("Verb FCIDM_SHVIEW_OPEN\n");
DoOpenExplore(iface, lpcmi->hwnd, "open");
break;
case FCIDM_SHVIEW_RENAME:
TRACE("Verb FCIDM_SHVIEW_RENAME\n");
DoRename(iface, lpcmi->hwnd);
break;
case FCIDM_SHVIEW_DELETE:
TRACE("Verb FCIDM_SHVIEW_DELETE\n");
DoDelete(iface);
break;
case FCIDM_SHVIEW_COPY:
TRACE("Verb FCIDM_SHVIEW_COPY\n");
DoCopyOrCut(iface, lpcmi->hwnd, FALSE);
break;
case FCIDM_SHVIEW_CUT:
TRACE("Verb FCIDM_SHVIEW_CUT\n");
DoCopyOrCut(iface, lpcmi->hwnd, TRUE);
break;
default:
FIXME("Unhandled Verb %xl\n",LOWORD(lpcmi->lpVerb));
}
}
else
{
TRACE("Verb is %s\n",debugstr_a(lpcmi->lpVerb));
if (strcmp(lpcmi->lpVerb,"delete")==0)
DoDelete(iface);
else
FIXME("Unhandled string verb %s\n",debugstr_a(lpcmi->lpVerb));
}
return NOERROR;
}
/**************************************************************************
* ISvItemCm_fnGetCommandString()
*/
static HRESULT WINAPI ISvItemCm_fnGetCommandString(
IContextMenu2 *iface,
UINT idCommand,
UINT uFlags,
UINT* lpReserved,
LPSTR lpszName,
UINT uMaxNameLen)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
switch(uFlags)
{
case GCS_HELPTEXTA:
case GCS_HELPTEXTW:
hr = E_NOTIMPL;
break;
case GCS_VERBA:
switch(idCommand)
{
case FCIDM_SHVIEW_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 FCIDM_SHVIEW_RENAME:
MultiByteToWideChar( CP_ACP, 0, "rename", -1, (LPWSTR)lpszName, uMaxNameLen );
hr = NOERROR;
break;
}
break;
case GCS_VALIDATEA:
case GCS_VALIDATEW:
hr = NOERROR;
break;
}
TRACE("-- (%p)->(name=%s)\n",This, lpszName);
return hr;
}
/**************************************************************************
* ISvItemCm_fnHandleMenuMsg()
* NOTES
* should be only in IContextMenu2 and IContextMenu3
* is nevertheless called from word95
*/
static HRESULT WINAPI ISvItemCm_fnHandleMenuMsg(
IContextMenu2 *iface,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
ItemCmImpl *This = (ItemCmImpl *)iface;
TRACE("(%p)->(msg=%x wp=%x lp=%lx)\n",This, uMsg, wParam, lParam);
return E_NOTIMPL;
}
static struct IContextMenu2Vtbl cmvt =
{
ISvItemCm_fnQueryInterface,
ISvItemCm_fnAddRef,
ISvItemCm_fnRelease,
ISvItemCm_fnQueryContextMenu,
ISvItemCm_fnInvokeCommand,
ISvItemCm_fnGetCommandString,
ISvItemCm_fnHandleMenuMsg
};

View File

@@ -0,0 +1,397 @@
/*
* Systray
*
* Copyright 1999 Kai Morich <kai.morich@bigfoot.de>
*
* Manage the systray window. That it actually appears in the docking
* area of KDE is handled in dlls/x11drv/window.c,
* X11DRV_set_wm_hints using KWM_DOCKWINDOW.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wingdi.h"
#include "winuser.h"
#include "shlobj.h"
#include "shellapi.h"
#include "shell32_main.h"
#include "commctrl.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct SystrayItem {
HWND hWnd;
HWND hWndToolTip;
NOTIFYICONDATAA notifyIcon;
struct SystrayItem *nextTrayItem;
} SystrayItem;
static SystrayItem *systray=NULL;
static int firstSystray=TRUE; /* defer creation of window class until first systray item is created */
static BOOL SYSTRAY_Delete(PNOTIFYICONDATAA pnid);
#define ICON_SIZE GetSystemMetrics(SM_CXSMICON)
/* space around icon (forces icon to center of KDE systray area) */
#define ICON_BORDER 4
static BOOL SYSTRAY_ItemIsEqual(PNOTIFYICONDATAA pnid1, PNOTIFYICONDATAA pnid2)
{
if (pnid1->hWnd != pnid2->hWnd) return FALSE;
if (pnid1->uID != pnid2->uID) return FALSE;
return TRUE;
}
static LRESULT CALLBACK SYSTRAY_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (message) {
case WM_PAINT:
{
RECT rc;
SystrayItem *ptrayItem = systray;
while (ptrayItem) {
if (ptrayItem->hWnd==hWnd) {
if (ptrayItem->notifyIcon.hIcon) {
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rc);
if (!DrawIconEx(hdc, rc.left+ICON_BORDER, rc.top+ICON_BORDER, ptrayItem->notifyIcon.hIcon,
ICON_SIZE, ICON_SIZE, 0, 0, DI_DEFAULTSIZE|DI_NORMAL)) {
ERR("Paint(SystrayWindow %p) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
SYSTRAY_Delete(&ptrayItem->notifyIcon);
}
}
break;
}
ptrayItem = ptrayItem->nextTrayItem;
}
EndPaint(hWnd, &ps);
}
break;
case WM_MOUSEMOVE:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
{
MSG msg;
SystrayItem *ptrayItem = systray;
while ( ptrayItem ) {
if (ptrayItem->hWnd == hWnd) {
msg.hwnd=hWnd;
msg.message=message;
msg.wParam=wParam;
msg.lParam=lParam;
msg.time = GetMessageTime ();
msg.pt.x = LOWORD(GetMessagePos ());
msg.pt.y = HIWORD(GetMessagePos ());
SendMessageA(ptrayItem->hWndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
}
ptrayItem = ptrayItem->nextTrayItem;
}
}
/* fall through */
case WM_LBUTTONDBLCLK:
case WM_RBUTTONDBLCLK:
case WM_MBUTTONDBLCLK:
{
SystrayItem *ptrayItem = systray;
while (ptrayItem) {
if (ptrayItem->hWnd == hWnd) {
if (ptrayItem->notifyIcon.hWnd && ptrayItem->notifyIcon.uCallbackMessage) {
if (!PostMessageA(ptrayItem->notifyIcon.hWnd, ptrayItem->notifyIcon.uCallbackMessage,
(WPARAM)ptrayItem->notifyIcon.uID, (LPARAM)message)) {
ERR("PostMessage(SystrayWindow %p) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
SYSTRAY_Delete(&ptrayItem->notifyIcon);
}
}
break;
}
ptrayItem = ptrayItem->nextTrayItem;
}
}
break;
default:
return (DefWindowProcA(hWnd, message, wParam, lParam));
}
return (0);
}
BOOL SYSTRAY_RegisterClass(void)
{
WNDCLASSA wc;
wc.style = CS_SAVEBITS|CS_DBLCLKS;
wc.lpfnWndProc = (WNDPROC)SYSTRAY_WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = 0;
wc.hIcon = 0;
wc.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "WineSystray";
if (!RegisterClassA(&wc)) {
ERR("RegisterClass(WineSystray) failed\n");
return FALSE;
}
return TRUE;
}
BOOL SYSTRAY_ItemInit(SystrayItem *ptrayItem)
{
RECT rect;
/* Register the class if this is our first tray item. */
if ( firstSystray ) {
firstSystray = FALSE;
if ( !SYSTRAY_RegisterClass() ) {
ERR( "RegisterClass(WineSystray) failed\n" );
return FALSE;
}
}
/* Initialize the window size. */
rect.left = 0;
rect.top = 0;
rect.right = ICON_SIZE+2*ICON_BORDER;
rect.bottom = ICON_SIZE+2*ICON_BORDER;
ZeroMemory( ptrayItem, sizeof(SystrayItem) );
/* Create tray window for icon. */
ptrayItem->hWnd = CreateWindowExA( WS_EX_TRAYWINDOW,
"WineSystray", "Wine-Systray",
WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,
rect.right-rect.left, rect.bottom-rect.top,
0, 0, 0, 0 );
if ( !ptrayItem->hWnd ) {
ERR( "CreateWindow(WineSystray) failed\n" );
return FALSE;
}
/* Create tooltip for icon. */
ptrayItem->hWndToolTip = CreateWindowA( TOOLTIPS_CLASSA,NULL,TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
ptrayItem->hWnd, 0, 0, 0 );
if ( !ptrayItem->hWndToolTip ) {
ERR( "CreateWindow(TOOLTIP) failed\n" );
return FALSE;
}
return TRUE;
}
static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem)
{
if(ptrayItem->notifyIcon.hIcon)
DestroyIcon(ptrayItem->notifyIcon.hIcon);
if(ptrayItem->hWndToolTip)
DestroyWindow(ptrayItem->hWndToolTip);
if(ptrayItem->hWnd)
DestroyWindow(ptrayItem->hWnd);
return;
}
void SYSTRAY_ItemSetMessage(SystrayItem *ptrayItem, UINT uCallbackMessage)
{
ptrayItem->notifyIcon.uCallbackMessage = uCallbackMessage;
}
void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon)
{
if(ptrayItem->notifyIcon.hIcon)
DestroyIcon(ptrayItem->notifyIcon.hIcon);
ptrayItem->notifyIcon.hIcon = CopyIcon(hIcon);
InvalidateRect(ptrayItem->hWnd, NULL, TRUE);
}
void SYSTRAY_ItemSetTip(SystrayItem *ptrayItem, CHAR* szTip, int modify)
{
TTTOOLINFOA ti;
strncpy(ptrayItem->notifyIcon.szTip, szTip, sizeof(ptrayItem->notifyIcon.szTip));
ptrayItem->notifyIcon.szTip[sizeof(ptrayItem->notifyIcon.szTip)-1]=0;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.uFlags = 0;
ti.hwnd = ptrayItem->hWnd;
ti.hinst = 0;
ti.uId = 0;
ti.lpszText = ptrayItem->notifyIcon.szTip;
ti.rect.left = 0;
ti.rect.top = 0;
ti.rect.right = ICON_SIZE+2*ICON_BORDER;
ti.rect.bottom = ICON_SIZE+2*ICON_BORDER;
if(modify)
SendMessageA(ptrayItem->hWndToolTip, TTM_UPDATETIPTEXTA, 0, (LPARAM)&ti);
else
SendMessageA(ptrayItem->hWndToolTip, TTM_ADDTOOLA, 0, (LPARAM)&ti);
}
static BOOL SYSTRAY_Add(PNOTIFYICONDATAA pnid)
{
SystrayItem **ptrayItem = &systray;
/* Find last element. */
while( *ptrayItem ) {
if ( SYSTRAY_ItemIsEqual(pnid, &(*ptrayItem)->notifyIcon) )
return FALSE;
ptrayItem = &((*ptrayItem)->nextTrayItem);
}
/* Allocate SystrayItem for element and add to end of list. */
(*ptrayItem) = HeapAlloc(GetProcessHeap(),0,sizeof(SystrayItem));
/* Initialize and set data for the tray element. */
SYSTRAY_ItemInit( (*ptrayItem) );
(*ptrayItem)->notifyIcon.uID = pnid->uID; /* only needed for callback message */
(*ptrayItem)->notifyIcon.hWnd = pnid->hWnd; /* only needed for callback message */
SYSTRAY_ItemSetIcon (*ptrayItem, (pnid->uFlags&NIF_ICON) ?pnid->hIcon :0);
SYSTRAY_ItemSetMessage(*ptrayItem, (pnid->uFlags&NIF_MESSAGE)?pnid->uCallbackMessage:0);
SYSTRAY_ItemSetTip (*ptrayItem, (pnid->uFlags&NIF_TIP) ?pnid->szTip :"", FALSE);
TRACE("%p: %p %s\n", (*ptrayItem), (*ptrayItem)->notifyIcon.hWnd,
(*ptrayItem)->notifyIcon.szTip);
return TRUE;
}
static BOOL SYSTRAY_Modify(PNOTIFYICONDATAA pnid)
{
SystrayItem *ptrayItem = systray;
while ( ptrayItem ) {
if ( SYSTRAY_ItemIsEqual(pnid, &ptrayItem->notifyIcon) ) {
if (pnid->uFlags & NIF_ICON)
SYSTRAY_ItemSetIcon(ptrayItem, pnid->hIcon);
if (pnid->uFlags & NIF_MESSAGE)
SYSTRAY_ItemSetMessage(ptrayItem, pnid->uCallbackMessage);
if (pnid->uFlags & NIF_TIP)
SYSTRAY_ItemSetTip(ptrayItem, pnid->szTip, TRUE);
TRACE("%p: %p %s\n", ptrayItem, ptrayItem->notifyIcon.hWnd, ptrayItem->notifyIcon.szTip);
return TRUE;
}
ptrayItem = ptrayItem->nextTrayItem;
}
return FALSE; /* not found */
}
static BOOL SYSTRAY_Delete(PNOTIFYICONDATAA pnid)
{
SystrayItem **ptrayItem = &systray;
while (*ptrayItem) {
if (SYSTRAY_ItemIsEqual(pnid, &(*ptrayItem)->notifyIcon)) {
SystrayItem *next = (*ptrayItem)->nextTrayItem;
TRACE("%p: %p %s\n", *ptrayItem, (*ptrayItem)->notifyIcon.hWnd, (*ptrayItem)->notifyIcon.szTip);
SYSTRAY_ItemTerm(*ptrayItem);
HeapFree(GetProcessHeap(),0,*ptrayItem);
*ptrayItem = next;
return TRUE;
}
ptrayItem = &((*ptrayItem)->nextTrayItem);
}
return FALSE; /* not found */
}
/*************************************************************************
*
*/
BOOL SYSTRAY_Init(void)
{
return TRUE;
}
/*************************************************************************
* Shell_NotifyIcon [SHELL32.296]
* Shell_NotifyIconA [SHELL32.297]
*/
BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
{
BOOL flag=FALSE;
TRACE("enter %p %d %ld\n", pnid->hWnd, pnid->uID, dwMessage);
switch(dwMessage) {
case NIM_ADD:
flag = SYSTRAY_Add(pnid);
break;
case NIM_MODIFY:
flag = SYSTRAY_Modify(pnid);
break;
case NIM_DELETE:
flag = SYSTRAY_Delete(pnid);
break;
}
TRACE("leave %p %d %ld=%d\n", pnid->hWnd, pnid->uID, dwMessage, flag);
return flag;
}
/*************************************************************************
* Shell_NotifyIconW [SHELL32.298]
*/
BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid )
{
BOOL ret;
PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
WideCharToMultiByte( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip), NULL, NULL );
p->szTip[sizeof(p->szTip)-1] = 0;
ret = Shell_NotifyIconA(dwMessage, p );
HeapFree(GetProcessHeap(),0,p);
return ret;
}

View File

@@ -0,0 +1,585 @@
/*
* Copyright 1999, 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_UNDOCSHELL_H
#define __WINE_UNDOCSHELL_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "commctrl.h"
#include "shlobj.h"
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
/****************************************************************************
* IDList Functions
*/
BOOL WINAPI ILGetDisplayName(
LPCITEMIDLIST pidl,
LPVOID path);
/* type parameter for ILGetDisplayNameEx() */
#define ILGDN_FORPARSING 0
#define ILGDN_NORMAL 1
#define ILGDN_INFOLDER 2
BOOL WINAPI ILGetDisplayNameEx(
LPSHELLFOLDER psf,
LPCITEMIDLIST pidl,
LPVOID path,
DWORD type);
LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath);
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
HRESULT WINAPI SHILCreateFromPathA (
LPCSTR path,
LPITEMIDLIST * ppidl,
DWORD *attributes);
HRESULT WINAPI SHILCreateFromPathW (
LPCWSTR path,
LPITEMIDLIST * ppidl,
DWORD *attributes);
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path);
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path);
/*
string functions
*/
BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
/****************************************************************************
* SHChangeNotifyRegister API
*/
#define SHCNRF_InterruptLevel 0x0001
#define SHCNRF_ShellLevel 0x0002
#define SHCNRF_RecursiveInterrupt 0x1000 /* Must be combined with SHCNRF_InterruptLevel */
#define SHCNRF_NewDelivery 0x8000 /* Messages use shared memory */
/****************************************************************************
* Shell Common Dialogs
*/
BOOL WINAPI PickIconDlg(
HWND hwndOwner,
LPSTR lpstrFile,
DWORD nMaxFile,
LPDWORD lpdwIconIndex);
/* RunFileDlg flags */
#define RFF_NOBROWSE 0x01
#define RFF_NODEFAULT 0x02
#define RFF_CALCDIRECTORY 0x04
#define RFF_NOLABEL 0x08
#define RFF_NOSEPARATEMEM 0x20 /* NT only */
/* RunFileFlg notification structure */
typedef struct
{
NMHDR hdr;
LPCSTR lpFile;
LPCSTR lpDirectory;
int nShow;
} NM_RUNFILEDLG, * LPNM_RUNFILEDLG;
/* RunFileDlg notification return values */
#define RF_OK 0x00
#define RF_CANCEL 0x01
#define RF_RETRY 0x02
void WINAPI RunFileDlg(
HWND hwndOwner,
HICON hIcon,
LPCSTR lpstrDirectory,
LPCSTR lpstrTitle,
LPCSTR lpstrDescription,
UINT uFlags);
void WINAPI ExitWindowsDialog(HWND hwndOwner);
BOOL WINAPI GetFileNameFromBrowse(
HWND hwndOwner,
LPSTR lpstrFile,
DWORD nMaxFile,
LPCSTR lpstrInitialDir,
LPCSTR lpstrDefExt,
LPCSTR lpstrFilter,
LPCSTR lpstrTitle);
BOOL WINAPI SHFindComputer(
LPCITEMIDLIST pidlRoot,
LPCITEMIDLIST pidlSavedSearch);
void WINAPI SHHandleDiskFull(HWND hwndOwner,
UINT uDrive);
int WINAPI SHOutOfMemoryMessageBox(
HWND hwndOwner,
LPCSTR lpCaption,
UINT uType);
DWORD WINAPI SHNetConnectionDialog(
HWND hwndOwner,
LPCSTR lpstrRemoteName,
DWORD dwType);
/****************************************************************************
* Memory Routines
*/
/* The Platform SDK's shlobj.h header defines similar functions with a
* leading underscore. However those are unusable because of the leading
* underscore, because they have an incorrect calling convention, and
* because these functions are not exported by name anyway.
*/
HANDLE WINAPI SHAllocShared(
LPVOID pv,
ULONG cb,
DWORD pid);
BOOL WINAPI SHFreeShared(
HANDLE hMem,
DWORD pid);
LPVOID WINAPI SHLockShared(
HANDLE hMem,
DWORD pid);
BOOL WINAPI SHUnlockShared(LPVOID pv);
/****************************************************************************
* Cabinet Window Messages
*/
#define CWM_SETPATH (WM_USER + 2)
#define CWM_WANTIDLE (WM_USER + 3)
#define CWM_GETSETCURRENTINFO (WM_USER + 4)
#define CWM_SELECTITEM (WM_USER + 5)
#define CWM_SELECTITEMSTR (WM_USER + 6)
#define CWM_GETISHELLBROWSER (WM_USER + 7)
#define CWM_TESTPATH (WM_USER + 9)
#define CWM_STATECHANGE (WM_USER + 10)
#define CWM_GETPATH (WM_USER + 12)
/* CWM_TESTPATH types */
#define CWTP_ISEQUAL 0
#define CWTP_ISCHILD 1
/* CWM_TESTPATH structure */
typedef struct
{
DWORD dwType;
ITEMIDLIST idl;
} CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
/****************************************************************************
* System Imagelist Routines
*/
int WINAPI Shell_GetCachedImageIndex(
LPCSTR lpszFileName,
UINT nIconIndex,
BOOL bSimulateDoc);
BOOL WINAPI Shell_GetImageLists(
HIMAGELIST *lphimlLarge,
HIMAGELIST *lphimlSmall);
HICON WINAPI SHGetFileIcon(
DWORD dwReserved,
LPCSTR lpszPath,
DWORD dwFileAttributes,
UINT uFlags);
BOOL WINAPI FileIconInit(BOOL bFullInit);
/****************************************************************************
* File Menu Routines
*/
/* FileMenu_Create nSelHeight constants */
#define FM_DEFAULT_SELHEIGHT -1
#define FM_FULL_SELHEIGHT 0
/* FileMenu_Create flags */
#define FMF_SMALL_ICONS 0x00
#define FMF_LARGE_ICONS 0x08
#define FMF_NO_COLUMN_BREAK 0x10
HMENU WINAPI FileMenu_Create(
COLORREF crBorderColor,
int nBorderWidth,
HBITMAP hBorderBmp,
int nSelHeight,
UINT uFlags);
void WINAPI FileMenu_Destroy(HMENU hMenu);
/* FileMenu_AppendItem constants */
#define FM_SEPARATOR (LPCSTR)1
#define FM_BLANK_ICON -1
#define FM_DEFAULT_HEIGHT 0
BOOL WINAPI FileMenu_AppendItem(
HMENU hMenu,
LPCSTR lpszText,
UINT uID,
int iIcon,
HMENU hMenuPopup,
int nItemHeight);
/* FileMenu_InsertUsingPidl flags */
#define FMF_NO_EMPTY_ITEM 0x01
#define FMF_NO_PROGRAM_GROUPS 0x04
/* FileMenu_InsertUsingPidl callback function */
typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
int WINAPI FileMenu_InsertUsingPidl(
HMENU hMenu,
UINT uID,
LPCITEMIDLIST pidl,
UINT uFlags,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback);
int WINAPI FileMenu_ReplaceUsingPidl(
HMENU hMenu,
UINT uID,
LPCITEMIDLIST pidl,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback);
void WINAPI FileMenu_Invalidate(HMENU hMenu);
HMENU WINAPI FileMenu_FindSubMenuByPidl(
HMENU hMenu,
LPCITEMIDLIST pidl);
BOOL WINAPI FileMenu_TrackPopupMenuEx(
HMENU hMenu,
UINT uFlags,
int x,
int y,
HWND hWnd,
LPTPMPARAMS lptpm);
BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
UINT uReserved,
LPCITEMIDLIST *ppidlFolder,
LPCITEMIDLIST *ppidlItem);
LRESULT WINAPI FileMenu_MeasureItem(
HWND hWnd,
LPMEASUREITEMSTRUCT lpmis);
LRESULT WINAPI FileMenu_DrawItem(
HWND hWnd,
LPDRAWITEMSTRUCT lpdis);
BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
void WINAPI FileMenu_AbortInitMenu(void);
LRESULT WINAPI FileMenu_HandleMenuChar(
HMENU hMenu,
WPARAM wParam);
BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
BOOL WINAPI FileMenu_DeleteItemByCmd(
HMENU hMenu,
UINT uID);
BOOL WINAPI FileMenu_DeleteItemByIndex(
HMENU hMenu,
UINT uPos);
BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
HMENU hMenu,
UINT uID);
BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
BOOL WINAPI FileMenu_EnableItemByCmd(
HMENU hMenu,
UINT uID,
BOOL bEnable);
DWORD WINAPI FileMenu_GetItemExtent(
HMENU hMenu,
UINT uPos);
int WINAPI FileMenu_AppendFilesForPidl(
HMENU hMenu,
LPCITEMIDLIST pidl,
BOOL bAddSeparator);
int WINAPI FileMenu_AddFilesForPidl(
HMENU hMenu,
UINT uReserved,
UINT uID,
LPCITEMIDLIST pidl,
UINT uFlags,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback);
/****************************************************************************
* Drag And Drop Routines
*/
HRESULT WINAPI SHRegisterDragDrop(
HWND hWnd,
LPDROPTARGET lpDropTarget);
HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
BOOL WINAPI DAD_DragEnter(HWND hWnd);
BOOL WINAPI DAD_SetDragImageFromListView(
HWND hWnd,
POINT pt);
BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
HRESULT WINAPI CIDLData_CreateFromIDArray(
LPCITEMIDLIST pidlFolder,
DWORD cpidlFiles,
LPCITEMIDLIST *lppidlFiles,
LPDATAOBJECT *ppdataObject);
/****************************************************************************
* Path Manipulation Routines
*/
BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
LPVOID WINAPI PathAddBackslashAW(LPVOID path);
LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2);
LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
VOID WINAPI PathQuoteSpacesAW(LPVOID path);
void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
BOOL WINAPI PathIsRootAW(LPCVOID x);
BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
BOOL WINAPI PathMakeUniqueNameAW(
LPVOID lpszBuffer,
DWORD dwBuffSize,
LPCVOID lpszShortName,
LPCVOID lpszLongName,
LPCVOID lpszPathName);
BOOL WINAPI PathYetAnotherMakeUniqueName(
LPWSTR lpszBuffer,
LPCWSTR lpszPathName,
LPCWSTR lpszShortName,
LPCWSTR lpszLongName);
BOOL WINAPI PathQualifyA(LPCSTR path);
BOOL WINAPI PathQualifyW(LPCWSTR path);
#define PathQualify WINELIB_NAME_AW(PathQualify)
BOOL WINAPI PathQualifyAW(LPCVOID path);
/* PathResolve flags */
#define PRF_CHECKEXISTANCE 0x01
#define PRF_EXECUTABLE 0x02
#define PRF_QUALIFYONPATH 0x04
#define PRF_WINDOWS31 0x08
BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
/* PathProcessCommand flags */
#define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */
#define PPCF_INCLUDEARGS 0x02
#define PPCF_NODIRECTORIES 0x10
#define PPCF_DONTRESOLVE 0x20
#define PPCF_PATHISRELATIVE 0x40
HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
DWORD dwBuffSize, DWORD dwFlags);
void WINAPI PathStripPathAW(LPVOID lpszPath);
BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs);
/****************************************************************************
* Shell Namespace Routines
*/
/* Generic structure used by several messages */
typedef struct
{
DWORD dwReserved;
DWORD dwReserved2;
LPCITEMIDLIST pidl;
LPDWORD lpdwUser;
} SFVCBINFO, * LPSFVCBINFO;
typedef const SFVCBINFO * LPCSFVCBINFO;
/* SFVCB_SELECTIONCHANGED structure */
typedef struct
{
UINT uOldState;
UINT uNewState;
LPCITEMIDLIST pidl;
LPDWORD lpdwUser;
} SFVSELECTSTATE, * LPSFVSELECTSTATE;
typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
/* SFVCB_COPYHOOKCALLBACK structure */
typedef struct
{
HWND hwnd;
UINT wFunc;
UINT wFlags;
LPCSTR pszSrcFile;
DWORD dwSrcAttribs;
LPCSTR pszDestFile;
DWORD dwDestAttribs;
} SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
/* SFVCB_GETDETAILSOF structure */
typedef struct
{
LPCITEMIDLIST pidl;
int fmt;
int cx;
STRRET lpText;
} SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
/****************************************************************************
* Misc Stuff
*/
/* SHWaitForFileToOpen flags */
#define SHWFF_ADD 0x01
#define SHWFF_REMOVE 0x02
#define SHWFF_WAIT 0x04
BOOL WINAPI SHWaitForFileToOpen(
LPCITEMIDLIST pidl,
DWORD dwFlags,
DWORD dwTimeout);
WORD WINAPI ArrangeWindows(
HWND hwndParent,
DWORD dwReserved,
LPCRECT lpRect,
WORD cKids,
CONST HWND * lpKids);
/* RegisterShellHook types */
#define RSH_DEREGISTER 0
#define RSH_REGISTER 1
#define RSH_REGISTER_PROGMAN 2
#define RSH_REGISTER_TASKMAN 3
BOOL WINAPI RegisterShellHook(
HWND hWnd,
DWORD dwType);
/* SHCreateDefClassObject callback function */
typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
LPUNKNOWN pUnkOuter,
REFIID riidObject,
LPVOID *ppvObject);
HRESULT WINAPI SHCreateDefClassObject(
REFIID riidFactory,
LPVOID *ppvFactory,
LPFNCDCOCALLBACK lpfnCallback,
LPDWORD lpdwUsage,
REFIID riidObject);
void WINAPI SHFreeUnusedLibraries();
/* SHCreateLinks flags */
#define SHCLF_PREFIXNAME 0x01
#define SHCLF_CREATEONDESKTOP 0x02
HRESULT WINAPI SHCreateLinks(
HWND hWnd,
LPCSTR lpszDir,
LPDATAOBJECT lpDataObject,
UINT uFlags,
LPITEMIDLIST *lppidlLinks);
DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len);
DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
/* policy functions */
BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif /* __WINE_UNDOCSHELL_H */

View File

@@ -0,0 +1,28 @@
/*
* Shared Resource/DllGetVersion version information
*
* Copyright (C) 2004 Robert Shearman
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define WINE_FILEVERSION_MAJOR 6
#define WINE_FILEVERSION_MINOR 0
#define WINE_FILEVERSION_BUILD 2600
#define WINE_FILEVERSION_PLATFORMID 1
/* FIXME: when libs/wpp gets fixed to support concatenation we can remove
* this and define it in version.rc */
#define WINE_FILEVERSION "6.0.2600.1"

View File

@@ -0,0 +1,27 @@
/*
* version information for shell32.dll
*
* Copyright (C) 2003 John K. Hohm
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "version.h"
#define WINE_OLESELFREGISTER
#define WINE_FILEVERSION WINE_FILEVERSION_MAJOR,WINE_FILEVERSION_MINOR,WINE_FILEVERSION_BUILD,WINE_FILEVERSION_PLATFORMID
#define WINE_FILENAME_STR "shell32.dll"
#include <wine/wine_common_ver.rc>

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2001 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define WINE_FILEDESCRIPTION_STR "Wine core dll"
#define WINE_FILENAME_STR "shell.dll"
#define WINE_FILEVERSION 4,0,0,0
#define WINE_FILEVERSION_STR "4.0"
#include "wine/wine_common_ver.rc"