Compare commits

...

20 Commits

Author SHA1 Message Date
Martin Fuchs
73e32edc1a lean explorer branch: merge changes of audited repository
------------------------------------------------------------------------
r52 | martinf | 2006-01-30 20:45:40 +0100 (Mo, 30 Jan 2006) | 1 line

Copy Explorer from trunk into lean-explorer branch
------------------------------------------------------------------------
r42 | martinf | 2006-01-30 09:00:18 +0100 (Mo, 30 Jan 2006) | 1 line

set svn:eol-style for Makefiles
------------------------------------------------------------------------
r37 | martinf | 2006-01-29 20:03:05 +0100 (So, 29 Jan 2006) | 1 line

set svn:eolstyle in *.rbuild files
------------------------------------------------------------------------
r36 | martinf | 2006-01-29 16:59:25 +0100 (So, 29 Jan 2006) | 1 line

Explorer: fix Rebar resizing
------------------------------------------------------------------------
r35 | martinf | 2006-01-29 16:28:15 +0100 (So, 29 Jan 2006) | 1 line

explorer: add icon cache mapped by shell paths (PIDLs) to fix GDI handle leaks

svn path=/branches/lean-explorer/; revision=21180
2006-02-21 21:31:12 +00:00
Martin Fuchs
430c117321 eliminate GCC warning about initialization order
svn path=/branches/lean-explorer/; revision=20518
2006-01-01 15:48:03 +00:00
Martin Fuchs
2750367ffd lean explorer: select initial folder in shell namespace
svn path=/branches/lean-explorer/; revision=20513
2006-01-01 14:32:17 +00:00
Martin Fuchs
d1d569ee84 lean explorer: correctly handle path of command line argument in explore mode
svn path=/branches/lean-explorer/; revision=20490
2005-12-31 18:36:39 +00:00
Martin Fuchs
1a3b862c88 flatten Entry/ShellEntry class hierarchy
svn path=/branches/lean-explorer/; revision=20486
2005-12-31 15:54:25 +00:00
Martin Fuchs
ff800b125a lean explorer: remove unused attributes
svn path=/branches/lean-explorer/; revision=20483
2005-12-31 14:33:58 +00:00
Martin Fuchs
6f6ab56356 lean explorer: remove WINFS
svn path=/branches/lean-explorer/; revision=20482
2005-12-31 14:24:43 +00:00
Martin Fuchs
3a70094172 lean explorer:
- simplfy SCAN flags
- disable WINFS in favor to code size using only shell namespace

svn path=/branches/lean-explorer/; revision=20481
2005-12-31 13:37:09 +00:00
Martin Fuchs
2ddb4f28a9 lean explorer:
- correct folder display when using the "/e" command line option
- handle owner draw menu messages in folder pane

svn path=/branches/lean-explorer/; revision=20479
2005-12-31 11:22:44 +00:00
Martin Fuchs
4ea455d560 lean explorer: get and use the parent folder to display correct context menu in all cases
svn path=/branches/lean-explorer/; revision=20406
2005-12-28 22:45:04 +00:00
Martin Fuchs
e3d8ced285 lean explorer:
- merge a few bug fixes from trunk
- display icon overlays in Explorer tree view

svn path=/branches/lean-explorer/; revision=20399
2005-12-28 17:37:37 +00:00
Martin Fuchs
0dc540f4b0 correct command line handling in lean explorer
svn path=/branches/lean-explorer/; revision=20391
2005-12-28 12:27:25 +00:00
Martin Fuchs
faaf2c4f88 fix crash because of NULL command line pointer
svn path=/branches/lean-explorer/; revision=18377
2005-10-09 15:12:01 +00:00
Martin Fuchs
f9d49e97b7 merge command line parser code from trunk into lean-explorer branch
svn path=/branches/lean-explorer/; revision=18346
2005-10-08 17:25:32 +00:00
Martin Fuchs
9dcd94a97a set svn:eol-style of *.dsp/dsw to CRLF
svn path=/branches/lean-explorer/; revision=16988
2005-08-03 05:15:48 +00:00
Martin Fuchs
e6a7596e42 small optimization for the last change
svn path=/branches/lean-explorer/; revision=14956
2005-05-03 09:21:42 +00:00
Martin Fuchs
951f673442 display custom folders in start menu root
svn path=/branches/lean-explorer/; revision=14953
2005-05-03 08:01:18 +00:00
Martin Fuchs
2ded3c5128 context menu interface pointer cleanup
svn path=/branches/lean-explorer/; revision=14952
2005-05-03 08:00:23 +00:00
Martin Fuchs
93eb45cc63 merge mixed case startup menu folders
svn path=/branches/lean-explorer/; revision=14937
2005-05-01 22:26:55 +00:00
Martin Fuchs
de183a0a1f some cleanups in the lean explorer code
svn path=/branches/lean-explorer/; revision=14930
2005-05-01 21:12:50 +00:00
47 changed files with 3691 additions and 2737 deletions

View File

@@ -1,22 +0,0 @@
*.coff
*.exe
*.d
*.o
*.sym
*.map
bin
Debug
Release
DRelease
UDebug
URelease
_NO_COMUTIL
doxy-doc
*.ncb
*.opt
*.aps
*.ncb
*.plg
*.suo
buildno.h
*.gch

View File

@@ -1,7 +1,7 @@
#
# ReactOS lean shell
#
# Make-rosshell.MinGW
# Make-rosshell-MinGW
#
# MinGW Makefile with precompiled header support
#
@@ -53,7 +53,6 @@ OBJECTS = \
shellbrowserimpl.o \
explorer.o \
entries.o \
winfs.o \
shellfs.o \
desktop.o \
desktopbar.o \

View File

@@ -78,7 +78,6 @@ OBJECTS = \
shellbrowserimpl.o \
explorer.o \
entries.o \
winfs.o \
shellfs.o \
desktop.o \
desktopbar.o \

View File

@@ -78,7 +78,6 @@ OBJECTS = \
shellbrowserimpl.o \
explorer.o \
entries.o \
winfs.o \
shellfs.o \
mainframe.o \
shellbrowser.o \

View File

@@ -1,7 +1,7 @@
#
# ReactOS lean explorer
#
# Makefile.MinGW
# Makefile-MinGW
#
CC = gcc
@@ -52,7 +52,6 @@ OBJECTS = \
shellbrowserimpl.o \
explorer.o \
entries.o \
winfs.o \
shellfs.o \
mainframe.o \
shellbrowser.o \

View File

@@ -0,0 +1,400 @@
TOPSRCDIR = ../..
TOPOBJDIR = ../..
SRCDIR = .
MODULE = explorer.exe
APPMODE = gui
IMPORTS = shell32 comctl32 msimg32 ole32 user32 gdi32 kernel32 advapi32 oleaut32
EXTRADEFS = -D__WINE__ -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -D__MINGW32__ -DCINTERFACE
EXTRA_OBJS = notifyhook.dll libexpat.dll
EXTRALIBS = $(LIBUUID)
C_SRCS = \
services/startup.c \
utility/splitpath.c
CPP_SRCS = \
explorer.cpp \
desktop/desktop.cpp \
utility/shellclasses.cpp \
utility/utility.cpp \
utility/window.cpp \
utility/dragdropimpl.cpp \
utility/shellbrowserimpl.cpp \
utility/xmlstorage.cpp \
shell/entries.cpp \
shell/winfs.cpp \
shell/unixfs.cpp \
shell/shellfs.cpp \
shell/mainframe.cpp \
shell/filechild.cpp \
shell/pane.cpp \
shell/shellbrowser.cpp \
shell/ntobjfs.cpp \
shell/regfs.cpp \
shell/fatfs.cpp \
shell/webchild.cpp \
services/shellservices.cpp \
taskbar/desktopbar.cpp \
taskbar/taskbar.cpp \
taskbar/startmenu.cpp \
taskbar/traynotify.cpp \
taskbar/quicklaunch.cpp \
taskbar/favorites.cpp \
dialogs/searchprogram.cpp \
dialogs/settings.cpp
RC_SRCS = explorer_intres.rc
EXTRARCFLAGS = -D__WRC__ -D_WIN32
# Global rules for building a Winelib program -*-Makefile-*-
#
# Each individual makefile should define the following variables:
# MODULE : name of the main module being built
# APPMODE : program mode (cui,gui,cuiw,guiw)
# EXTRALIBS : extra libraries to link in (optional)
# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
#
# plus all variables required by the global Make.rules.in
#
DEFS = -D_REENTRANT -fPIC $(EXTRADEFS)
LDDLLFLAGS = -Wl,-Bsymbolic,-z,defs
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
BASEMODULE = $(MODULE:.exe=)
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR) $(PLTESTPROGRAM:%=-p %)
# Global rules shared by all makefiles -*-Makefile-*-
#
# Each individual makefile must define the following variables:
# TOPSRCDIR : top-level source directory
# TOPOBJDIR : top-level object directory
# SRCDIR : source directory for this module
# MODULE : name of the module being built
#
# Each individual makefile may define the following additional variables:
# C_SRCS : C sources for the module
# CPP_SRCS : C++ sources for the module
# C_SRCS16 : 16-bit C sources for the module
# RC_SRCS : resource source files
# EXTRA_SRCS : extra source files for make depend
# EXTRA_OBJS : extra object files
# IMPORTS : dlls to import
# DELAYIMPORTS : dlls to import in delayed mode
# SUBDIRS : subdirectories that contain a Makefile
# EXTRASUBDIRS : subdirectories that do not contain a Makefile
# INSTALLSUBDIRS : subdirectories to run make install/uninstall into
# First some useful definitions
SHELL = /bin/sh
CC = gcc
CXX = g++
CPP = gcc -E
#CFLAGS = -g -O2
CFLAGS = -g
CPPFLAGS =
LIBS = -lm -lstdc++
YACC = bison -y
LEX = flex
LEXLIB = -lfl
EXEEXT =
OBJEXT = o
LIBEXT = so
DLLEXT = .so
IMPLIBEXT = def
LDSHARED = $(CC) -shared $(SONAME:%=-Wl,-soname,%)
DLLTOOL = false
DLLWRAP =
AR = ar rc
RANLIB = ranlib
STRIP = strip
WINDRES = mingw32-windres
LN = ln
LN_S = ln -s
TOOLSDIR = $(TOPOBJDIR)
AS = as
LD = ld
LDFLAGS =
LDCOMBINE = $(LD) -r
RM = rm -f
MV = mv
LINT =
LINTFLAGS =
INCLUDES = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
EXTRACFLAGS = -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith
ALLCFLAGS = $(INCLUDES) $(DEFS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS)
ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
WINEWRAPPER = $(TOPSRCDIR)/tools/winewrapper
C2MAN = $(TOPSRCDIR)/tools/c2man.pl
RUNTEST = $(TOPSRCDIR)/tools/runtest
WINEBUILD = $(TOOLSDIR)/tools/winebuild/winebuild
MAKEDEP = $(TOOLSDIR)/tools/makedep
WRC = $(TOOLSDIR)/tools/wrc/wrc
WMC = $(TOOLSDIR)/tools/wmc/wmc
WIDL = $(TOOLSDIR)/tools/widl/widl
RC = $(WRC)
RC16 = $(WRC)
RCFLAGS = --nostdinc $(INCLUDES) $(EXTRARCFLAGS)
RC16FLAGS = -O res16 $(RCFLAGS)
LDPATH = LD_LIBRARY_PATH="$(TOOLSDIR)/libs/unicode:$$LD_LIBRARY_PATH"
DLLDIR = $(TOPOBJDIR)/dlls
LIBDIR = $(TOPOBJDIR)/libs
LIBPORT = -L$(TOPOBJDIR)/libs/port -lwine_port
LIBUNICODE = -L$(TOPOBJDIR)/libs/unicode -lwine_unicode
LIBUUID = -L$(TOPOBJDIR)/libs/uuid -lwine_uuid
LIBWINE = -L$(TOPOBJDIR)/libs/wine -lwine
# Installation infos
INSTALL = /usr/bin/install -c $(INSTALL_FLAGS)
INSTALL_PROGRAM = ${INSTALL} $(INSTALL_PROGRAM_FLAGS)
INSTALL_SCRIPT = ${INSTALL} $(INSTALL_SCRIPT_FLAGS)
INSTALL_DATA = ${INSTALL} -m 644 $(INSTALL_DATA_FLAGS)
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
datadir = ${prefix}/share
infodir = ${prefix}/info
mandir = ${prefix}/man
sysconfdir = ${prefix}/etc
includedir = ${prefix}/include/wine
dlldir = ${exec_prefix}/lib/wine
prog_manext = 1
api_manext = 3w
conf_manext = 5
CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.spec.c *.spec.def *.dbg.c y.tab.c y.tab.h lex.yy.c core */*.o
OBJS = $(C_SRCS:.c=.o) $(CPP_SRCS:.cpp=.o) $(EXTRA_OBJS)
RCOBJS = $(RC_SRCS:.rc=.res.o)
LINTS = $(C_SRCS:.c=.ln) $(CPP_SRCS:.cpp=.ln)
# Implicit rules
.SUFFIXES: .mc .rc .mc.rc .res .res.o .coff .spec .spec.c .spec.def .ok
.c.o:
$(CC) -c $(ALLCFLAGS) -o $@ $<
.cpp.o:
$(CXX) -c $(ALLCFLAGS) -o $@ $<
.s.o:
$(AS) -o $@ $<
.mc.mc.rc:
$(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
.rc.res:
$(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
.res.res.o:
$(WINDRES) -i $< -o $@
.rc.coff:
$(WINDRES) -i $< -o $@
.spec.spec.c:
$(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --spec $<
.spec.spec.def:
$(WINEBUILD) $(DEFS) -o $@ --def $<
.c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
.c.ok:
$(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
# 'all' target first in case the enclosing Makefile didn't define any target
all: Makefile
filter:
@$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
.PHONY: all filter
# Rule for main module debug channels
$(MODULE).dbg.c: $(C_SRCS) $(CPP_SRCS) $(C_SRCS16) $(WINEBUILD)
$(WINEBUILD) $(DEFS) -o $@ --debug -C$(SRCDIR) $(C_SRCS) $(CPP_SRCS) $(C_SRCS16)
# Rule to rebuild the tools
$(MAKEDEP):
cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
# Rules for makefile
Makefile: Makefile.in $(TOPSRCDIR)/configure
@echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
@exit 1
# Rule for linting
$(MODULE).ln : $(LINTS)
if test "$(LINTS)" ; \
then \
$(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
$(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
else \
$(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
fi
lint:: $(MODULE).ln
# Rules for Windows API checking
winapi_check:: dummy
$(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
.PHONY: winapi_check
# Rules for dependencies
$(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
cd `dirname $@` && $(MAKE) depend
depend: $(MAKEDEP) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) $(INCLUDES) -C$(SRCDIR) $(C_SRCS) $(CPP_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
.PHONY: depend $(SUBDIRS:%=%/__depend__)
# Rules for cleaning
$(SUBDIRS:%=%/__clean__): dummy
cd `dirname $@` && $(MAKE) clean
$(SUBDIRS:%=%/__testclean__): dummy
cd `dirname $@` && $(MAKE) testclean
$(EXTRASUBDIRS:%=%/__clean__): dummy
-cd `dirname $@` && $(RM) $(CLEAN_FILES)
testclean:: $(SUBDIRS:%=%/__testclean__)
clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
$(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
.PHONY: clean testclean $(SUBDIRS:%=%/__clean__) $(SUBDIRS:%=%/__testclean__) $(EXTRASUBDIRS:%=%/__clean__)
# Rules for installing
$(SUBDIRS:%=%/__install__): dummy
cd `dirname $@` && $(MAKE) install
$(SUBDIRS:%=%/__install-lib__): dummy
cd `dirname $@` && $(MAKE) install-lib
$(SUBDIRS:%=%/__install-dev__): dummy
cd `dirname $@` && $(MAKE) install-dev
$(SUBDIRS:%=%/__uninstall__): dummy
cd `dirname $@` && $(MAKE) uninstall
install:: $(INSTALLSUBDIRS:%=%/__install__)
uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
.PHONY: install install-lib install-dev uninstall \
$(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
$(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
# Rules for checking that no imports are missing
$(SUBDIRS:%=%/__checklink__): dummy
@cd `dirname $@` && $(MAKE) checklink
.PHONY: checklink $(SUBDIRS:%=%/__checklink__)
# Rules for testing
$(SUBDIRS:%=%/__test__): dummy
@cd `dirname $@` && $(MAKE) test
$(SUBDIRS:%=%/__crosstest__): dummy
@cd `dirname $@` && $(MAKE) crosstest
.PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
# Misc. rules
$(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC)
$(MC_SRCS:.mc=.mc.rc): $(WMC)
$(IDL_SRCS:.idl=.h): $(WIDL)
$(SUBDIRS): dummy
@cd $@ && $(MAKE)
dummy:
.PHONY: dummy $(SUBDIRS)
# End of global rules
all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
# Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD)
$(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) $(APPMODE:%=--exe-mode %) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
# Rules for .so main module
$(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc
$(BASEMODULE): $(WINEWRAPPER)
$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
# Rules for .exe main module
$(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
$(CC) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for testing
check test:: $(SUBDIRS:%=%/__test__)
$(TESTRESULTS): $(MODULE)$(DLLEXT)
# Rules for installation
.PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
install_prog.so: $(MODULE).so dummy
$(MKINSTALLDIRS) $(dlldir)
$(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
install_prog: $(MODULE) dummy
$(MKINSTALLDIRS) $(bindir)
$(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
uninstall_prog.so: dummy
$(RM) $(dlldir)/$(MODULE).so
uninstall_prog: dummy
$(RM) $(bindir)/$(MODULE)
install:: install_prog$(DLLEXT)
uninstall:: uninstall_prog$(DLLEXT)
clean::
$(RM) $(BASEMODULE) $(MODULE)
### Dependencies:

View File

@@ -1,7 +1,7 @@
#
# ReactOS lean explorer
#
# Makefile.PCH
# Makefile-precomp
#
# MinGW Makefile with precompiled header support
#
@@ -53,7 +53,6 @@ OBJECTS = \
shellbrowserimpl.o \
explorer.o \
entries.o \
winfs.o \
shellfs.o \
mainframe.o \
shellbrowser.o \

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -31,7 +31,7 @@
#include "../taskbar/desktopbar.h"
#include "../taskbar/taskbar.h" // for PM_GET_LAST_ACTIVE
#include "../explorer_intres.h"
#include "../resource.h"
static BOOL (WINAPI*SetShellWindow)(HWND);
@@ -547,7 +547,8 @@ HRESULT DesktopShellView::DoDesktopContextMenu(int x, int y)
hr = pcm->InvokeCommand(&cmi);
}
}
} else
_cm_ifs.reset();
}
pcm->Release();

View File

@@ -30,7 +30,7 @@
#include "precomp.h"
#include "../explorer_intres.h"
#include "../resource.h"
#include "settings.h"

View File

@@ -0,0 +1,244 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUT_EXPLORER DIALOG DISCARDABLE 0, 0, 196, 109
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ReactOS Explorer"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "ReactOS Explorer",IDC_ROS_EXPLORER,91,29,90,11
LTEXT "V 0.9",IDC_VERSION_TXT,91,43,98,8
LTEXT "(c) 2003-2006 Martin Fuchs",IDC_STATIC,91,58,79,8
LTEXT "http://www.sky.franken.de/explorer/",IDC_WWW,21,84,104,
8
CONTROL "&OK",IDOK,"Button",BS_OWNERDRAW | BS_FLAT | WS_GROUP,
151,90,38,12
END
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Execute"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
CONTROL "&Command:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
18,60,10
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "As &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
45,71,12
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "&Cancel",2,158,23,47,14
PUSHBUTTON "&Help",254,158,43,47,14
END
IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 194
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Desktop Properties"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Display &Version Number",ID_DESKTOP_VERSION,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10
END
IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 194
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Taskbar Properties"
FONT 8, "MS Sans Serif"
BEGIN
END
IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 194
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Startmenu Properties"
FONT 8, "MS Sans Serif"
BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "Create Shortcut", ID_FILE_CREATESHORTCUT
, GRAYED
MENUITEM "Delete", ID_FILE_DELETE, GRAYED
MENUITEM "Rename", ID_FILE_RENAME, GRAYED
MENUITEM "Properties", ID_FILE_PROPERTIES, GRAYED
MENUITEM SEPARATOR
MENUITEM "Close", ID_FILE_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "Undo", ID_EDIT_UNDO, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Cut", ID_EDIT_CUt, GRAYED
MENUITEM "&Copy", ID_EDIT_COPY, GRAYED
MENUITEM "&Paste", ID_EDIT_PASTE, GRAYED
MENUITEM "&Paste Shortcut", ID_EDIT_PASTE_SHORTCUT
, GRAYED
MENUITEM SEPARATOR
MENUITEM "Copy to Folder", ID_EDIT_COPY_FOLDER, GRAYED
MENUITEM "Move to Folder", ID_EDIT_MOVE_TO_FOLDER
, GRAYED
MENUITEM SEPARATOR
MENUITEM "Select All", ID_EDIT_SELECT_ALL, GRAYED
MENUITEM "Invert Selection", ID_EDIT_INVERT_SELECTION
, GRAYED
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
END
POPUP "&Window"
BEGIN
MENUITEM "New &Window", ID_WINDOW_NEW
MENUITEM "&Refresh\tF5", ID_REFRESH
END
POPUP "&Tools"
BEGIN
MENUITEM "Map Network Drive", ID_TOOLS_MAP, GRAYED
MENUITEM "Disconnect Network Drive...", ID_TOOLS_DISCONNECT, GRAYED
MENUITEM SEPARATOR
MENUITEM "Folder Options...", ID_TOOLS_OPTIONS, GRAYED
END
POPUP "&Help"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
IDM_DESKTOPBAR MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "&Settings...", ID_DESKTOPBAR_SETTINGS
MENUITEM "&Task Manager...", ID_TASKMGR
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE MOVEABLE PURE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE MOVEABLE PURE
BEGIN
"#include <windows.h>\r\n"
"\0"
END
3 TEXTINCLUDE MOVEABLE PURE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "Reactos Explorer"
IDS_START "Start"
IDS_LOGOFF "Log Off..."
IDS_SHUTDOWN "Turn Off..."
IDS_LAUNCH "Run..."
IDS_START_HELP "Help"
IDS_SEARCH_FILES "Search..."
IDS_DOCUMENTS "Documents"
IDS_FAVORITES "Favorites"
IDS_PROGRAMS "Programs"
IDS_SETTINGS "Settings"
IDS_EXPLORE "Explore"
IDS_EMPTY "(Empty)"
IDS_RECENT "Recent Documents"
IDS_ADMIN "Administration"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
IDS_TERMINATE "Terminate ROS Explorer"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "Network"
IDS_CONNECTIONS "Network Connections"
IDS_DRIVES "Drives"
IDS_SEARCH_COMPUTER "Search Computer..."
IDS_CONTROL_PANEL "Control Panel"
IDS_PRINTERS "Printers"
IDS_ALL_USERS "All Users\\"
IDS_SEARCH "Search"
IDS_ABOUT_EXPLORER "&About Explorer..."
IDS_LAUNCH_MANY_PROGRAMS
"You have selected more than one program.\nAre you sure you want to launch all of them?"
IDS_DESKTOPBAR_SETTINGS "Desktop Settings"
IDS_DESKTOP "Desktop"
IDS_TASKBAR "Taskbar"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,190 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Japanese (JA) resources
//
// =Memo for future Japanese maintainer=
// For future ease of maintenance, I marked "FIXME?" on strings I suspect I have
// mistranslated or I haven't translated. Others are set as is in
// purpose. BTW, I feel it strange that the word;"directory" turns into "folder" for
// Japanese Windows(..or English Windows also use "folder" instead of "directory"? I
// have no idea). I obeyed as the MS do. Also, there might be some menus which have
// different shortcut keys between EN-Win and JA-Win but I dunno which ones are =D
// Despite I'm not sure that we can use "MS UI Gothic" under ROS, I changed "MS Sans
// Serif" to "MS UI Gothic" because it's lear that MS Sans Serif doesn't suit for
// the Japanese(most of you know this, I suppose).
// - M.T
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JAP)
#ifdef _WIN32
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
#pragma code_page(932)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "<22>t<EFBFBD>@<40>C<EFBFBD><43>(&F)"
BEGIN
MENUITEM "<22>I<EFBFBD><49>(&X)", ID_FILE_EXIT
END
POPUP "<22>\\<5C><>(&V)"
BEGIN
MENUITEM "<22>c<EFBFBD>[<5B><><EFBFBD>o<EFBFBD>[(&T)", ID_VIEW_TOOL_BAR
MENUITEM "<22>X<EFBFBD>e<EFBFBD>[<5B>^<5E>X<EFBFBD>o<EFBFBD>[(&S)", ID_VIEW_STATUSBAR
END
POPUP "<22>E<EFBFBD>B<EFBFBD><42><EFBFBD>h<EFBFBD>E(&W)"
BEGIN
MENUITEM "<22>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>E<EFBFBD>B<EFBFBD><42><EFBFBD>h<EFBFBD>E(&W)", ID_WINDOW_NEW
MENUITEM "<22>ŐV<C590>̏<EFBFBD><CC8F><EFBFBD><EFBFBD>ɍX<C98D>V(&R)\tF5", ID_REFRESH
END
POPUP "<22>w<EFBFBD><77><EFBFBD>v(&H)"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
IDM_DESKTOPBAR MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER //FIXME?
MENUITEM "&Settings...", ID_DESKTOPBAR_SETTINGS //FIXME?
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Execute"
FONT 8, "MS UI Gothic"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10 //FIXME?
CONTROL "&Command:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3, //FIXME?
18,60,10 //FIXME?
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "As &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
45,71,12 //FIXME?
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "&Cancel",2,158,23,47,14 //FIXME?
PUSHBUTTON "&Help",254,158,43,47,14 //FIXME?
END
IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 172
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "<22>f<EFBFBD>X<EFBFBD>N<EFBFBD>g<EFBFBD>b<EFBFBD>v<EFBFBD>̃v<CC83><76><EFBFBD>p<EFBFBD>e<EFBFBD>B" //FIXME?
FONT 9, "MS UI Gothic"
BEGIN
END
IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 154
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "<22>^<5E>X<EFBFBD>N<EFBFBD>o<EFBFBD>[<5B>̃v<CC83><76><EFBFBD>p<EFBFBD>e<EFBFBD>B"
FONT 9, "MS UI Gothic"
BEGIN
END
IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 154
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "<22>X<EFBFBD>^<5E>[<5B>g<EFBFBD><67><EFBFBD>j<EFBFBD><6A><EFBFBD>[<5B>̃v<CC83><76><EFBFBD>p<EFBFBD>e<EFBFBD>B"
FONT 9, "MS UI Gothic"
BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DESKBAR_DESKTOP, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 205
TOPMARGIN, 7
BOTTOMMARGIN, 165
END
IDD_DESKBAR_TASKBAR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 203
TOPMARGIN, 7
BOTTOMMARGIN, 147
END
IDD_DESKBAR_STARTMENU, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 203
TOPMARGIN, 7
BOTTOMMARGIN, 147
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "ReactOS Explorer"
IDS_START "<22><><EFBFBD><EFBFBD>"
IDS_LOGOFF "<22><><EFBFBD>O<EFBFBD>I<EFBFBD>t..."
IDS_TERMINATE "<22><><EFBFBD>O<EFBFBD>I<EFBFBD>t"
IDS_SHUTDOWN "<22>V<EFBFBD><56><EFBFBD>b<EFBFBD>g<EFBFBD>_<EFBFBD>E<EFBFBD><45>..."
IDS_LAUNCH "<22>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>w<EFBFBD><EFBFBD>Ď<EFBFBD><C48E>s..."
IDS_START_HELP "<22>w<EFBFBD><77><EFBFBD>v"
IDS_SEARCH "<22><><EFBFBD><EFBFBD>"
IDS_DOCUMENTS "<22>}<7D>C<EFBFBD>h<EFBFBD>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>g"
IDS_FAVORITES "<22><><EFBFBD>C<EFBFBD>ɓ<EFBFBD><C993><EFBFBD>"
IDS_PROGRAMS "<22>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD>"
IDS_SETTINGS "<22>ݒ<EFBFBD>"
IDS_EXPLORE "<22>G<EFBFBD>N<EFBFBD>X<EFBFBD>v<EFBFBD><76><EFBFBD>[<5B><>" //FIXME?
IDS_EMPTY "(Empty)" //FIXME?
IDS_RECENT "<22>ŋߎg<DF8E><67><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43>" //FIXME?
IDS_ADMIN "<22>Ǘ<EFBFBD><C797>c<EFBFBD>[<5B><>" //FIXME?
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "<22>l<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>[<5B>N"
IDS_CONNECTIONS "<22>l<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>[<5B>N<EFBFBD>ڑ<EFBFBD>"
IDS_DRIVES "<22><><EFBFBD>[<5B>J<EFBFBD><4A><EFBFBD>f<EFBFBD>B<EFBFBD>X<EFBFBD>N"
IDS_SEARCH_COMPUTER "<22>R<EFBFBD><52><EFBFBD>s<EFBFBD><73><EFBFBD>[<5B>^<5E>̌<EFBFBD><CC8C><EFBFBD>..."
IDS_CONTROL_PANEL "<22>R<EFBFBD><52><EFBFBD>g<EFBFBD><67><EFBFBD>[<5B><><EFBFBD>p<EFBFBD>l<EFBFBD><6C>"
IDS_PRINTERS "<22>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD>^"
IDS_SEARCH_PRG "<22>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..."
IDS_ALL_USERS "All Users\\" //FIXME?
IDS_SEARCH_FILES "<22>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>H<EFBFBD><48><EFBFBD>_..."
IDS_ABOUT_EXPLORER "&About Explorer..."
IDS_LAUNCH_MANY_PROGRAMS
"<22><><EFBFBD>ˆȏ<C288><C88F>̃v<CC83><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B\n<><6E><EFBFBD>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>?"
IDS_DESKTOPBAR_SETTINGS "<22>f<EFBFBD>X<EFBFBD>N<EFBFBD>g<EFBFBD>b<EFBFBD>v<EFBFBD>̐ݒ<CC90>"
IDS_DESKTOP "<22>f<EFBFBD>X<EFBFBD>N<EFBFBD>g<EFBFBD>b<EFBFBD>v"
IDS_TASKBAR "<22>^<5E>X<EFBFBD>N<EFBFBD>o<EFBFBD>["
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "<22>X<EFBFBD>^<5E>[<5B>g<EFBFBD><67><EFBFBD>j<EFBFBD><6A><EFBFBD>["
IDS_MINIMIZE_ALL "<22>S<EFBFBD>E<EFBFBD>B<EFBFBD><42><EFBFBD>h<EFBFBD>E<EFBFBD><45><EFBFBD>ŏ<EFBFBD><C58F><EFBFBD>"
END
#endif // Japanese (JA) resources
/////////////////////////////////////////////////////////////////////////////

View File

@@ -30,7 +30,7 @@
#include "precomp.h"
#include "explorer_intres.h"
#include "resource.h"
#include <locale.h> // for setlocale()
@@ -86,38 +86,9 @@ void _log_(LPCTSTR txt)
}
bool FileTypeManager::is_exe_file(LPCTSTR ext)
{
static const LPCTSTR s_executable_extensions[] = {
TEXT("COM"),
TEXT("EXE"),
TEXT("BAT"),
TEXT("CMD"),
TEXT("CMM"),
TEXT("BTM"),
TEXT("AWK"),
0
};
TCHAR ext_buffer[_MAX_EXT];
const LPCTSTR* p;
LPCTSTR s;
LPTSTR d;
for(s=ext+1,d=ext_buffer; (*d=toupper(*s)); s++)
++d;
for(p=s_executable_extensions; *p; p++)
if (!lstrcmp(ext_buffer, *p))
return true;
return false;
}
const FileTypeInfo& FileTypeManager::operator[](String ext)
{
_tcslwr((LPTSTR)ext.c_str());
ext.toLower();
iterator found = find(ext);
if (found != end())
@@ -128,7 +99,7 @@ const FileTypeInfo& FileTypeManager::operator[](String ext)
ftype._neverShowExt = false;
HKEY hkey;
TCHAR value[MAX_PATH], display_name[MAX_PATH];;
TCHAR value[MAX_PATH], display_name[MAX_PATH];
LONG valuelen = sizeof(value);
if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, value, &valuelen)) {
@@ -149,26 +120,20 @@ const FileTypeInfo& FileTypeManager::operator[](String ext)
return ftype;
}
LPCTSTR FileTypeManager::set_type(Entry* entry, bool dont_hide_ext)
LPCTSTR FileTypeManager::set_type(ShellEntry* entry, bool dont_hide_ext)
{
LPCTSTR ext = _tcsrchr(entry->_data.cFileName, TEXT('.'));
if (ext) {
const FileTypeInfo& type = (*this)[ext];
if (!type._displayname.empty())
entry->_type_name = _tcsdup(type._displayname);
// hide some file extensions
if (type._neverShowExt && !dont_hide_ext) {
int len = ext - entry->_data.cFileName;
entry->_display_name = (LPTSTR) malloc((len+1)*sizeof(TCHAR));
_tcsncpy(entry->_display_name, entry->_data.cFileName, len);
lstrcpyn(entry->_display_name, entry->_data.cFileName, len + 1);
entry->_display_name[len] = TEXT('\0');
}
if (is_exe_file(ext))
entry->_data.dwFileAttributes |= ATTRIBUTE_EXECUTABLE;
}
return ext;
@@ -306,7 +271,7 @@ const Icon& IconCache::extract(LPCTSTR path, int idx)
{
CachePair key(path, idx);
_tcslwr((LPTSTR)key.first.c_str());
key.first.toLower();
PathIdxMap::iterator found = _pathIdxMap.find(key);
@@ -419,8 +384,10 @@ ResBitmap::ResBitmap(UINT nid)
#ifndef ROSSHELL
void explorer_show_frame(int cmdshow, LPTSTR lpCmdLine)
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
{
ExplorerCmd cmd;
if (g_Globals._hMainWnd) {
if (IsIconic(g_Globals._hMainWnd))
ShowWindow(g_Globals._hMainWnd, SW_RESTORE);
@@ -438,36 +405,125 @@ void explorer_show_frame(int cmdshow, LPTSTR lpCmdLine)
if (hMainFrame) {
g_Globals._hMainWnd = hMainFrame;
ShowWindow(hMainFrame, cmdshow);
ShowWindow(hMainFrame, cmdShow);
UpdateWindow(hMainFrame);
bool valid_dir = false;
cmd._cmdShow = cmdShow;
if (lpCmdLine) {
DWORD attribs = GetFileAttributes(lpCmdLine);
if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY))
valid_dir = true;
else if (*lpCmdLine==':' || *lpCmdLine=='"')
valid_dir = true;
}
// parse command line options
if (lpCmdLine)
cmd.ParseCmdLine(lpCmdLine);
// Open the first child window after initializing the application
if (valid_dir)
PostMessage(hMainFrame, PM_OPEN_WINDOW, 0, (LPARAM)lpCmdLine);
else
PostMessage(hMainFrame, PM_OPEN_WINDOW, 0/*OWM_EXPLORE|OWM_DETAILS*/, 0);
if (cmd.IsValidPath()) {
// We use the static s_path variable to store the path string in order
// to avoid accessing prematurely freed memory in the PostMessage handlers.
static String s_path = cmd._path;
PostMessage(hMainFrame, PM_OPEN_WINDOW, cmd._flags, (LPARAM)(LPCTSTR)s_path);
} else
PostMessage(hMainFrame, PM_OPEN_WINDOW, cmd._flags, 0);
}
}
bool ExplorerCmd::ParseCmdLine(LPCTSTR lpCmdLine)
{
bool ok = true;
LPCTSTR b = lpCmdLine;
LPCTSTR p = b;
while(*b) {
// remove leading space
while(_istspace((unsigned)*b))
++b;
p = b;
bool quote = false;
// options are separated by ','
for(; *p; ++p) {
if (*p == '"') // Quote characters may appear at any position in the command line.
quote = !quote;
else if (*p==',' && !quote)
break;
}
if (p > b) {
int l = p - b;
// remove trailing space
while(l>0 && _istspace((unsigned)b[l-1]))
--l;
if (!EvaluateOption(String(b, l)))
ok = false;
if (*p)
++p;
b = p;
}
}
return ok;
}
bool ExplorerCmd::EvaluateOption(LPCTSTR option)
{
String opt_str;
// Remove quote characters, as they are evaluated at this point.
for(; *option; ++option)
if (*option != '"')
opt_str += *option;
option = opt_str;
if (option[0] == '/') {
++option;
// option /e for windows in explorer mode
if (!_tcsicmp(option, TEXT("e")))
_flags |= OWM_EXPLORE;
// option /root for rooted explorer windows
else if (!_tcsicmp(option, TEXT("root")))
_flags |= OWM_ROOTED;
else
return false;
} else {
if (!_path.empty())
return false;
_path = opt_str;
}
return true;
}
bool ExplorerCmd::IsValidPath() const
{
if (!_path.empty()) {
DWORD attribs = GetFileAttributes(_path);
if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY))
return true; // file system path
else if (*_path==':' && _path.at(1)==':')
return true; // text encoded IDL
}
return false;
}
#else
void explorer_show_frame(int cmdshow, LPTSTR lpCmdLine)
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
{
if (!lpCmdLine)
lpCmdLine = TEXT("explorer.exe");
launch_file(GetDesktopWindow(), lpCmdLine, cmdshow);
launch_file(GetDesktopWindow(), lpCmdLine, cmdShow);
}
#endif
@@ -567,7 +623,7 @@ static void InitInstance(HINSTANCE hInstance)
}
int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdshow)
int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
{
CONTEXT("explorer_main");
@@ -582,14 +638,14 @@ int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdshow)
}
#ifndef ROSSHELL
if (cmdshow != SW_HIDE) {
if (cmdShow != SW_HIDE) {
/* // don't maximize if being called from the ROS desktop
if (cmdshow == SW_SHOWNORMAL)
if (cmdShow == SW_SHOWNORMAL)
///@todo read window placement from registry
cmdshow = SW_MAXIMIZE;
cmdShow = SW_MAXIMIZE;
*/
explorer_show_frame(cmdshow, lpCmdLine);
explorer_show_frame(cmdShow, lpCmdLine);
}
#endif
@@ -617,7 +673,10 @@ int main(int argc, char* argv[])
LPWSTR cmdline = GetCommandLineW();
while(*cmdline && !_istspace(*cmdline))
while(*cmdline && !_istspace((unsigned)*cmdline))
++cmdline;
while(_istspace((unsigned)*cmdline))
++cmdline;
return wWinMain(GetModuleHandle(NULL), 0, cmdline, nShowCmd);
@@ -647,8 +706,19 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
BOOL startup_desktop;
// strip extended options from the front of the command line
String ext_options;
while(*lpCmdLine == '-') {
while(*lpCmdLine && !_istspace((unsigned)*lpCmdLine))
ext_options += *lpCmdLine++;
while(_istspace((unsigned)*lpCmdLine))
++lpCmdLine;
}
// command line option "-install" to replace previous shell application with ROS Explorer
if (_tcsstr(lpCmdLine,TEXT("-install"))) {
if (_tcsstr(ext_options,TEXT("-install"))) {
// install ROS Explorer into the registry
TCHAR path[MAX_PATH];
@@ -704,19 +774,21 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
#endif
// If there is given the command line option "-desktop", create desktop window anyways
if (_tcsstr(lpCmdLine,TEXT("-desktop")))
if (_tcsstr(ext_options,TEXT("-desktop")))
startup_desktop = TRUE;
#ifndef ROSSHELL
else if (_tcsstr(lpCmdLine,TEXT("-nodesktop")))
else if (_tcsstr(ext_options,TEXT("-nodesktop")))
startup_desktop = FALSE;
// Don't display cabinet window in desktop mode
if (startup_desktop && !_tcsstr(lpCmdLine,TEXT("-explorer")))
if (startup_desktop && !_tcsstr(ext_options,TEXT("-explorer")))
nShowCmd = SW_HIDE;
#endif
if (_tcsstr(lpCmdLine,TEXT("-noautostart")))
if (_tcsstr(ext_options,TEXT("-noautostart")))
autostart = false;
else if (_tcsstr(ext_options,TEXT("-autostart")))
autostart = true;
if (startup_desktop) {
// hide the XP login screen (Credit to Nicolas Escuder)
@@ -752,12 +824,6 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
}
#ifndef ROSSHELL
/**TODO fix command line handling */
if (*lpCmdLine=='"' && lpCmdLine[_tcslen(lpCmdLine)-1]=='"') {
++lpCmdLine;
lpCmdLine[_tcslen(lpCmdLine)-1] = '\0';
}
if (g_Globals._hwndDesktop)
g_Globals._desktop_mode = true;
#endif

View File

@@ -1,467 +1,455 @@
# Microsoft Developer Studio Project File - Name="explorer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=explorer - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "explorer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "explorer.mak" CFG="explorer - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "explorer - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "explorer - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "explorer - Win32 Unicode Release" (based on "Win32 (x86) Console Application")
!MESSAGE "explorer - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "explorer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O1 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /D "_NO_CONTEXT" /Yu"precomp.h" /FD /c
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /machine:I386
# SUBTRACT LINK32 /pdb:none /force
!ELSEIF "$(CFG)" == "explorer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /GZ /c
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none /force
!ELSEIF "$(CFG)" == "explorer - Win32 Unicode Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "URelease"
# PROP BASE Intermediate_Dir "URelease"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "URelease"
# PROP Intermediate_Dir "URelease"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /D "_NO_CONTEXT" /Yu"precomp.h" /FD /c
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /machine:I386
# SUBTRACT LINK32 /pdb:none /force
!ELSEIF "$(CFG)" == "explorer - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "UDebug"
# PROP BASE Intermediate_Dir "UDebug"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "UDebug"
# PROP Intermediate_Dir "UDebug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /GZ /c
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none /force
!ENDIF
# Begin Target
# Name "explorer - Win32 Release"
# Name "explorer - Win32 Debug"
# Name "explorer - Win32 Unicode Release"
# Name "explorer - Win32 Unicode Debug"
# Begin Group "utility"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\utility\dragdropimpl.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\dragdropimpl.h
# End Source File
# Begin Source File
SOURCE=.\utility\shellbrowserimpl.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\shellbrowserimpl.h
# End Source File
# Begin Source File
SOURCE=.\utility\shellclasses.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\shellclasses.h
# End Source File
# Begin Source File
SOURCE=.\utility\treedroptarget.h
# End Source File
# Begin Source File
SOURCE=.\utility\utility.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\utility.h
# End Source File
# Begin Source File
SOURCE=.\utility\window.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\window.h
# End Source File
# End Group
# Begin Group "resources"
# PROP Default_Filter "bmp,ico"
# Begin Source File
SOURCE=.\res\action.ico
# End Source File
# Begin Source File
SOURCE=.\res\appicon.ico
# End Source File
# Begin Source File
SOURCE=.\res\apps.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrow.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrow_dwn.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrow_up.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrowsel.ico
# End Source File
# Begin Source File
SOURCE=.\res\computer.ico
# End Source File
# Begin Source File
SOURCE=.\res\config.ico
# End Source File
# Begin Source File
SOURCE=.\res\documents.ico
# End Source File
# Begin Source File
SOURCE=".\explorer-jp.rc"
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\res\explorer.ico
# End Source File
# Begin Source File
SOURCE=.\explorer_intres.h
# End Source File
# Begin Source File
SOURCE=.\explorer_intres.rc
# End Source File
# Begin Source File
SOURCE=.\res\favorites.ico
# End Source File
# Begin Source File
SOURCE=.\res\floating.ico
# End Source File
# Begin Source File
SOURCE=.\res\folder.ico
# End Source File
# Begin Source File
SOURCE=.\res\images.bmp
# End Source File
# Begin Source File
SOURCE=.\res\info.ico
# End Source File
# Begin Source File
SOURCE=.\res\logoff.ico
# End Source File
# Begin Source File
SOURCE=.\res\logov.bmp
# End Source File
# Begin Source File
SOURCE=.\res\logov16.bmp
# End Source File
# Begin Source File
SOURCE=.\res\logov256.bmp
# End Source File
# Begin Source File
SOURCE=.\res\network.ico
# End Source File
# Begin Source File
SOURCE=.\res\printer.ico
# End Source File
# Begin Source File
SOURCE=.\res\reactos.ico
# End Source File
# Begin Source File
SOURCE=".\res\ros-big.ico"
# End Source File
# Begin Source File
SOURCE=".\res\search-doc.ico"
# End Source File
# Begin Source File
SOURCE=.\res\search.ico
# End Source File
# Begin Source File
SOURCE=.\res\startmenu.ico
# End Source File
# Begin Source File
SOURCE=.\res\toolbar.bmp
# End Source File
# End Group
# Begin Group "taskbar"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\taskbar\desktopbar.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\desktopbar.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\quicklaunch.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\quicklaunch.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\startmenu.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\startmenu.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\taskbar.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\taskbar.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\traynotify.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\traynotify.h
# End Source File
# End Group
# Begin Group "desktop"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\desktop\desktop.cpp
# End Source File
# Begin Source File
SOURCE=.\desktop\desktop.h
# End Source File
# End Group
# Begin Group "shell"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\shell\entries.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\entries.h
# End Source File
# Begin Source File
SOURCE=.\shell\mainframe.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\mainframe.h
# End Source File
# Begin Source File
SOURCE=.\shell\shellbrowser.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\shellbrowser.h
# End Source File
# Begin Source File
SOURCE=.\shell\shellfs.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\shellfs.h
# End Source File
# Begin Source File
SOURCE=.\shell\startup.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=.\shell\winfs.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\winfs.h
# End Source File
# End Group
# Begin Group "dialogs"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\dialogs\settings.cpp
# End Source File
# Begin Source File
SOURCE=.\dialogs\settings.h
# End Source File
# End Group
# Begin Group "main"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\explorer.cpp
# End Source File
# Begin Source File
SOURCE=.\explorer.h
# End Source File
# Begin Source File
SOURCE=.\externals.h
# End Source File
# Begin Source File
SOURCE=.\globals.h
# End Source File
# Begin Source File
SOURCE=.\precomp.cpp
# ADD CPP /Yc"precomp.h"
# End Source File
# Begin Source File
SOURCE=.\precomp.h
# End Source File
# End Group
# End Target
# End Project
# Microsoft Developer Studio Project File - Name="explorer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=explorer - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "explorer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "explorer.mak" CFG="explorer - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "explorer - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "explorer - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "explorer - Win32 Unicode Release" (based on "Win32 (x86) Console Application")
!MESSAGE "explorer - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "explorer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O1 /D "NDEBUG" /D "_NO_CONTEXT" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /Yu"precomp.h" /FD /c
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /machine:I386
# SUBTRACT LINK32 /pdb:none /force
!ELSEIF "$(CFG)" == "explorer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /GZ /c
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none /force
!ELSEIF "$(CFG)" == "explorer - Win32 Unicode Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "URelease"
# PROP BASE Intermediate_Dir "URelease"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "URelease"
# PROP Intermediate_Dir "URelease"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "_NO_CONTEXT" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /Yu"precomp.h" /FD /c
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /machine:I386
# SUBTRACT LINK32 /pdb:none /force
!ELSEIF "$(CFG)" == "explorer - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "UDebug"
# PROP BASE Intermediate_Dir "UDebug"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "UDebug"
# PROP Intermediate_Dir "UDebug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /Yu"precomp.h" /FD /GZ /c
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 shell32.lib comctl32.lib gdi32.lib user32.lib advapi32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none /force
!ENDIF
# Begin Target
# Name "explorer - Win32 Release"
# Name "explorer - Win32 Debug"
# Name "explorer - Win32 Unicode Release"
# Name "explorer - Win32 Unicode Debug"
# Begin Group "utility"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\utility\dragdropimpl.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\dragdropimpl.h
# End Source File
# Begin Source File
SOURCE=.\utility\shellbrowserimpl.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\shellbrowserimpl.h
# End Source File
# Begin Source File
SOURCE=.\utility\shellclasses.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\shellclasses.h
# End Source File
# Begin Source File
SOURCE=.\utility\treedroptarget.h
# End Source File
# Begin Source File
SOURCE=.\utility\utility.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\utility.h
# End Source File
# Begin Source File
SOURCE=.\utility\window.cpp
# End Source File
# Begin Source File
SOURCE=.\utility\window.h
# End Source File
# End Group
# Begin Group "resources"
# PROP Default_Filter "bmp,ico"
# Begin Source File
SOURCE=.\res\action.ico
# End Source File
# Begin Source File
SOURCE=.\res\appicon.ico
# End Source File
# Begin Source File
SOURCE=.\res\apps.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrow.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrow_dwn.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrow_up.ico
# End Source File
# Begin Source File
SOURCE=.\res\arrowsel.ico
# End Source File
# Begin Source File
SOURCE=.\res\computer.ico
# End Source File
# Begin Source File
SOURCE=.\res\config.ico
# End Source File
# Begin Source File
SOURCE=.\res\documents.ico
# End Source File
# Begin Source File
SOURCE=".\explorer-en.rc"
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\res\explorer.ico
# End Source File
# Begin Source File
SOURCE=.\explorer_intres.h
# End Source File
# Begin Source File
SOURCE=.\explorer_intres.rc
# End Source File
# Begin Source File
SOURCE=.\res\favorites.ico
# End Source File
# Begin Source File
SOURCE=.\res\floating.ico
# End Source File
# Begin Source File
SOURCE=.\res\folder.ico
# End Source File
# Begin Source File
SOURCE=.\res\images.bmp
# End Source File
# Begin Source File
SOURCE=.\res\info.ico
# End Source File
# Begin Source File
SOURCE=.\res\logoff.ico
# End Source File
# Begin Source File
SOURCE=.\res\logov.bmp
# End Source File
# Begin Source File
SOURCE=.\res\logov16.bmp
# End Source File
# Begin Source File
SOURCE=.\res\logov256.bmp
# End Source File
# Begin Source File
SOURCE=.\res\network.ico
# End Source File
# Begin Source File
SOURCE=.\res\printer.ico
# End Source File
# Begin Source File
SOURCE=.\res\reactos.ico
# End Source File
# Begin Source File
SOURCE=".\res\ros-big.ico"
# End Source File
# Begin Source File
SOURCE=".\res\search-doc.ico"
# End Source File
# Begin Source File
SOURCE=.\res\search.ico
# End Source File
# Begin Source File
SOURCE=.\res\startmenu.ico
# End Source File
# Begin Source File
SOURCE=.\res\toolbar.bmp
# End Source File
# End Group
# Begin Group "taskbar"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\taskbar\desktopbar.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\desktopbar.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\quicklaunch.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\quicklaunch.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\startmenu.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\startmenu.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\taskbar.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\taskbar.h
# End Source File
# Begin Source File
SOURCE=.\taskbar\traynotify.cpp
# End Source File
# Begin Source File
SOURCE=.\taskbar\traynotify.h
# End Source File
# End Group
# Begin Group "desktop"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\desktop\desktop.cpp
# End Source File
# Begin Source File
SOURCE=.\desktop\desktop.h
# End Source File
# End Group
# Begin Group "shell"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\shell\entries.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\entries.h
# End Source File
# Begin Source File
SOURCE=.\shell\mainframe.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\mainframe.h
# End Source File
# Begin Source File
SOURCE=.\shell\shellbrowser.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\shellbrowser.h
# End Source File
# Begin Source File
SOURCE=.\shell\shellfs.cpp
# End Source File
# Begin Source File
SOURCE=.\shell\startup.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# End Group
# Begin Group "dialogs"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\dialogs\settings.cpp
# End Source File
# Begin Source File
SOURCE=.\dialogs\settings.h
# End Source File
# End Group
# Begin Group "main"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\explorer.cpp
# End Source File
# Begin Source File
SOURCE=.\explorer.h
# End Source File
# Begin Source File
SOURCE=.\externals.h
# End Source File
# Begin Source File
SOURCE=.\globals.h
# End Source File
# Begin Source File
SOURCE=.\precomp.cpp
# ADD CPP /Yc"precomp.h"
# End Source File
# Begin Source File
SOURCE=.\precomp.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -1,41 +1,41 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "explorer"=.\explorer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "make_explorer"=.\make_explorer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "explorer"=.\explorer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "make_explorer"=.\make_explorer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,13 +26,15 @@
//
#define _LIGHT_STARTMENU
//#define _LAZY_ICONEXTRACT
//#define _SINGLE_ICONEXTRACT
#include "utility/shellclasses.h"
#include "shell/entries.h"
#include "shell/winfs.h"
#include "shell/shellfs.h"
#include "utility/window.h"
@@ -55,6 +57,39 @@
#include "shell/shellbrowser.h"
#ifndef ROSSHELL
/// Explorer command line parser
// for commands like "/e,/root,c:\"
// or "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}" (launch of control panel)
struct ExplorerCmd
{
ExplorerCmd()
: _flags(0),
_cmdShow(SW_SHOWNORMAL),
_valid_path(false)
{
}
ExplorerCmd(LPCTSTR url)
: _path(url),
_flags(0),
_cmdShow(SW_SHOWNORMAL),
_valid_path(true) //@@
{
}
bool ParseCmdLine(LPCTSTR lpCmdLine);
bool EvaluateOption(LPCTSTR option);
bool IsValidPath() const;
String _path;
int _flags; // OPEN_WINDOW_MODE
int _cmdShow;
bool _valid_path;
};
#include "shell/mainframe.h"
#endif

View File

@@ -0,0 +1,48 @@
<module name="explorer" type="win32gui" installname="explorer.exe" allowwarnings="true">
<linkerflag>-luuid</linkerflag>
<linkerflag>-lstdc++</linkerflag>
<linkerflag>-fexceptions</linkerflag>
<include base="explorer">.</include>
<define name="__USE_W32API" />
<define name="UNICODE" />
<define name="WIN32" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<define name="__WINDRES__" />
<library>kernel32</library>
<library>gdi32</library>
<library>user32</library>
<library>comctl32</library>
<library>ole32</library>
<library>shell32</library>
<pch>precomp.h</pch>
<directory name="desktop">
<file>desktop.cpp</file>
</directory>
<directory name="dialogs">
<file>settings.cpp</file>
</directory>
<directory name="shell">
<file>entries.cpp</file>
<file>shellfs.cpp</file>
<file>mainframe.cpp</file>
<file>shellbrowser.cpp</file>
<file>startup.c</file>
</directory>
<directory name="taskbar">
<file>desktopbar.cpp</file>
<file>taskbar.cpp</file>
<file>startmenu.cpp</file>
<file>traynotify.cpp</file>
<file>quicklaunch.cpp</file>
</directory>
<directory name="utility">
<file>shellclasses.cpp</file>
<file>utility.cpp</file>
<file>window.cpp</file>
<file>dragdropimpl.cpp</file>
<file>shellbrowserimpl.cpp</file>
</directory>
<file>explorer.cpp</file>
<file>explorer.rc</file>
</module>

View File

@@ -0,0 +1,35 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explorer", "explorer.vcproj", "{724B1B1C-4752-488D-9CC7-A0296F4C91E8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_explorer", "make_explorer.vcproj", "{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
Unicode Debug|Win32 = Unicode Debug|Win32
Unicode Release|Win32 = Unicode Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Debug|Win32.ActiveCfg = Debug|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Debug|Win32.Build.0 = Debug|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Release|Win32.ActiveCfg = Release|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Release|Win32.Build.0 = Release|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32
{724B1B1C-4752-488D-9CC7-A0296F4C91E8}.Unicode Release|Win32.Build.0 = Unicode Release|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Debug|Win32.ActiveCfg = Debug|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Release|Win32.ActiveCfg = Release|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Release|Win32.Build.0 = Release|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32
{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}.Unicode Release|Win32.Build.0 = Unicode Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
//Microsoft Developer Studio generated resource script.
//
#include "explorer_intres.h"
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@@ -12,121 +12,6 @@
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Romanian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ROM)
#ifdef _WIN32
LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT
#pragma code_page(1250)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Fi<46>ier"
BEGIN
MENUITEM "&Ie<49>ire", ID_FILE_EXIT
END
POPUP "&Prezentare"
BEGIN
MENUITEM "&Bara cu instrumente", ID_VIEW_TOOL_BAR
MENUITEM "&Bara de stare", ID_VIEW_STATUSBAR
END
POPUP "&Fereastr<74>"
BEGIN
MENUITEM "&Fereastr<74> Nou<6F>", ID_WINDOW_NEW
MENUITEM "&Resetare\tF5", ID_REFRESH
END
POPUP "&Ajutor"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&Despre Explorer...", ID_ABOUT_EXPLORER
MENUITEM "Despre &OS...", ID_ABOUT_WINDOWS
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Execute"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
CONTROL "&Comanda:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
18,60,10
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "Ca &Simbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
45,71,12
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "A&nulare",2,158,23,47,14
PUSHBUTTON "&Ajutor",254,158,43,47,14
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "ReactOS Explorer"
IDS_START "<22>ncepe"
IDS_LOGOFF "<22>nchide sesiunea ..."
IDS_SHUTDOWN "Oprire calculator ..."
IDS_LAUNCH "Pornire ..."
IDS_START_HELP "Ajutor"
IDS_SEARCH_FILES "C<>utare Files..."
IDS_DOCUMENTS "Documente"
IDS_FAVORITES "Preferin<69>e"
IDS_PROGRAMS "Programe"
IDS_SETTINGS "Set<65>ri"
IDS_EXPLORE "Explorare"
IDS_EMPTY "(Empty)"
IDS_RECENT "Documente Recente"
IDS_ADMIN "Administrare"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
IDS_TERMINATE "<22>nchide"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "Re<52>ea"
IDS_CONNECTIONS "Conec<65>ii"
IDS_DRIVES "Discuri"
IDS_SEARCH_COMPUTER "Search Computer..."
IDS_CONTROL_PANEL "Control Panel"
IDS_PRINTERS "Printers"
IDS_ALL_USERS "All Users\\"
IDS_SEARCH "C<>utare..."
IDS_ABOUT_EXPLORER "&Despre Explorer..."
IDS_LAUNCH_MANY_PROGRAMS
"You have selected more than one program.\nAre you sure you want to launch all of them?"
IDS_DESKTOPBAR_SETTINGS "Desktop Settings"
IDS_DESKTOP "Desktop"
IDS_TASKBAR "Taskbar"
END
#endif // Romanian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Neutral resources
@@ -160,84 +45,6 @@ BEGIN
VK_F5, ID_REFRESH, VIRTKEY, NOINVERT
END
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// German (Germany) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Datei"
BEGIN
MENUITEM "&Beenden", ID_FILE_EXIT
END
POPUP "&Ansicht"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
END
POPUP "&Fenster"
BEGIN
MENUITEM "Neues &Fenster", ID_WINDOW_NEW
MENUITEM "&Aktualisieren\tF5", ID_REFRESH
END
POPUP "&Help"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ausf<73>hren"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
CONTROL "Befehls&zeile:",-1,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,3,18,60,10
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "Als &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
3,45,71,12
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "A&bbrechen",2,158,23,47,14
PUSHBUTTON "&Hilfe",254,158,43,47,14
END
IDD_ABOUT_EXPLORER DIALOG DISCARDABLE 0, 0, 196, 109
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ReactOS Explorer"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "ReactOS Explorer",IDC_ROS_EXPLORER,91,29,90,11
LTEXT "V 0.9",IDC_VERSION_TXT,91,43,98,8
LTEXT "(c) 2003/2004 Martin Fuchs",IDC_STATIC,91,58,79,8
LTEXT "http://www.sky.franken.de/explorer/",IDC_WWW,21,84,104,
8
CONTROL "&OK",IDOK,"Button",BS_OWNERDRAW | BS_FLAT | WS_GROUP,
151,90,38,12
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
@@ -247,7 +54,7 @@ END
1 TEXTINCLUDE DISCARDABLE
BEGIN
"explorer_intres.h\0"
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
@@ -258,7 +65,9 @@ END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#ifndef ROSSHELL\r\n"
"IDB_TOOLBAR BITMAP DISCARDABLE ""res/toolbar.bmp""\r\n"
"#endif\r\n"
"#ifndef _ROS_\r\n"
"LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r\n"
"STRINGTABLE DISCARDABLE \r\n"
@@ -271,8 +80,6 @@ BEGIN
"#endif\r\n"
"END\r\n"
"#endif\r\n"
"\r\n"
"#include ""explorer-jp.rc""\r\n"
"\0"
END
@@ -309,491 +116,7 @@ IDI_NETWORK ICON DISCARDABLE "res/network.ico"
IDI_COMPUTER ICON DISCARDABLE "res/computer.ico"
IDI_ARROW_UP ICON DISCARDABLE "res/arrow_up.ico"
IDI_ARROW_DOWN ICON DISCARDABLE "res/arrow_dwn.ico"
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUT_EXPLORER, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 189
TOPMARGIN, 7
BOTTOMMARGIN, 102
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "Reactos Explorer"
IDS_START "Start"
IDS_LOGOFF "Abmelden..."
IDS_SHUTDOWN "Herunterfahren..."
IDS_LAUNCH "Starten..."
IDS_START_HELP "Hilfe"
IDS_SEARCH_FILES "Suche Dateien..."
IDS_DOCUMENTS "Dokumente"
IDS_FAVORITES "Bookmarks"
IDS_PROGRAMS "Programme"
IDS_SETTINGS "Einstellungen"
IDS_EXPLORE "Explore"
IDS_EMPTY "(Empty)"
IDS_RECENT "Aktuelle Dokumente"
IDS_ADMIN "Verwaltung"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "alle Fenster minimieren"
IDS_DESKTOP_NUM "Desktop %d"
IDS_TERMINATE "ROS Explorer beenden"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "Netzwerk"
IDS_CONNECTIONS "Netzwerk-Verbindungen"
IDS_DRIVES "Verzeichnisse"
IDS_SEARCH_COMPUTER "Suche Computer..."
IDS_CONTROL_PANEL "Systemsteuerung"
IDS_PRINTERS "Drucker"
IDS_ALL_USERS "Alle Benutzer\\"
IDS_SEARCH "Suche"
IDS_ABOUT_EXPLORER "&<26>ber Explorer..."
IDS_LAUNCH_MANY_PROGRAMS
"Sie haben mehrere Programme ausgew<65>hlt.\nSind Sie sicher, da<64> sie diese alle starten wollen?"
IDS_DESKTOPBAR_SETTINGS "Desktop-Einstellungen"
IDS_DESKTOP "Desktop"
IDS_TASKBAR "Taskbar"
END
#endif // German (Germany) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "Create Shortcut", ID_FILE_CREATESHORTCUT
, GRAYED
MENUITEM "Delete", ID_FILE_DELETE, GRAYED
MENUITEM "Rename", ID_FILE_RENAME, GRAYED
MENUITEM "Properties", ID_FILE_PROPERTIES, GRAYED
MENUITEM SEPARATOR
MENUITEM "Close", ID_FILE_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "Undo", ID_EDIT_UNDO, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Cut", ID_EDIT_CUt, GRAYED
MENUITEM "&Copy", ID_EDIT_COPY, GRAYED
MENUITEM "&Paste", ID_EDIT_PASTE, GRAYED
MENUITEM "&Paste Shortcut", ID_EDIT_PASTE_SHORTCUT
, GRAYED
MENUITEM SEPARATOR
MENUITEM "Copy to Folder", ID_EDIT_COPY_FOLDER, GRAYED
MENUITEM "Move to Folder", ID_EDIT_MOVE_TO_FOLDER
, GRAYED
MENUITEM SEPARATOR
MENUITEM "Select All", ID_EDIT_SELECT_ALL, GRAYED
MENUITEM "Invert Selection", ID_EDIT_INVERT_SELECTION
, GRAYED
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
END
POPUP "&Window"
BEGIN
MENUITEM "New &Window", ID_WINDOW_NEW
MENUITEM "&Refresh\tF5", ID_REFRESH
END
POPUP "&Tools"
BEGIN
MENUITEM "Map Network Drive", ID_TOOLS_MAP, GRAYED
MENUITEM "Disconnect Network Drive...", ID_TOOLS_DISCONNECT, GRAYED
MENUITEM SEPARATOR
MENUITEM "Folder Options...", ID_TOOLS_OPTIONS, GRAYED
END
POPUP "&Help"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
IDM_DESKTOPBAR MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "&Settings...", ID_DESKTOPBAR_SETTINGS
MENUITEM "&Task Manager...", ID_TASKMGR
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Execute"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
CONTROL "&Command:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
18,60,10
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "As &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
45,71,12
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "&Cancel",2,158,23,47,14
PUSHBUTTON "&Help",254,158,43,47,14
END
IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 194
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Desktop Properties"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Display &Version Number",ID_DESKTOP_VERSION,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10
END
IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 194
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Taskbar Properties"
FONT 8, "MS Sans Serif"
BEGIN
END
IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 194
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Startmenu Properties"
FONT 8, "MS Sans Serif"
BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DESKBAR_DESKTOP, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 205
TOPMARGIN, 7
BOTTOMMARGIN, 187
END
IDD_DESKBAR_TASKBAR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 203
TOPMARGIN, 7
BOTTOMMARGIN, 187
END
IDD_DESKBAR_STARTMENU, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 203
TOPMARGIN, 7
BOTTOMMARGIN, 187
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "Reactos Explorer"
IDS_START "Start"
IDS_LOGOFF "Log Off..."
IDS_SHUTDOWN "Turn Off..."
IDS_LAUNCH "Run..."
IDS_START_HELP "Help"
IDS_SEARCH_FILES "Search..."
IDS_DOCUMENTS "Documents"
IDS_FAVORITES "Favorites"
IDS_PROGRAMS "Programs"
IDS_SETTINGS "Settings"
IDS_EXPLORE "Explore"
IDS_EMPTY "(Empty)"
IDS_RECENT "Recent Documents"
IDS_ADMIN "Administration"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
IDS_TERMINATE "Terminate ROS Explorer"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "Network"
IDS_CONNECTIONS "Network Connections"
IDS_DRIVES "Drives"
IDS_SEARCH_COMPUTER "Search Computer..."
IDS_CONTROL_PANEL "Control Panel"
IDS_PRINTERS "Printers"
IDS_ALL_USERS "All Users\\"
IDS_SEARCH "Search"
IDS_ABOUT_EXPLORER "&About Explorer..."
IDS_LAUNCH_MANY_PROGRAMS
"You have selected more than one program.\nAre you sure you want to launch all of them?"
IDS_DESKTOPBAR_SETTINGS "Desktop Settings"
IDS_DESKTOP "Desktop"
IDS_TASKBAR "Taskbar"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Fichier"
BEGIN
MENUITEM "&Fermer", ID_FILE_EXIT
END
POPUP "&Affichage"
BEGIN
MENUITEM "Barre d'&outils", ID_VIEW_TOOL_BAR
MENUITEM "Barre d'&<26>tat", ID_VIEW_STATUSBAR
END
POPUP "&Window"
BEGIN
MENUITEM "New &Window", ID_WINDOW_NEW
MENUITEM "&Refresh\tF5", ID_REFRESH
END
POPUP "A&ide"
BEGIN
MENUITEM "&FAQ Explorateur...", ID_EXPLORER_FAQ
MENUITEM "A propos de l'&explorateur...", ID_ABOUT_WINDOWS
MENUITEM "A propos de l'&OS...", ID_ABOUT_EXPLORER
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Execute"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
CONTROL "&Command:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
18,60,10
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "As &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
45,71,12
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "&Cancel",2,158,23,47,14
PUSHBUTTON "&Help",254,158,43,47,14
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "Explorateur Reactos"
IDS_START "D<>marrer"
IDS_LOGOFF "D<>connexion ..."
IDS_SHUTDOWN "Arr<72>ter..."
IDS_LAUNCH "Ex<45>cuter..."
IDS_START_HELP "Aide"
IDS_SEARCH_FILES "Rechercher Fichiers..."
IDS_DOCUMENTS "Documents"
IDS_FAVORITES "Favoris"
IDS_PROGRAMS "Programmes"
IDS_SETTINGS "Param<61>tres"
IDS_EXPLORE "Explorer"
IDS_EMPTY "(Vide)"
IDS_RECENT "Documents r<>cents"
IDS_ADMIN "Administration"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Bureau %d"
IDS_TERMINATE "D<>connexion"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "R<>seaux"
IDS_CONNECTIONS "Connexions r<>seaux"
IDS_DRIVES "Disques"
IDS_SEARCH_COMPUTER "Recherche Ordinateurs..."
IDS_CONTROL_PANEL "Panneau de configuration"
IDS_PRINTERS "Imprimantes"
IDS_ALL_USERS "Tous les utilisateurs\\"
IDS_SEARCH "Rechercher"
IDS_ABOUT_EXPLORER "A propos de l'explorateur..."
IDS_LAUNCH_MANY_PROGRAMS
"You have selected more than one program.\nAre you sure you want to launch all of them?"
IDS_DESKTOPBAR_SETTINGS "Bureau"
IDS_DESKTOP "Bureau"
IDS_TASKBAR "Taskbar"
END
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Portuguese (Portugal) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTG)
#ifdef _WIN32
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Executar"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
CONTROL "Co&mando:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
18,60,10
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
CONTROL "Como &S<>mbolo",214,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,3,45,71,12
DEFPUSHBUTTON "&OK",1,158,6,47,14
PUSHBUTTON "&Cancelar",2,158,23,47,14
PUSHBUTTON "&Ajuda",254,158,43,47,14
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_TITLE "Explorador do Reactos"
IDS_START "Iniciar"
IDS_LOGOFF "Terminar sess<73>o..."
IDS_SHUTDOWN "Desligar..."
IDS_LAUNCH "Executar..."
IDS_START_HELP "Ajuda"
IDS_SEARCH_FILES "Procurar..."
IDS_DOCUMENTS "Documentos"
IDS_FAVORITES "Favoritos"
IDS_PROGRAMS "Programas"
IDS_SETTINGS "Defini<6E><69>es"
IDS_EXPLORE "Explorar"
IDS_EMPTY "(Vazio)"
IDS_RECENT "Documentos recentes"
IDS_ADMIN "Administrar"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STARTMENU "Startmenu"
IDS_MINIMIZE_ALL "mimimize all windows"
IDS_DESKTOP_NUM "Desktop %d"
IDS_TERMINATE "Terminar ROS Explorer"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_NETWORK "Rede"
IDS_CONNECTIONS "Conec<65><63>es da rede"
IDS_DRIVES "Drives"
IDS_SEARCH_COMPUTER "Procurar computador..."
IDS_CONTROL_PANEL "Painel de controle"
IDS_PRINTERS "Impressora"
IDS_ALL_USERS "Todos utilizadores\\"
IDS_SEARCH "Procurar"
IDS_ABOUT_EXPLORER "Sobre o Explorador..."
IDS_LAUNCH_MANY_PROGRAMS
"You have selected more than one program.\nAre you sure you want to launch all of them?"
IDS_DESKTOPBAR_SETTINGS "Desktop Settings"
IDS_DESKTOP "Desktop"
IDS_TASKBAR "Taskbar"
END
#endif // Portuguese (Portugal) resources
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
@@ -803,7 +126,9 @@ END
//
// Generated from the TEXTINCLUDE 3 resource.
//
#ifndef ROSSHELL
IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp"
#endif
#ifndef _ROS_
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
@@ -817,8 +142,6 @@ IDS_EXPLORER_VERSION_STR "ROS Lean Explorer Ansi"
END
#endif
#include "explorer-jp.rc"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -39,9 +39,7 @@ struct FileTypeManager : public map<String, FileTypeInfo>
const FileTypeInfo& operator[](String ext);
static bool is_exe_file(LPCTSTR ext);
LPCTSTR set_type(struct Entry* entry, bool dont_hide_ext=false);
LPCTSTR set_type(struct ShellEntry* entry, bool dont_hide_ext=false);
};

View File

@@ -1,147 +1,147 @@
# Microsoft Developer Studio Project File - Name="make_explorer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) External Target" 0x0106
CFG=make_explorer - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "make_explorer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "make_explorer.mak" CFG="make_explorer - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "make_explorer - Win32 Release" (based on "Win32 (x86) External Target")
!MESSAGE "make_explorer - Win32 Debug" (based on "Win32 (x86) External Target")
!MESSAGE "make_explorer - Win32 Unicode Debug" (based on "Win32 (x86) External Target")
!MESSAGE "make_explorer - Win32 Unicode Release" (based on "Win32 (x86) External Target")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
!IF "$(CFG)" == "make_explorer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Cmd_Line "NMAKE /f make_explorer.mak"
# PROP BASE Rebuild_Opt "/a"
# PROP BASE Target_File "make_explorer.exe"
# PROP BASE Bsc_Name "make_explorer.bsc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=0"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_explorer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Cmd_Line "NMAKE /f make_explorer.mak"
# PROP BASE Rebuild_Opt "/a"
# PROP BASE Target_File "make_explorer.exe"
# PROP BASE Bsc_Name "make_explorer.bsc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=0 DEBUG=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=0 DEBUG=1"
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "UDebug"
# PROP BASE Intermediate_Dir "UDebug"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1"
# PROP BASE Rebuild_Opt "clean all"
# PROP BASE Target_File "explorer.exe"
# PROP BASE Bsc_Name ""
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "UDebug"
# PROP Intermediate_Dir "UDebug"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "URelease"
# PROP BASE Intermediate_Dir "URelease"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1"
# PROP BASE Rebuild_Opt "clean all"
# PROP BASE Target_File "explorer.exe"
# PROP BASE Bsc_Name ""
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "URelease"
# PROP Intermediate_Dir "URelease"
# PROP Cmd_Line "make -f Makefile.MinGW UNICODE=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
!ENDIF
# Begin Target
# Name "make_explorer - Win32 Release"
# Name "make_explorer - Win32 Debug"
# Name "make_explorer - Win32 Unicode Debug"
# Name "make_explorer - Win32 Unicode Release"
!IF "$(CFG)" == "make_explorer - Win32 Release"
!ELSEIF "$(CFG)" == "make_explorer - Win32 Debug"
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Debug"
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Release"
!ENDIF
# Begin Source File
SOURCE=.\Makefile
# End Source File
# Begin Source File
SOURCE=.\Makefile.MinGW
# End Source File
# Begin Source File
SOURCE=.\Makefile.PCH
# End Source File
# End Target
# End Project
# Microsoft Developer Studio Project File - Name="make_explorer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) External Target" 0x0106
CFG=make_explorer - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "make_explorer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "make_explorer.mak" CFG="make_explorer - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "make_explorer - Win32 Release" (based on "Win32 (x86) External Target")
!MESSAGE "make_explorer - Win32 Debug" (based on "Win32 (x86) External Target")
!MESSAGE "make_explorer - Win32 Unicode Debug" (based on "Win32 (x86) External Target")
!MESSAGE "make_explorer - Win32 Unicode Release" (based on "Win32 (x86) External Target")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
!IF "$(CFG)" == "make_explorer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Cmd_Line "NMAKE /f make_explorer.mak"
# PROP BASE Rebuild_Opt "/a"
# PROP BASE Target_File "make_explorer.exe"
# PROP BASE Bsc_Name "make_explorer.bsc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=0"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_explorer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Cmd_Line "NMAKE /f make_explorer.mak"
# PROP BASE Rebuild_Opt "/a"
# PROP BASE Target_File "make_explorer.exe"
# PROP BASE Bsc_Name "make_explorer.bsc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=0 DEBUG=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=0 DEBUG=1"
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "UDebug"
# PROP BASE Intermediate_Dir "UDebug"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=1 DEBUG=1"
# PROP BASE Rebuild_Opt "clean all"
# PROP BASE Target_File "explorer.exe"
# PROP BASE Bsc_Name ""
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "UDebug"
# PROP Intermediate_Dir "UDebug"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=1 DEBUG=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "URelease"
# PROP BASE Intermediate_Dir "URelease"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=1"
# PROP BASE Rebuild_Opt "clean all"
# PROP BASE Target_File "explorer.exe"
# PROP BASE Bsc_Name ""
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "URelease"
# PROP Intermediate_Dir "URelease"
# PROP Cmd_Line "make -f Makefile-MinGW UNICODE=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
!ENDIF
# Begin Target
# Name "make_explorer - Win32 Release"
# Name "make_explorer - Win32 Debug"
# Name "make_explorer - Win32 Unicode Debug"
# Name "make_explorer - Win32 Unicode Release"
!IF "$(CFG)" == "make_explorer - Win32 Release"
!ELSEIF "$(CFG)" == "make_explorer - Win32 Debug"
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Debug"
!ELSEIF "$(CFG)" == "make_explorer - Win32 Unicode Release"
!ENDIF
# Begin Source File
SOURCE=.\Makefile
# End Source File
# Begin Source File
SOURCE=".\Makefile-MinGW"
# End Source File
# Begin Source File
SOURCE=".\Makefile-precomp"
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="make_explorer"
ProjectGUID="{2E70E02F-5DAE-453B-BE2C-C35CE8B350D5}"
RootNamespace="make_explorer"
Keyword="MakeFileProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Unicode Release|Win32"
OutputDirectory=".\URelease"
IntermediateDirectory=".\URelease"
ConfigurationType="0"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -f Makefile-MinGW UNICODE=1"
ReBuildCommandLine="make -f Makefile-MinGW UNICODE=1 clean all"
CleanCommandLine=""
Output="explorer.exe"
PreprocessorDefinitions=""
IncludeSearchPath=""
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="0"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="msdevfilt -gcc -pipe &quot;perl d:\tools\gSTLFilt.pl&quot; make -f Makefile-MinGW UNICODE=0"
ReBuildCommandLine="msdevfilt -gcc -pipe &quot;perl d:\tools\gSTLFilt.pl&quot; make -f Makefile-MinGW UNICODE=0 clean all"
CleanCommandLine=""
Output="explorer.exe"
PreprocessorDefinitions=""
IncludeSearchPath=""
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Unicode Debug|Win32"
OutputDirectory=".\UDebug"
IntermediateDirectory=".\UDebug"
ConfigurationType="0"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="msdevfilt -gcc -pipe &quot;perl d:\tools\gSTLFilt.pl&quot; make -f Makefile-MinGW UNICODE=1 DEBUG=1"
ReBuildCommandLine="msdevfilt -gcc -pipe &quot;perl d:\tools\gSTLFilt.pl&quot; make -f Makefile-MinGW UNICODE=1 DEBUG=1 clean all"
CleanCommandLine=""
Output="explorer.exe"
PreprocessorDefinitions=""
IncludeSearchPath=""
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="0"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="msdevfilt -gcc -pipe &quot;perl d:\tools\gSTLFilt.pl&quot; make -f Makefile-MinGW UNICODE=0 DEBUG=1"
ReBuildCommandLine="msdevfilt -gcc -pipe &quot;perl d:\tools\gSTLFilt.pl&quot; make -f Makefile-MinGW UNICODE=0 DEBUG=1 clean all"
CleanCommandLine=""
Output="explorer.exe"
PreprocessorDefinitions=""
IncludeSearchPath=""
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="Makefile"
>
</File>
<File
RelativePath="Makefile-MinGW"
>
</File>
<File
RelativePath="Makefile-precomp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -43,7 +43,7 @@ CFG=make_rosshell - Win32 Release
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Make-rosshell.MinGW UNICODE=0"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Make-rosshell-MinGW UNICODE=0"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
@@ -64,10 +64,10 @@ CFG=make_rosshell - Win32 Release
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Make-rosshell.MinGW UNICODE=0 DEBUG=1"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Make-rosshell-MinGW UNICODE=0 DEBUG=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=0 DEBUG=1"
# PROP Bsc_Name "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=0 DEBUG=1"
# PROP Target_Dir ""
!ELSEIF "$(CFG)" == "make_rosshell - Win32 Unicode Debug"
@@ -76,7 +76,7 @@ CFG=make_rosshell - Win32 Release
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "UDebug"
# PROP BASE Intermediate_Dir "UDebug"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1 DEBUG=1"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=1 DEBUG=1"
# PROP BASE Rebuild_Opt "clean all"
# PROP BASE Target_File "explorer.exe"
# PROP BASE Bsc_Name ""
@@ -85,7 +85,7 @@ CFG=make_rosshell - Win32 Release
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "UDebug"
# PROP Intermediate_Dir "UDebug"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Make-rosshell.MinGW UNICODE=1 DEBUG=1"
# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Make-rosshell-MinGW UNICODE=1 DEBUG=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
@@ -97,7 +97,7 @@ CFG=make_rosshell - Win32 Release
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "URelease"
# PROP BASE Intermediate_Dir "URelease"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1"
# PROP BASE Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW UNICODE=1"
# PROP BASE Rebuild_Opt "clean all"
# PROP BASE Target_File "explorer.exe"
# PROP BASE Bsc_Name ""
@@ -106,7 +106,7 @@ CFG=make_rosshell - Win32 Release
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "URelease"
# PROP Intermediate_Dir "URelease"
# PROP Cmd_Line "make -f Make-rosshell.MinGW UNICODE=1"
# PROP Cmd_Line "make -f Make-rosshell-MinGW UNICODE=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
@@ -137,7 +137,7 @@ SOURCE=".\Make-rosshell.mak"
# End Source File
# Begin Source File
SOURCE=".\Make-rosshell.MinGW"
SOURCE=".\Make-rosshell-MinGW"
# End Source File
# End Target
# End Project

View File

@@ -25,6 +25,9 @@
// Martin Fuchs, 17.05.2004
//
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1
#include "utility/utility.h"
#include "explorer.h"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -144,9 +144,9 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 165
#define _APS_NEXT_COMMAND_VALUE 40014
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_RESOURCE_VALUE 169
#define _APS_NEXT_COMMAND_VALUE 40024
#define _APS_NEXT_CONTROL_VALUE 1035
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -233,6 +233,11 @@ SOURCE=.\res\documents.ico
# End Source File
# Begin Source File
SOURCE=".\explorer-en.rc"
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\res\explorer.ico
# End Source File
# Begin Source File
@@ -297,11 +302,6 @@ SOURCE=".\res\ros-big.ico"
# End Source File
# Begin Source File
SOURCE=".\rosshell-jp.rc"
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\res\rosshell.ico
# End Source File
# Begin Source File
@@ -408,6 +408,7 @@ SOURCE=.\shell\startup.c
# Begin Source File
SOURCE=.\shell\winfs.cpp
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -30,39 +30,73 @@
// allocate and initialise a directory entry
Entry::Entry(ENTRY_TYPE etype)
: _etype(etype)
ShellEntry::ShellEntry()
{
_up = NULL;
_next = NULL;
_down = NULL;
_expanded = false;
_scanned = false;
_bhfi_valid = false;
_level = 0;
_icon_id = ICID_UNKNOWN;
_display_name = _data.cFileName;
_type_name = NULL;
_content = NULL;
}
Entry::Entry(Entry* parent, ENTRY_TYPE etype)
ShellEntry::ShellEntry(LPITEMIDLIST shell_path)
: _pidl(shell_path)
{
_up = NULL;
_next = NULL;
_down = NULL;
_expanded = false;
_scanned = false;
_level = 0;
_icon_id = ICID_UNKNOWN;
_display_name = _data.cFileName;
}
ShellEntry::ShellEntry(const ShellPath& shell_path)
: _pidl(shell_path)
{
_up = NULL;
_next = NULL;
_down = NULL;
_expanded = false;
_scanned = false;
_level = 0;
_icon_id = ICID_UNKNOWN;
_display_name = _data.cFileName;
}
ShellEntry::ShellEntry(ShellDirectory* parent, const ShellPath& shell_path)
: _up(parent),
_etype(etype)
_pidl(shell_path)
{
_next = NULL;
_down = NULL;
_expanded = false;
_scanned = false;
_bhfi_valid = false;
_level = 0;
_icon_id = ICID_UNKNOWN;
_display_name = _data.cFileName;
_type_name = NULL;
_content = NULL;
}
Entry::Entry(const Entry& other)
ShellEntry::ShellEntry(ShellDirectory* parent, LPITEMIDLIST shell_path)
: _up(parent),
_pidl(shell_path)
{
_next = NULL;
_down = NULL;
_expanded = false;
_scanned = false;
_level = 0;
_icon_id = ICID_UNKNOWN;
_display_name = _data.cFileName;
}
ShellEntry::ShellEntry(const ShellEntry& other)
: _pidl(other._pidl)
{
_next = NULL;
_down = NULL;
@@ -80,73 +114,36 @@ Entry::Entry(const Entry& other)
_shell_attribs = other._shell_attribs;
_display_name = other._display_name==other._data.cFileName? _data.cFileName: _tcsdup(other._display_name);
_type_name = other._type_name? _tcsdup(other._type_name): NULL;
_content = other._content? _tcsdup(other._content): NULL;
_etype = other._etype;
_icon_id = other._icon_id;
_bhfi = other._bhfi;
_bhfi_valid = other._bhfi_valid;
}
// free a directory entry
Entry::~Entry()
ShellEntry::~ShellEntry()
{
if (_icon_id > ICID_NONE)
g_Globals._icon_cache.free_icon(_icon_id);
if (_display_name != _data.cFileName)
free(_display_name);
if (_type_name)
free(_type_name);
if (_content)
free(_content);
}
// read directory tree and expand to the given location
Entry* Entry::read_tree(const void* path, SORT_ORDER sortOrder)
void ShellDirectory::read_directory(SORT_ORDER sortOrder, int scan_flags)
{
CONTEXT("Entry::read_tree()");
HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
Entry* entry = this;
for(const void*p=path; p && entry; ) {
entry->read_directory(sortOrder);
if (entry->_down)
entry->_expanded = true;
Entry* next_entry = entry->find_entry(p);
p = entry->get_next_path_component(p);
entry = next_entry;
}
SetCursor(old_cursor);
return entry;
}
void Entry::read_directory(SORT_ORDER sortOrder, int scan_flags)
{
CONTEXT("Entry::read_directory(SORT_ORDER)");
CONTEXT("ShellEntry::read_directory(SORT_ORDER)");
// call into subclass
read_directory(scan_flags);
#ifndef ROSSHELL
if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should not be used for reading the start menu.
for(Entry*entry=_down; entry; entry=entry->_next)
for(ShellEntry*entry=_down; entry; entry=entry->_next)
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
entry->read_directory(scan_flags);
entry->sort_directory(sortOrder);
ShellDirectory* dir = static_cast<ShellDirectory*>(entry);
dir->read_directory(scan_flags);
dir->sort_directory(sortOrder);
}
}
#endif
@@ -190,8 +187,8 @@ static int compareNothing(const void* arg1, const void* arg2)
static int compareName(const void* arg1, const void* arg2)
{
const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
const WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
const WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
int cmp = compareType(fd1, fd2);
if (cmp)
@@ -202,8 +199,8 @@ static int compareName(const void* arg1, const void* arg2)
static int compareExt(const void* arg1, const void* arg2)
{
const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
const WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
const WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
const TCHAR *name1, *name2, *ext1, *ext2;
int cmp = compareType(fd1, fd2);
@@ -235,8 +232,8 @@ static int compareExt(const void* arg1, const void* arg2)
static int compareSize(const void* arg1, const void* arg2)
{
WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
int cmp = compareType(fd1, fd2);
if (cmp)
@@ -256,8 +253,8 @@ static int compareSize(const void* arg1, const void* arg2)
static int compareDate(const void* arg1, const void* arg2)
{
WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
int cmp = compareType(fd1, fd2);
if (cmp)
@@ -276,11 +273,11 @@ static int (*sortFunctions[])(const void* arg1, const void* arg2) = {
};
void Entry::sort_directory(SORT_ORDER sortOrder)
void ShellDirectory::sort_directory(SORT_ORDER sortOrder)
{
if (sortOrder != SORT_NONE) {
Entry* entry = _down;
Entry** array, **p;
ShellEntry* entry = _down;
ShellEntry** array, **p;
int len;
len = 0;
@@ -288,7 +285,7 @@ void Entry::sort_directory(SORT_ORDER sortOrder)
++len;
if (len) {
array = (Entry**) alloca(len*sizeof(Entry*));
array = (ShellEntry**) alloca(len*sizeof(ShellEntry*));
p = array;
for(entry=_down; entry; entry=entry->_next)
@@ -308,9 +305,9 @@ void Entry::sort_directory(SORT_ORDER sortOrder)
}
void Entry::smart_scan(int scan_flags)
void ShellDirectory::smart_scan(int scan_flags)
{
CONTEXT("Entry::smart_scan()");
CONTEXT("ShellEntry::smart_scan()");
if (!_scanned) {
free_subentries();
@@ -319,13 +316,13 @@ void Entry::smart_scan(int scan_flags)
}
void Entry::extract_icon()
int ShellEntry::extract_icon()
{
TCHAR path[MAX_PATH];
ICON_ID icon_id = ICID_NONE;
if (get_path(path))
if (get_path(path, COUNTOF(path)))
icon_id = g_Globals._icon_cache.extract(path);
if (icon_id == ICID_NONE) {
@@ -384,86 +381,25 @@ void Entry::extract_icon()
}
}
_icon_id = icon_id;
return icon_id;
}
BOOL Entry::launch_entry(HWND hwnd, UINT nCmdShow)
int ShellEntry::safe_extract_icon()
{
TCHAR cmd[MAX_PATH];
try {
return extract_icon();
} catch(COMException&) {
// ignore unexpected exceptions while extracting icons
}
if (!get_path(cmd))
return FALSE;
// add path to the recent file list
SHAddToRecentDocs(SHARD_PATH, cmd);
// start program, open document...
return launch_file(hwnd, cmd, nCmdShow);
}
HRESULT Entry::GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut)
{
TCHAR path[MAX_PATH];
/*
if (!get_path(path))
return E_FAIL;
ShellPath shell_path(path);
IShellFolder* pFolder;
LPCITEMIDLIST pidl_last = NULL;
static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
if (!SHBindToParent)
return E_NOTIMPL;
HRESULT hr = (*SHBindToParent)(shell_path, IID_IShellFolder, (LPVOID*)&pFolder, &pidl_last);
if (FAILED(hr))
return hr;
ShellFolder shell_folder(pFolder);
shell_folder->Release();
return shell_folder->GetUIObjectOf(hWnd, 1, &pidl_last, riid, NULL, ppvOut);
*/
if (!_up)
return E_INVALIDARG;
if (!_up->get_path(path))
return E_FAIL;
ShellPath shell_path(path);
ShellFolder shell_folder(shell_path);
#ifdef UNICODE
LPWSTR wname = _data.cFileName;
#else
WCHAR wname[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, _data.cFileName, -1, wname, MAX_PATH);
#endif
LPITEMIDLIST pidl_last = NULL;
HRESULT hr = shell_folder->ParseDisplayName(hWnd, NULL, wname, NULL, &pidl_last, NULL);
if (FAILED(hr))
return hr;
hr = shell_folder->GetUIObjectOf(hWnd, 1, (LPCITEMIDLIST*)&pidl_last, riid, NULL, ppvOut);
ShellMalloc()->Free((void*)pidl_last);
return hr;
return ICID_NONE;
}
// recursively free all child entries
void Entry::free_subentries()
void ShellEntry::free_subentries()
{
Entry *entry, *next=_down;
ShellEntry *entry, *next=_down;
if (next) {
_down = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,12 +26,6 @@
//
enum ENTRY_TYPE {
ET_UNKNOWN,
ET_WINDOWS,
ET_SHELL
};
enum SORT_ORDER {
SORT_NONE,
SORT_NAME,
@@ -41,37 +35,37 @@ enum SORT_ORDER {
};
enum SCAN_FLAGS {
SCAN_EXTRACT_ICONS = 1,
SCAN_DO_ACCESS = 2,
SCAN_ALL = 3,
SCAN_FILESYSTEM = 4
SCAN_DONT_EXTRACT_ICONS = 1,
SCAN_DONT_ACCESS = 2
};
#ifndef ATTRIBUTE_SYMBOLIC_LINK
#define ATTRIBUTE_LONGNAME 0x08000000
#define ATTRIBUTE_VOLNAME 0x10000000
#define ATTRIBUTE_ERASED 0x20000000
#define ATTRIBUTE_SYMBOLIC_LINK 0x40000000
#define ATTRIBUTE_EXECUTABLE 0x80000000
#endif
/// base of all file and directory entries
struct Entry
struct ShellDirectory;
/// base of all file entries
struct ShellEntry
{
ShellEntry();
ShellEntry(const ShellEntry& other);
ShellEntry(ShellDirectory* parent, LPITEMIDLIST shell_path);
ShellEntry(ShellDirectory* parent, const ShellPath& shell_path);
protected:
Entry(ENTRY_TYPE etype);
Entry(Entry* parent, ENTRY_TYPE etype);
Entry(const Entry&);
ShellEntry(LPITEMIDLIST shell_path);
ShellEntry(const ShellPath& shell_path);
public:
virtual ~Entry();
virtual ~ShellEntry();
Entry* _next;
Entry* _down;
Entry* _up;
ShellEntry* _next;
ShellEntry* _down;
ShellDirectory* _up;
bool _expanded;
bool _scanned;
@@ -81,30 +75,22 @@ public:
SFGAOF _shell_attribs;
LPTSTR _display_name;
LPTSTR _type_name;
LPTSTR _content;
ENTRY_TYPE _etype;
int /*ICON_ID*/ _icon_id;
BY_HANDLE_FILE_INFORMATION _bhfi;
bool _bhfi_valid;
ShellPath _pidl; // parent relative PIDL
void free_subentries();
void read_directory(SORT_ORDER sortOrder, int scan_flags=SCAN_ALL);
Entry* read_tree(const void* path, SORT_ORDER sortOrder);
void sort_directory(SORT_ORDER sortOrder);
void smart_scan(int scan_flags=SCAN_ALL);
void extract_icon();
int extract_icon();
int safe_extract_icon();
virtual void read_directory(int scan_flags=SCAN_ALL) {}
virtual const void* get_next_path_component(const void*) const {return NULL;}
virtual Entry* find_entry(const void*) {return NULL;}
virtual bool get_path(PTSTR path) const = 0;
virtual ShellPath create_absolute_pidl() const {return (LPCITEMIDLIST)NULL;}
virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
virtual bool get_path(PTSTR path, size_t path_count) const;
ShellPath create_absolute_pidl() const;
BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
IShellFolder* get_parent_folder() const;
};
@@ -118,12 +104,90 @@ protected:
};
/// shell folder entry
struct ShellDirectory : public ShellEntry, public Directory
{
ShellDirectory(ShellFolder& root_folder, const ShellPath& shell_path, HWND hwnd)
: ShellEntry(shell_path),
_folder(root_folder, shell_path),
_hwnd(hwnd)
{
CONTEXT("ShellDirectory::ShellDirectory()");
lstrcpy(_data.cFileName, root_folder.get_name(shell_path, SHGDN_FORPARSING));
_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
_shell_attribs = SFGAO_FOLDER;
ShellFolder subfolder(root_folder, shell_path);
IShellFolder* pFolder = subfolder;
pFolder->AddRef();
_path = pFolder;
}
explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST shell_path, HWND hwnd)
: ShellEntry(parent, shell_path),
_folder(parent->_folder, shell_path),
_hwnd(hwnd)
{
/* not neccessary - the caller will fill the info
lstrcpy(_data.cFileName, _folder.get_name(shell_path));
_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
_shell_attribs = SFGAO_FOLDER; */
_folder->AddRef();
_path = _folder;
}
ShellDirectory(const ShellDirectory& other)
: ShellEntry(other),
Directory(other),
_folder(other._folder),
_hwnd(other._hwnd)
{
IShellFolder* pFolder = (IShellFolder*)_path;
pFolder->AddRef();
}
~ShellDirectory()
{
IShellFolder* pFolder = (IShellFolder*)_path;
_path = NULL;
pFolder->Release();
}
void read_directory(SORT_ORDER sortOrder, int scan_flags=0);
void read_directory(int scan_flags=0);
void sort_directory(SORT_ORDER sortOrder);
void smart_scan(int scan_flags=0);
virtual ShellEntry* find_entry(const void* p);
virtual bool get_path(PTSTR path) const;
int extract_icons();
ShellFolder _folder;
HWND _hwnd;
protected:
void fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, bool do_access=true);
};
inline IShellFolder* ShellEntry::get_parent_folder() const
{
if (_up)
return _up->_folder;
else
return GetDesktopFolder();
}
/// root entry for file system trees
struct Root {
Root();
~Root();
Entry* _entry;
ShellDirectory* _entry;
TCHAR _path[MAX_PATH];
TCHAR _volname[_MAX_FNAME];
TCHAR _fs[_MAX_DIR];

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,7 +28,7 @@
#include "precomp.h"
#include "../explorer_intres.h"
#include "../resource.h"
MainFrame::MainFrame(HWND hwnd)
@@ -105,6 +105,8 @@ void MainFrame::update_explorer_view()
_shellBrowser = auto_ptr<ShellBrowserChild>(new ShellBrowserChild(_hwnd, _left_hwnd, _right_hwnd, _create_info, _cm_ifs));
_shellBrowser->Init();
// update _shellBrowser->_clnt_rect
ClientRect rect(_hwnd);
resize_frame(rect.right, rect.bottom);
@@ -171,7 +173,6 @@ void MainFrame::jump_to(LPCTSTR path, int mode)
} else {
_create_info._open_mode = mode;
_create_info._shell_path = path;
_create_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd); //@@
update_explorer_view();
}
@@ -188,7 +189,6 @@ void MainFrame::jump_to(LPCITEMIDLIST path, int mode)
} else {
_create_info._open_mode = mode;
_create_info._shell_path = path;
_create_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd); //@@
update_explorer_view();
}
@@ -301,6 +301,11 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
path = buffer;
}
if (wparam & OWM_ROOTED)
_create_info._root_shell_path = shell_path;
else
_create_info._root_shell_path = DesktopFolderPath(); //SpecialFolderPath(CSIDL_DRIVES, _hwnd);
jump_to(shell_path, (OPEN_WINDOW_MODE)wparam);
return TRUE;} // success
@@ -310,11 +315,15 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
break;
default:
default: {
LRESULT res;
if (_shellBrowser.get())
return _shellBrowser->WndProc(nmsg, wparam, lparam);
else
return super::WndProc(nmsg, wparam, lparam);
if (_shellBrowser->WndProc(nmsg, wparam, lparam, res))
return res;
return super::WndProc(nmsg, wparam, lparam);
}
}
return 0;

View File

@@ -27,8 +27,14 @@
#define PM_OPEN_WINDOW (WM_APP+0x07)
enum OPEN_WINDOW_MODE {OWM_EXPLORE=1, OWM_DETAILS=2, OWM_PIDL=4};
enum OPEN_WINDOW_MODE {
OWM_EXPLORE=1, /// window in explore mode
OWM_ROOTED=2, /// "rooted" window with special shell namespace root
OWM_DETAILS=4, /// view files in detail mode
OWM_PIDL=8, /// path is given as PIDL, otherwise as LPCTSTR
OWM_SEPARATE=16 /// open separate subfolder windows
};
/// Explorer frame window
struct MainFrame : public ExtContextMenuHandlerT<PreTranslateWindow>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,7 +28,7 @@
#include "precomp.h"
#include "../explorer_intres.h"
#include "../resource.h"
static LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
@@ -48,14 +48,14 @@ static LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
ShellBrowserChild::ShellBrowserChild(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd,
ShellPathInfo& create_info, CtxMenuInterfaces& cm_ifs)
: _hwnd(hwnd),
_hWndFrame(hwnd),
_left_hwnd(left_hwnd),
_right_hwnd(right_hwnd),
_create_info(create_info),
_cm_ifs(_cm_ifs)
_cm_ifs(cm_ifs)
{
_pShellView = NULL;
_pDropTarget = NULL;
_himlSmall = 0;
_last_sel = 0;
// SDI integration
@@ -64,12 +64,14 @@ ShellBrowserChild::ShellBrowserChild(HWND hwnd, HWND left_hwnd, WindowHandle& ri
_cur_dir = NULL;
Init(hwnd);
_himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
ImageList_SetBkColor(_himl, GetSysColor(COLOR_WINDOW));
}
ShellBrowserChild::~ShellBrowserChild()
{
TreeView_SetImageList(_left_hwnd, 0, TVSIL_NORMAL);
ImageList_Destroy(_himl);
if (_pShellView)
_pShellView->Release();
@@ -86,24 +88,12 @@ ShellBrowserChild::~ShellBrowserChild()
}
LRESULT ShellBrowserChild::Init(HWND hWndFrame)
LRESULT ShellBrowserChild::Init()
{
CONTEXT("ShellBrowserChild::Init()");
_hWndFrame = hWndFrame;
ClientRect rect(_hwnd);
SHFILEINFO sfi;
_himlSmall = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_SMALLICON);
// _himlLarge = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_LARGEICON);
if (_left_hwnd) {
InitializeTree();
InitDragDrop();
}
const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);
_root._drive_type = DRIVE_UNKNOWN;
@@ -113,13 +103,15 @@ LRESULT ShellBrowserChild::Init(HWND hWndFrame)
_root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);
jump_to(_create_info._shell_path);
// -> set_curdir()
_root._entry->read_directory();
/* already filled by ShellDirectory constructor
lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
if (_left_hwnd) {
InitializeTree();
InitDragDrop();
}
jump_to(_create_info._shell_path);
return 0;
}
@@ -129,22 +121,20 @@ void ShellBrowserChild::InitializeTree()
{
CONTEXT("ShellBrowserChild::InitializeTree()");
TreeView_SetImageList(_left_hwnd, _himlSmall, TVSIL_NORMAL);
TreeView_SetImageList(_left_hwnd, _himl, TVSIL_NORMAL);
TreeView_SetScrollTime(_left_hwnd, 100);
TV_ITEM tvItem;
tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
tvItem.lParam = (LPARAM)_root._entry;
tvItem.pszText = LPSTR_TEXTCALLBACK;
tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
tvItem.cChildren = 1;
TV_INSERTSTRUCT tvInsert;
TV_ITEM& tvItem = tvInsert.item;
tvInsert.hParent = 0;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item = tvItem;
tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
tvItem.lParam = (LPARAM)_root._entry;
tvItem.pszText = _root._volname; //LPSTR_TEXTCALLBACK;
tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
tvItem.cChildren = 1;
HTREEITEM hItem = TreeView_InsertItem(_left_hwnd, &tvInsert);
TreeView_SelectItem(_left_hwnd, hItem);
@@ -167,8 +157,7 @@ bool ShellBrowserChild::InitDragDrop()
_pDropTarget->Release(); // free TreeDropTarget
_pDropTarget = NULL;
return false;
}
else
} else
_pDropTarget->Release();
FORMATETC ftetc;
@@ -209,21 +198,13 @@ void ShellBrowserChild::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPO
LPARAM itemData = TreeView_GetItemData(hwndTreeView, hItem);
if (itemData) {
Entry* entry = (Entry*)itemData;
ShellEntry* entry = (ShellEntry*)itemData;
if (entry->_etype == ET_SHELL) {
ShellDirectory* dir = static_cast<ShellDirectory*>(entry->_up);
ShellFolder folder = dir? dir->_folder: GetDesktopFolder();
LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl;
ShellDirectory* dir = entry->_up;
ShellFolder folder = dir? dir->_folder: GetDesktopFolder();
LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl;
CHECKERROR(ShellFolderContextMenu(folder, ::GetParent(hwndTreeView), 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs));
} else {
ShellPath shell_path = entry->create_absolute_pidl();
LPCITEMIDLIST pidl = shell_path;
///@todo use parent folder instead of desktop
CHECKERROR(ShellFolderContextMenu(GetDesktopFolder(), _hwnd, 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs));
}
CHECKERROR(ShellFolderContextMenu(folder, _hwnd, 1, &pidl, pptScreen->x, pptScreen->y, _cm_ifs));
}
}
@@ -233,38 +214,60 @@ void ShellBrowserChild::OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh)
LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)pnmh;
ShellEntry* entry = (ShellEntry*)lpdi->item.lParam;
if (!entry)
return;
if (lpdi->item.mask & TVIF_TEXT)
lpdi->item.pszText = entry->_display_name;
if (lpdi->item.mask & (/*TVIF_TEXT|*/TVIF_IMAGE|TVIF_SELECTEDIMAGE)) {
ShellPath pidl_abs = entry->create_absolute_pidl(); // Caching of absolute PIDLs could enhance performance.
LPCITEMIDLIST pidl = pidl_abs;
SHFILEINFO sfi;
/*
if (entry) {
if (lpdi->item.mask & TVIF_TEXT)
if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_DISPLAYNAME))
lstrcpy(lpdi->item.pszText, sfi.szDisplayName); ///@todo look at cchTextMax if there is enough space available
else
lpdi->item.pszText = entry->_data.cFileName;
*/
if (lpdi->item.mask & TVIF_IMAGE)
if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_LINKOVERLAY) == _himlSmall)
lpdi->item.iImage = sfi.iIcon;
else
lpdi->item.iImage = -1;
lpdi->item.pszText = entry->_display_name;
if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_OPENICON) == _himlSmall)
lpdi->item.iSelectedImage = sfi.iIcon;
else
lpdi->item.iSelectedImage = -1;
if (lpdi->item.mask & (TVIF_IMAGE|TVIF_SELECTEDIMAGE))
try {
ShellPath pidl_abs = entry->create_absolute_pidl(); // Caching of absolute PIDLs could enhance performance.
LPCITEMIDLIST pidl = pidl_abs;
if (lpdi->item.mask & TVIF_IMAGE)
lpdi->item.iImage = get_entry_image(entry, pidl, SHGFI_SMALLICON, _image_map);
if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
lpdi->item.iSelectedImage = get_entry_image(entry, pidl, SHGFI_SMALLICON|SHGFI_OPENICON, _image_map_open);
} catch(COMException&) {
// ignore exception
}
}
}
int ShellBrowserChild::get_entry_image(ShellEntry* entry, LPCITEMIDLIST pidl, int shgfi_flags, ImageMap& cache)
{
SHFILEINFO sfi;
int idx = -1;
ImageMap::const_iterator found = cache.find(entry);
if (found != cache.end())
return found->second;
if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), shgfi_flags|SHGFI_PIDL|SHGFI_ICON|SHGFI_ADDOVERLAYS)) {
idx = ImageList_AddIcon(_himl, sfi.hIcon);
DestroyIcon(sfi.hIcon);
}
cache[entry] = idx;
return idx;
}
void ShellBrowserChild::invalidate_cache()
{
TreeView_SetImageList(_left_hwnd, 0, TVSIL_NORMAL);
ImageList_Destroy(_himl);
TreeView_SetImageList(_left_hwnd, _himl, TVSIL_NORMAL);
_himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
_image_map.clear();
_image_map_open.clear();
}
void ShellBrowserChild::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
{
CONTEXT("ShellBrowserChild::OnTreeItemExpanding()");
@@ -272,11 +275,11 @@ void ShellBrowserChild::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
if (pnmtv->action == TVE_COLLAPSE)
TreeView_Expand(_left_hwnd, pnmtv->itemNew.hItem, TVE_COLLAPSE|TVE_COLLAPSERESET);
else if (pnmtv->action == TVE_EXPAND) {
ShellDirectory* entry = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, pnmtv->itemNew.hItem);
ShellDirectory* dir = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, pnmtv->itemNew.hItem);
if (entry)
if (!InsertSubitems(pnmtv->itemNew.hItem, entry, entry->_folder)) {
entry->_shell_attribs &= ~SFGAO_HASSUBFOLDER;
if (dir)
if (!InsertSubitems(pnmtv->itemNew.hItem, dir)) {
dir->_shell_attribs &= ~SFGAO_HASSUBFOLDER;
// remove subitem "+"
TV_ITEM tvItem;
@@ -290,7 +293,7 @@ void ShellBrowserChild::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
}
}
int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder)
int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, ShellDirectory* dir)
{
CONTEXT("ShellBrowserChild::InsertSubitems()");
@@ -301,15 +304,21 @@ int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShel
SendMessage(_left_hwnd, WM_SETREDRAW, FALSE, 0);
try {
entry->smart_scan();
dir->smart_scan();
} catch(COMException& e) {
HandleException(e, g_Globals._hMainWnd);
}
// remove old children items
for(HTREEITEM hchild,hnext=TreeView_GetChild(_left_hwnd, hParentItem); hchild=hnext; ) {
hnext = TreeView_GetNextSibling(_left_hwnd, hchild);
TreeView_DeleteItem(_left_hwnd, hchild);
}
TV_ITEM tvItem;
TV_INSERTSTRUCT tvInsert;
for(entry=entry->_down; entry; entry=entry->_next) {
for(ShellEntry*entry=dir->_down; entry; entry=entry->_next) {
#ifndef _LEFT_FILES
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
#endif
@@ -333,9 +342,9 @@ int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShel
tvInsert.hParent = hParentItem;
TreeView_InsertItem(_left_hwnd, &tvInsert);
}
++cnt;
++cnt;
}
}
SendMessage(_left_hwnd, WM_SETREDRAW, TRUE, 0);
@@ -347,10 +356,11 @@ void ShellBrowserChild::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
{
CONTEXT("ShellBrowserChild::OnTreeItemSelected()");
_last_sel = pnmtv->itemNew.hItem;
Entry* entry = (Entry*)pnmtv->itemNew.lParam;
ShellDirectory* dir = (ShellDirectory*)pnmtv->itemNew.lParam;
jump_to(entry);
jump_to(dir);
_last_sel = pnmtv->itemNew.hItem;
}
void ShellBrowserChild::UpdateFolderView(IShellFolder* folder)
@@ -416,11 +426,12 @@ void ShellBrowserChild::resize_children()
}
LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
bool ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT& res)
{
switch(nmsg) {
case WM_GETISHELLBROWSER: // for Registry Explorer Plugin
return (LRESULT)static_cast<IShellBrowser*>(this);
res = (LRESULT)static_cast<IShellBrowser*>(this);
return true;
// SDI integration:
@@ -451,7 +462,8 @@ LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
SetCursor(LoadCursor(0, IDC_SIZEWE));
return TRUE;
res = TRUE;
return true;
}
}
goto def;
@@ -505,10 +517,11 @@ LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
default: def:
return DefWindowProc(_hwnd, nmsg, wparam, lparam);
return false;
}
return 0;
res = 0;
return true;
}
int ShellBrowserChild::Command(int id, int code)
@@ -561,27 +574,24 @@ HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida)
if (pida->cidl >= 1) {
if (_left_hwnd) { // explorer mode
//@@if (_last_sel) {
ShellDirectory* parent = _cur_dir;//@@(ShellDirectory*)TreeView_GetItemData(_left_hwnd, _last_sel);
ShellDirectory* parent = _cur_dir;
if (parent) {
try {
parent->smart_scan();
} catch(COMException& e) {
return e.Error();
}
UINT firstOffset = pida->aoffset[1];
LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset);
Entry* entry = parent->find_entry(pidl);
if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
if (entry->_etype == ET_SHELL)
if (expand_folder(static_cast<ShellDirectory*>(entry)))
return S_OK;
if (parent) {
try {
parent->smart_scan();
} catch(COMException& e) {
return e.Error();
}
//@@}
UINT firstOffset = pida->aoffset[1];
LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset);
ShellEntry* entry = parent->find_entry(pidl);
if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
if (select_folder(static_cast<ShellDirectory*>(entry), true))
return S_OK;
}
} else { // no tree control
if (MainFrame::OpenShellFolders(pida, _hWndFrame))
return S_OK;
@@ -597,11 +607,10 @@ HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida)
}
bool ShellBrowserChild::expand_folder(ShellDirectory* entry)
bool ShellBrowserChild::select_folder(ShellDirectory* dir, bool expand)
{
CONTEXT("ShellBrowserChild::expand_folder()");
//HTREEITEM hitem_sel = TreeView_GetSelection(_left_hwnd);
if (!_last_sel)
return false;
@@ -609,10 +618,14 @@ bool ShellBrowserChild::expand_folder(ShellDirectory* entry)
return false;
for(HTREEITEM hitem=TreeView_GetChild(_left_hwnd,_last_sel); hitem; hitem=TreeView_GetNextSibling(_left_hwnd,hitem)) {
if ((ShellDirectory*)TreeView_GetItemData(_left_hwnd,hitem) == entry) {
if (TreeView_SelectItem(_left_hwnd, hitem) &&
TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND))
if ((ShellDirectory*)TreeView_GetItemData(_left_hwnd,hitem) == dir) {
if (TreeView_SelectItem(_left_hwnd, hitem)) {
if (expand)
if (!TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND))
return false;
return true;
}
break;
}
@@ -631,61 +644,52 @@ void ShellBrowserChild::jump_to(LPCTSTR path)
void ShellBrowserChild::jump_to(LPCITEMIDLIST pidl)
{
Entry* entry = NULL;
ShellDirectory* dir = NULL;
//@@
if (!_cur_dir)
_cur_dir = static_cast<ShellDirectory*>(_root._entry);
/*@todo
we should call read_tree() here to iterate through the hierarchy and open all folders from shell_info._root_shell_path to shell_info._shell_path
_root._entry->read_tree(shell_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME);
-> see FileChildWindow::FileChildWindow()
*/
_cur_dir = _root._entry;
if (_cur_dir) {
static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);
LPCITEMIDLIST child_pidl;
if (ILFindChild) {
for(;;) {
LPCITEMIDLIST child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
if (!child_pidl || !child_pidl->mkid.cb)
break;
if (ILFindChild)
child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
else
child_pidl = pidl; // This is not correct in the common case, but works on the desktop level.
_cur_dir->smart_scan();
if (child_pidl) {
dir = static_cast<ShellDirectory*>(_cur_dir->find_entry(child_pidl));
if (!dir)
break;
jump_to(dir);
}
} else {
_cur_dir->smart_scan();
entry = _cur_dir->find_entry(child_pidl);
dir = static_cast<ShellDirectory*>(_cur_dir->find_entry(pidl)); // This is not correct in the common case, but works on the desktop level.
if (entry)
jump_to(entry);
if (dir)
jump_to(dir);
}
}
//@@ work around as long as we don't iterate correctly through the ShellEntry tree
if (!entry)
// If not already called, now directly call UpdateFolderView() using pidl.
if (!dir)
UpdateFolderView(ShellFolder(pidl));
}
void ShellBrowserChild::jump_to(Entry* entry)
void ShellBrowserChild::jump_to(ShellDirectory* dir)
{
if (entry->_etype == ET_SHELL) {
IShellFolder* folder;
ShellDirectory* se = static_cast<ShellDirectory*>(entry);
if (dir == _cur_dir)
return;
if (se->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
folder = static_cast<ShellDirectory*>(se)->_folder;
else
folder = se->get_parent_folder();
if (_left_hwnd)
select_folder(dir, false);
if (!folder) {
assert(folder);
return;
}
UpdateFolderView(dir->_folder);
UpdateFolderView(folder);
_cur_dir = se;
}
_cur_dir = dir;
}

View File

@@ -41,6 +41,10 @@ struct ShellPathInfo
};
#ifndef SHGFI_ADDOVERLAYS // missing in MinGW (as of 28.12.2005)
#define SHGFI_ADDOVERLAYS 0x000000020
#endif
/// Implementation of IShellBrowserImpl interface in explorer child windows
struct ShellBrowserChild : public IShellBrowserImpl
{
@@ -98,34 +102,31 @@ struct ShellBrowserChild : public IShellBrowserImpl
return E_NOTIMPL;
}
const Root& get_root() const {return _root;}
protected:
HWND _hwnd;
HWND _hWndFrame;
HWND _left_hwnd;
WindowHandle& _right_hwnd;
ShellPathInfo& _create_info;
Root _root;
WindowHandle _hWndFrame;
ShellFolder _folder;
IShellView* _pShellView; // current hosted shellview
HIMAGELIST _himlSmall; // list
// HIMAGELIST _himlLarge; // shell image
TreeDropTarget* _pDropTarget;
HTREEITEM _last_sel;
HIMAGELIST _himl;
HTREEITEM _last_sel;
public:
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
bool WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT& res);
int Command(int id, int code);
int Notify(int id, NMHDR* pnmh);
LRESULT Init(HWND hWndFrame);
LRESULT Init();
void InitializeTree();
int InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder);
int InsertSubitems(HTREEITEM hParentItem, ShellDirectory* dir);
bool InitDragDrop();
HRESULT OnDefaultCommand(LPIDA pida);
@@ -137,7 +138,7 @@ public:
void UpdateFolderView(IShellFolder* folder);
void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen);
bool expand_folder(ShellDirectory* entry);
bool select_folder(ShellDirectory* dir, bool expand);
// SDI integration
public:
@@ -145,13 +146,20 @@ public:
int _last_split;
RECT _clnt_rect;
/*virtual*/ void resize_children();
/*virtual*/ void jump_to(LPCTSTR path);
/*virtual*/ void jump_to(LPCITEMIDLIST pidl);
void resize_children();
void jump_to(LPCTSTR path);
void jump_to(LPCITEMIDLIST pidl);
void jump_to(Entry* entry);
void jump_to(ShellDirectory* dir);
protected:
ShellDirectory* _cur_dir;
CtxMenuInterfaces& _cm_ifs;
typedef map<ShellEntry*, int> ImageMap;
ImageMap _image_map;
ImageMap _image_map_open;
int get_entry_image(ShellEntry* entry, LPCITEMIDLIST pidl, int shgfi_flags, ImageMap& cache);
void invalidate_cache();
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -31,12 +31,10 @@
#include <shlwapi.h>
bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, BY_HANDLE_FILE_INFORMATION* pbhfi, bool do_access)
void ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, bool do_access)
{
CONTEXT("ShellDirectory::fill_w32fdata_shell()");
bool bhfi_valid = false;
if (do_access && !( (attribs&SFGAO_FILESYSTEM) && SUCCEEDED(
SHGetDataFromIDList(_folder, pidl, SHGDFIL_FINDDATA, pw32fdata, sizeof(WIN32_FIND_DATA))) )) {
WIN32_FILE_ATTRIBUTE_DATA fad;
@@ -73,16 +71,6 @@ bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN
}
}
HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (hFile != INVALID_HANDLE_VALUE) {
if (GetFileInformationByHandle(hFile, pbhfi))
bhfi_valid = true;
CloseHandle(hFile);
}
SetErrorMode(sem_org);
GlobalUnlock(medium.hGlobal);
@@ -100,8 +88,6 @@ bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN
if (attribs & SFGAO_COMPRESSED)
pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED;
return bhfi_valid;
}
@@ -109,21 +95,19 @@ ShellPath ShellEntry::create_absolute_pidl() const
{
CONTEXT("ShellEntry::create_absolute_pidl()");
if (_up)
if (_up->_etype == ET_SHELL) {
ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
if (_up) {
ShellDirectory* dir = _up;
if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance.
return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
} else
return _pidl.create_absolute_pidl(_up->create_absolute_pidl());
if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance.
return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
}
return _pidl;
}
// get full path of a shell entry
bool ShellEntry::get_path(PTSTR path) const
bool ShellEntry::get_path(PTSTR path, size_t path_count) const
{
/*
path[0] = TEXT('\0');
@@ -135,7 +119,7 @@ bool ShellEntry::get_path(PTSTR path) const
LPCTSTR ret = fs_path;
if (ret) {
_tcscpy(path, ret);
lstrcpyn(path, ret, path_count);
return true;
} else
return false;
@@ -211,43 +195,68 @@ void ShellDirectory::read_directory(int scan_flags)
int level = _level + 1;
Entry* first_entry = NULL;
Entry* last = NULL;
ShellEntry* first_entry = NULL;
ShellEntry* last = NULL;
/*if (_folder.empty())
return;*/
TCHAR buffer[MAX_PATH];
ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE);
if ((scan_flags&SCAN_FILESYSTEM) && get_path(buffer)) {
Entry* entry = NULL; // eliminate useless GCC warning by initializing entry
TCHAR name[MAX_PATH];
HRESULT hr_next = S_OK;
LPTSTR p = buffer + _tcslen(buffer);
do {
#define FETCH_ITEM_COUNT 32
LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
ULONG cnt = 0;
lstrcpy(p, TEXT("\\*"));
memset(pidls, 0, sizeof(pidls));
WIN32_FIND_DATA w32fd;
HANDLE hFind = FindFirstFile(buffer, &w32fd);
hr_next = enumerator->Next(FETCH_ITEM_COUNT, pidls, &cnt);
if (hFind != INVALID_HANDLE_VALUE) {
do {
// ignore hidden files (usefull in the start menu)
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
continue;
/* don't break yet now: Registry Explorer Plugin returns E_FAIL!
if (!SUCCEEDED(hr_next))
break; */
// ignore directory entries "." and ".."
if ((w32fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) &&
w32fd.cFileName[0]==TEXT('.') &&
(w32fd.cFileName[1]==TEXT('\0') ||
(w32fd.cFileName[1]==TEXT('.') && w32fd.cFileName[2]==TEXT('\0'))))
continue;
if (hr_next == S_FALSE)
break;
lstrcpy(p+1, w32fd.cFileName);
for(ULONG n=0; n<cnt; ++n) {
WIN32_FIND_DATA w32fd;
memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE;
SFGAOF attribs = attribs_before;
HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs);
bool removeable = false;
if (SUCCEEDED(hr) && attribs!=attribs_before) {
// avoid accessing floppy drives when browsing "My Computer"
if (attribs & SFGAO_REMOVABLE) {
attribs |= SFGAO_HASSUBFOLDER;
removeable = true;
} else if (!(scan_flags & SCAN_DONT_ACCESS)) {
DWORD attribs2 = SFGAO_READONLY;
HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2);
if (SUCCEEDED(hr))
attribs |= attribs2;
}
} else
attribs = 0;
fill_w32fdata_shell(pidls[n], attribs, &w32fd, !(scan_flags&SCAN_DONT_ACCESS)&&!removeable);
try {
ShellEntry* entry = NULL; // eliminate useless GCC warning by initializing entry
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
entry = new WinDirectory(this, buffer);
entry = new ShellDirectory(this, pidls[n], _hwnd);
else
entry = new WinEntry(this);
entry = new ShellEntry(this, pidls[n]);
if (!first_entry)
first_entry = entry;
@@ -257,170 +266,38 @@ void ShellDirectory::read_directory(int scan_flags)
memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
entry->_level = level;
if (scan_flags & SCAN_DO_ACCESS) {
HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (hFile != INVALID_HANDLE_VALUE) {
if (GetFileInformationByHandle(hFile, &entry->_bhfi))
entry->_bhfi_valid = true;
CloseHandle(hFile);
}
if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, MAX_PATH, SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) {
if (!entry->_data.cFileName[0])
_tcscpy(entry->_data.cFileName, name);
else if (_tcscmp(entry->_display_name, name))
entry->_display_name = _tcsdup(name); // store display name separate from file name; sort display by file name
}
// set file type name
LPCTSTR ext = g_Globals._ftype_mgr.set_type(entry);
DWORD attribs = SFGAO_FILESYSTEM;
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
attribs |= SFGAO_FOLDER;
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
attribs |= SFGAO_READONLY;
//if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
// attribs |= SFGAO_HIDDEN;
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED)
attribs |= SFGAO_COMPRESSED;
if (ext && !_tcsicmp(ext, _T(".lnk"))) {
attribs |= SFGAO_LINK;
if (attribs & SFGAO_LINK)
w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
}
entry->_level = level;
entry->_shell_attribs = attribs;
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
// set file type name
g_Globals._ftype_mgr.set_type(entry);
// get icons for files and virtual objects
if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
!(attribs & SFGAO_FILESYSTEM)) {
if (!(scan_flags & SCAN_DONT_EXTRACT_ICONS))
entry->_icon_id = entry->safe_extract_icon();
} else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
entry->_icon_id = ICID_FOLDER;
else if (scan_flags & SCAN_EXTRACT_ICONS)
try {
entry->extract_icon();
} catch(COMException&) {
// ignore unexpected exceptions while extracting icons
}
else
entry->_icon_id = ICID_NONE; // don't try again later
last = entry;
} while(FindNextFile(hFind, &w32fd));
FindClose(hFind);
}
} else { // !SCAN_FILESYSTEM
ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE);
TCHAR name[MAX_PATH];
HRESULT hr_next = S_OK;
do {
#define FETCH_ITEM_COUNT 32
LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
ULONG cnt = 0;
memset(pidls, 0, sizeof(pidls));
hr_next = enumerator->Next(FETCH_ITEM_COUNT, pidls, &cnt);
/* don't break yet now: Registry Explorer Plugin returns E_FAIL!
if (!SUCCEEDED(hr_next))
break; */
if (hr_next == S_FALSE)
break;
for(ULONG n=0; n<cnt; ++n) {
WIN32_FIND_DATA w32fd;
BY_HANDLE_FILE_INFORMATION bhfi;
bool bhfi_valid = false;
memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE;
SFGAOF attribs = attribs_before;
HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs);
bool removeable = false;
if (SUCCEEDED(hr) && attribs!=attribs_before) {
// avoid accessing floppy drives when browsing "My Computer"
if (attribs & SFGAO_REMOVABLE) {
attribs |= SFGAO_HASSUBFOLDER;
removeable = true;
} else if (scan_flags & SCAN_DO_ACCESS) {
DWORD attribs2 = SFGAO_READONLY;
HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2);
if (SUCCEEDED(hr))
attribs |= attribs2;
}
} else
attribs = 0;
bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi,
(scan_flags&SCAN_DO_ACCESS) && !removeable);
try {
Entry* entry = NULL; // eliminate useless GCC warning by initializing entry
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
entry = new ShellDirectory(this, pidls[n], _hwnd);
else
entry = new ShellEntry(this, pidls[n]);
if (!first_entry)
first_entry = entry;
if (last)
last->_next = entry;
memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
if (bhfi_valid)
memcpy(&entry->_bhfi, &bhfi, sizeof(BY_HANDLE_FILE_INFORMATION));
if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, MAX_PATH, SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) {
if (!entry->_data.cFileName[0])
_tcscpy(entry->_data.cFileName, name);
else if (_tcscmp(entry->_display_name, name))
entry->_display_name = _tcsdup(name); // store display name separate from file name; sort display by file name
}
if (attribs & SFGAO_LINK)
w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
entry->_level = level;
entry->_shell_attribs = attribs;
entry->_bhfi_valid = bhfi_valid;
// set file type name
g_Globals._ftype_mgr.set_type(entry);
// get icons for files and virtual objects
if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
!(attribs & SFGAO_FILESYSTEM)) {
if (scan_flags & SCAN_EXTRACT_ICONS)
try {
entry->extract_icon();
} catch(COMException&) {
// ignore unexpected exceptions while extracting icons
}
} else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
entry->_icon_id = ICID_FOLDER;
else
entry->_icon_id = ICID_NONE; // don't try again later
last = entry;
} catch(COMException& e) {
HandleException(e, _hwnd);
}
} catch(COMException& e) {
HandleException(e, _hwnd);
}
} while(SUCCEEDED(hr_next));
}
}
} while(SUCCEEDED(hr_next));
if (last)
last->_next = NULL;
@@ -429,30 +306,16 @@ void ShellDirectory::read_directory(int scan_flags)
_scanned = true;
}
const void* ShellDirectory::get_next_path_component(const void* p) const
{
LPITEMIDLIST pidl = (LPITEMIDLIST)p;
if (!pidl || !pidl->mkid.cb)
return NULL;
// go to next element
pidl = (LPITEMIDLIST)((LPBYTE)pidl+pidl->mkid.cb);
return pidl;
}
Entry* ShellDirectory::find_entry(const void* p)
ShellEntry* ShellDirectory::find_entry(const void* p)
{
LPITEMIDLIST pidl = (LPITEMIDLIST) p;
for(Entry*entry=_down; entry; entry=entry->_next)
if (entry->_etype == ET_SHELL) {
ShellEntry* se = static_cast<ShellEntry*>(entry);
for(ShellEntry*entry=_down; entry; entry=entry->_next) {
ShellEntry* se = static_cast<ShellEntry*>(entry);
if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb))
return entry;
}
if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb))
return entry;
}
return NULL;
}
@@ -461,9 +324,9 @@ int ShellDirectory::extract_icons()
{
int cnt = 0;
for(Entry*entry=_down; entry; entry=entry->_next)
for(ShellEntry*entry=_down; entry; entry=entry->_next)
if (entry->_icon_id == ICID_UNKNOWN) {
entry->extract_icon();
entry->_icon_id = entry->extract_icon();
if (entry->_icon_id != ICID_NONE)
++cnt;

View File

@@ -1,123 +0,0 @@
/*
* Copyright 2003, 2004 Martin Fuchs
*
* 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
*/
//
// Explorer clone, lean version
//
// shellfs.h
//
// Martin Fuchs, 23.07.2003
//
/// shell file/directory entry
struct ShellEntry : public Entry
{
ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {}
ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {}
virtual bool get_path(PTSTR path) const;
virtual ShellPath create_absolute_pidl() const;
virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
IShellFolder* get_parent_folder() const;
ShellPath _pidl; // parent relative PIDL
protected:
ShellEntry(LPITEMIDLIST shell_path) : Entry(ET_SHELL), _pidl(shell_path) {}
ShellEntry(const ShellPath& shell_path) : Entry(ET_SHELL), _pidl(shell_path) {}
};
/// shell folder entry
struct ShellDirectory : public ShellEntry, public Directory
{
ShellDirectory(ShellFolder& root_folder, const ShellPath& shell_path, HWND hwnd)
: ShellEntry(shell_path),
_folder(root_folder, shell_path),
_hwnd(hwnd)
{
CONTEXT("ShellDirectory::ShellDirectory()");
lstrcpy(_data.cFileName, root_folder.get_name(shell_path, SHGDN_FORPARSING));
_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
_shell_attribs = SFGAO_FOLDER;
ShellFolder subfolder(root_folder, shell_path);
IShellFolder* pFolder = subfolder;
pFolder->AddRef();
_path = pFolder;
}
explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST shell_path, HWND hwnd)
: ShellEntry(parent, shell_path),
_folder(parent->_folder, shell_path),
_hwnd(hwnd)
{
/* not neccessary - the caller will fill the info
lstrcpy(_data.cFileName, _folder.get_name(shell_path));
_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
_shell_attribs = SFGAO_FOLDER; */
_folder->AddRef();
_path = _folder;
}
ShellDirectory(const ShellDirectory& other)
: ShellEntry(other),
Directory(other),
_folder(other._folder),
_hwnd(other._hwnd)
{
IShellFolder* pFolder = (IShellFolder*)_path;
pFolder->AddRef();
}
~ShellDirectory()
{
IShellFolder* pFolder = (IShellFolder*)_path;
_path = NULL;
pFolder->Release();
}
virtual void read_directory(int scan_flags=SCAN_ALL);
virtual const void* get_next_path_component(const void*) const;
virtual Entry* find_entry(const void* p);
virtual bool get_path(PTSTR path) const;
int extract_icons();
ShellFolder _folder;
HWND _hwnd;
protected:
bool fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, BY_HANDLE_FILE_INFORMATION*, bool do_access=true);
};
inline IShellFolder* ShellEntry::get_parent_folder() const
{
if (_up)
return static_cast<ShellDirectory*>(_up)->_folder;
else
return GetDesktopFolder();
}

View File

@@ -1,215 +0,0 @@
/*
* Copyright 2003, 2004 Martin Fuchs
*
* 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
*/
//
// Explorer clone, lean version
//
// winfs.cpp
//
// Martin Fuchs, 23.07.2003
//
#include "precomp.h"
void WinDirectory::read_directory(int scan_flags)
{
CONTEXT("WinDirectory::read_directory()");
int level = _level + 1;
Entry* first_entry = NULL;
Entry* last = NULL;
Entry* entry;
LPCTSTR path = (LPCTSTR)_path;
TCHAR buffer[MAX_PATH], *pname;
for(pname=buffer; *path; )
*pname++ = *path++;
lstrcpy(pname, TEXT("\\*"));
WIN32_FIND_DATA w32fd;
HANDLE hFind = FindFirstFile(buffer, &w32fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
lstrcpy(pname+1, w32fd.cFileName);
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
entry = new WinDirectory(this, buffer);
else
entry = new WinEntry(this);
if (!first_entry)
first_entry = entry;
if (last)
last->_next = entry;
memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
entry->_level = level;
// display file type names, but don't hide file extensions
g_Globals._ftype_mgr.set_type(entry, true);
if (scan_flags & SCAN_DO_ACCESS) {
HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (hFile != INVALID_HANDLE_VALUE) {
if (GetFileInformationByHandle(hFile, &entry->_bhfi))
entry->_bhfi_valid = true;
CloseHandle(hFile);
}
}
last = entry; // There is always at least one entry, because FindFirstFile() succeeded and we don't filter the file entries.
} while(FindNextFile(hFind, &w32fd));
last->_next = NULL;
FindClose(hFind);
}
_down = first_entry;
_scanned = true;
}
const void* WinDirectory::get_next_path_component(const void* p) const
{
LPCTSTR s = (LPCTSTR) p;
while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
++s;
while(*s==TEXT('\\') || *s==TEXT('/'))
++s;
if (!*s)
return NULL;
return s;
}
Entry* WinDirectory::find_entry(const void* p)
{
LPCTSTR name = (LPCTSTR)p;
for(Entry*entry=_down; entry; entry=entry->_next) {
LPCTSTR p = name;
LPCTSTR q = entry->_data.cFileName;
do {
if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
return entry;
} while(tolower(*p++) == tolower(*q++));
p = name;
q = entry->_data.cAlternateFileName;
do {
if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
return entry;
} while(tolower(*p++) == tolower(*q++));
}
return NULL;
}
// get full path of specified directory entry
bool WinEntry::get_path(PTSTR path) const
{
int level = 0;
int len = 0;
int l = 0;
LPCTSTR name = NULL;
TCHAR buffer[MAX_PATH];
const Entry* entry;
for(entry=this; entry; level++) {
l = 0;
if (entry->_etype == ET_WINDOWS) {
name = entry->_data.cFileName;
for(LPCTSTR s=name; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++)
++l;
if (!entry->_up)
break;
} else {
if (entry->get_path(buffer)) {
l = _tcslen(buffer);
name = buffer;
/* special handling of drive names */
if (l>0 && buffer[l-1]=='\\' && path[0]=='\\')
--l;
memmove(path+l, path, len*sizeof(TCHAR));
memcpy(path, name, l*sizeof(TCHAR));
len += l;
}
entry = NULL;
break;
}
if (l > 0) {
memmove(path+l+1, path, len*sizeof(TCHAR));
memcpy(path+1, name, l*sizeof(TCHAR));
len += l+1;
path[0] = TEXT('\\');
}
entry = entry->_up;
}
if (entry) {
memmove(path+l, path, len*sizeof(TCHAR));
memcpy(path, name, l*sizeof(TCHAR));
len += l;
}
if (!level)
path[len++] = TEXT('\\');
path[len] = TEXT('\0');
return true;
}
ShellPath WinEntry::create_absolute_pidl() const
{
CONTEXT("WinEntry::create_absolute_pidl()");
TCHAR path[MAX_PATH];
if (get_path(path))
return ShellPath(path);
return ShellPath();
}

View File

@@ -1,66 +0,0 @@
/*
* Copyright 2003, 2004 Martin Fuchs
*
* 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
*/
//
// Explorer clone, lean version
//
// winfs.h
//
// Martin Fuchs, 23.07.2003
//
/// Windows file system file-entry
struct WinEntry : public Entry
{
WinEntry(Entry* parent) : Entry(parent, ET_WINDOWS) {}
protected:
WinEntry() : Entry(ET_WINDOWS) {}
virtual bool get_path(PTSTR path) const;
virtual ShellPath create_absolute_pidl() const;
};
/// Windows file system directory-entry
struct WinDirectory : public WinEntry, public Directory
{
WinDirectory(LPCTSTR root_path)
: WinEntry()
{
_path = _tcsdup(root_path);
}
WinDirectory(Entry* parent, LPCTSTR path)
: WinEntry(parent)
{
_path = _tcsdup(path);
}
~WinDirectory()
{
free(_path);
_path = NULL;
}
virtual void read_directory(int scan_flags=SCAN_ALL);
virtual const void* get_next_path_component(const void* p) const;
virtual Entry* find_entry(const void*);
};

View File

@@ -28,7 +28,7 @@
#include "precomp.h"
#include "../explorer_intres.h"
#include "../resource.h"
#include "desktopbar.h"
#include "taskbar.h"
@@ -131,9 +131,9 @@ void DesktopBar::RegisterHotkeys()
void DesktopBar::ProcessHotKey(int id_hotkey)
{
switch(id_hotkey) {
case 0:
explorer_show_frame(SW_SHOWNORMAL);
case 0: explorer_show_frame(SW_SHOWNORMAL);
break;
///@todo implement all common hotkeys
}
}

View File

@@ -28,7 +28,7 @@
#include "precomp.h"
#include "../explorer_intres.h"
#include "../resource.h"
#include "quicklaunch.h"
@@ -104,7 +104,7 @@ void QuickLaunchBar::AddShortcuts()
RecursiveCreateDirectory(path);
_dir = new ShellDirectory(GetDesktopFolder(), path, _hwnd);
_dir->smart_scan(SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
_dir->smart_scan(SCAN_DONT_ACCESS);
} catch(COMException&) {
return;
}
@@ -149,7 +149,7 @@ void QuickLaunchBar::AddShortcuts()
SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep);
for(Entry*entry=_dir->_down; entry; entry=entry->_next) {
for(ShellEntry*entry=_dir->_down; entry; entry=entry->_next) {
// hide files like "desktop.ini"
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
continue;
@@ -168,7 +168,7 @@ void QuickLaunchBar::AddShortcuts()
SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
}
void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags)
void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, ShellEntry* entry, int flags)
{
TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
int bmp_idx = SendMessage(_hwnd, TB_ADDBITMAP, 1, (LPARAM)&ab);

View File

@@ -47,7 +47,7 @@ struct QuickLaunchEntry
HBITMAP _hbmp;
String _title;
Entry* _entry;
ShellEntry* _entry;
};
/// map for managing the task bar buttons
@@ -80,6 +80,6 @@ protected:
int _size;
void AddShortcuts();
void AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags=TBSTATE_ENABLED);
void AddButton(int id, HBITMAP hbmp, LPCTSTR name, ShellEntry* entry, int flags=TBSTATE_ENABLED);
void UpdateDesktopButtons(int desktop_idx);
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003, 2004 Martin Fuchs
* Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,7 @@
#include "precomp.h"
#include "../explorer_intres.h"
#include "../resource.h"
#include "desktopbar.h"
#include "startmenu.h"
@@ -211,40 +211,64 @@ void StartMenu::AddEntries()
WaitCursor wait;
#ifdef _LAZY_ICONEXTRACT
dir.smart_scan(SCAN_FILESYSTEM); // lazy icon extraction, try to read directly from filesystem
dir.smart_scan(SCAN_DONT_EXTRACT_ICONS); // extract icons later
#else
dir.smart_scan(SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
dir.smart_scan();
#endif
}
AddShellEntries(dir, -1, smd._subfolders);
AddShellEntries(dir, -1, smd._ignore);
}
}
void StartMenu::AddShellEntries(const ShellDirectory& dir, int max, bool subfolders)
static LPTSTR trim_path_slash(LPTSTR path)
{
int cnt = 0;
LPTSTR p = path;
for(Entry*entry=dir._down; entry; entry=entry->_next) {
while(*p)
++p;
if (p>path && (p[-1]=='\\' || p[-1]=='/'))
*--p = '\0';
return path;
}
void StartMenu::AddShellEntries(const ShellDirectory& dir, int max, const String& ignore)
{
TCHAR ignore_path[MAX_PATH], ignore_dir[MAX_PATH], ignore_name[_MAX_FNAME], ignore_ext[_MAX_EXT];
TCHAR dir_path[MAX_PATH];
if (!ignore.empty()) {
_tsplitpath_s(ignore, ignore_path, COUNTOF(ignore_path), ignore_dir, COUNTOF(ignore_dir), ignore_name, COUNTOF(ignore_name), ignore_ext, COUNTOF(ignore_ext));
_tcscat(ignore_path, ignore_dir);
_tcscat(ignore_name, ignore_ext);
dir.get_path(dir_path);
if (_tcsicmp(trim_path_slash(dir_path), trim_path_slash(ignore_path)))
*ignore_name = '\0';
} else
*ignore_name = '\0';
int cnt = 0;
for(ShellEntry*entry=dir._down; entry; entry=entry->_next) {
// hide files like "desktop.ini"
if (entry->_shell_attribs & SFGAO_HIDDEN)
//not appropriate for drive roots: if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
continue;
// hide subfolders if requested
if (!subfolders)
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
continue;
// hide "Programs" subfolders if requested
if (*ignore_name && !_tcsicmp(entry->_data.cFileName, ignore_name))
continue;
// only 'max' entries shall be added.
if (++cnt == max)
break;
if (entry->_etype == ET_SHELL)
AddEntry(dir._folder, static_cast<ShellEntry*>(entry));
else
AddEntry(dir._folder, entry);
AddEntry(dir._folder, static_cast<ShellEntry*>(entry));
}
}
@@ -846,7 +870,7 @@ void StartMenu::UpdateIcons(/*int idx*/)
btn._icon_id = ICID_NONE;
for(ShellEntrySet::iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it) {
Entry* entry = *it;
ShellEntry* entry = *it;
if (entry->_icon_id == ICID_UNKNOWN)
try {
@@ -900,7 +924,7 @@ void StartMenu::UpdateIcons(/*int idx*/)
sme._hIcon = (HICON)-1;
for(ShellEntrySet::const_iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
const Entry* sm_entry = *it2;
const ShellEntry* sm_entry = *it2;
if (sm_entry->_hIcon) {
sme._hIcon = sm_entry->_hIcon;
@@ -979,14 +1003,14 @@ int StartMenu::Command(int id, int code)
}
StartMenuEntry& StartMenu::AddEntry(const String& title, ICON_ID icon_id, Entry* entry)
StartMenuEntry& StartMenu::AddEntry(const String& title, ICON_ID icon_id, ShellEntry* entry)
{
// search for an already existing subdirectory entry with the same name
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
for(ShellEntryMap::iterator it=_entries.begin(); it!=_entries.end(); ++it) {
StartMenuEntry& sme = it->second;
if (sme._title == title) ///@todo speed up by using a map indexed by name
if (!_tcsicmp(sme._title, title)) ///@todo speed up by using a map indexed by name
for(ShellEntrySet::iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
if ((*it2)->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// merge the new shell entry with the existing of the same name
@@ -1026,18 +1050,7 @@ StartMenuEntry& StartMenu::AddEntry(const ShellFolder folder, ShellEntry* entry)
icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
return AddEntry(folder.get_name(entry->_pidl), icon_id, entry);
}
StartMenuEntry& StartMenu::AddEntry(const ShellFolder folder, Entry* entry)
{
ICON_ID icon_id;
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
icon_id = ICID_FOLDER;
else
icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
return AddEntry(entry->_display_name, icon_id, entry);
// return AddEntry(entry->_display_name, icon_id, entry);
}
@@ -1201,20 +1214,13 @@ void StartMenu::ActivateEntry(int id, const ShellEntrySet& entries)
String title;
for(ShellEntrySet::const_iterator it=entries.begin(); it!=entries.end(); ++it) {
Entry* entry = const_cast<Entry*>(*it);
ShellEntry* entry = const_cast<ShellEntry*>(*it);
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
///@todo If the user explicitly clicked on a submenu, display this folder as floating start menu.
if (entry->_etype == ET_SHELL)
new_folders.push_back(entry->create_absolute_pidl());
else {
TCHAR path[MAX_PATH];
if (entry->get_path(path))
new_folders.push_back(path);
}
new_folders.push_back(entry->create_absolute_pidl());
if (title.empty())
title = entry->_display_name;
@@ -1467,7 +1473,7 @@ StartMenuRoot::StartMenuRoot(HWND hwnd)
try {
// insert directory "All Users\Start Menu"
ShellDirectory cmn_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_STARTMENU, _hwnd), _hwnd);
_dirs.push_back(StartMenuDirectory(cmn_startmenu, false)); // don't add subfolders
_dirs.push_back(StartMenuDirectory(cmn_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_COMMON_PROGRAMS, _hwnd)));
} catch(COMException&) {
// ignore exception and don't show additional shortcuts
}
@@ -1476,7 +1482,7 @@ StartMenuRoot::StartMenuRoot(HWND hwnd)
// insert directory "<user name>\Start Menu"
ShellDirectory usr_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_STARTMENU, _hwnd), _hwnd);
_dirs.push_back(StartMenuDirectory(usr_startmenu, false)); // don't add subfolders
_dirs.push_back(StartMenuDirectory(usr_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_PROGRAMS, _hwnd)));
} catch(COMException&) {
// ignore exception and don't show additional shortcuts
}
@@ -1991,13 +1997,13 @@ void RecentStartMenu::AddEntries()
WaitCursor wait;
#ifdef _LAZY_ICONEXTRACT
dir.smart_scan(SCAN_FILESYSTEM);
dir.smart_scan(SCAN_DONT_EXTRACT_ICONS);
#else
dir.smart_scan(SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
dir.smart_scan();
#endif
}
dir.sort_directory(SORT_DATE);
AddShellEntries(dir, RECENT_DOCS_COUNT, smd._subfolders); ///@todo read max. count of entries from registry
AddShellEntries(dir, RECENT_DOCS_COUNT, smd._ignore); ///@todo read max. count of entries from registry
}
}

View File

@@ -26,11 +26,6 @@
//
#define _LIGHT_STARTMENU
//#define _LAZY_ICONEXTRACT
//#define _SINGLE_ICONEXTRACT
#define CLASSNAME_STARTMENU TEXT("ReactosStartmenuClass")
#define TITLE_STARTMENU TEXT("Start Menu")
@@ -56,8 +51,8 @@
/// StartMenuDirectory is used to store the base directory of start menus.
struct StartMenuDirectory
{
StartMenuDirectory(const ShellDirectory& dir, bool subfolders=true)
: _dir(dir), _subfolders(subfolders)
StartMenuDirectory(const ShellDirectory& dir, const String& ignore="")
: _dir(dir), _ignore(ignore)
{
}
@@ -67,11 +62,11 @@ struct StartMenuDirectory
}
ShellDirectory _dir;
bool _subfolders;
String _ignore;
};
typedef list<StartMenuDirectory> StartMenuShellDirs;
typedef set<Entry*> ShellEntrySet;
typedef set<ShellEntry*> ShellEntrySet;
/// structure holding information about one start menu entry
struct StartMenuEntry
@@ -138,7 +133,7 @@ struct StartMenuSeparator : public Static
typedef list<ShellPath> StartMenuFolders;
/// structor containing information for creating start menus
/// struct containing information for creating start menus
struct StartMenuCreateInfo
{
StartMenuCreateInfo() : _border_top(0) {}
@@ -273,12 +268,11 @@ protected:
virtual void AddEntries();
StartMenuEntry& AddEntry(const String& title, ICON_ID icon_id, Entry* entry);
StartMenuEntry& AddEntry(const String& title, ICON_ID icon_id, ShellEntry* entry);
StartMenuEntry& AddEntry(const String& title, ICON_ID icon_id=ICID_NONE, int id=-1);
StartMenuEntry& AddEntry(const ShellFolder folder, ShellEntry* entry);
StartMenuEntry& AddEntry(const ShellFolder folder, Entry* entry);
void AddShellEntries(const ShellDirectory& dir, int max=-1, bool subfolders=true);
void AddShellEntries(const ShellDirectory& dir, int max=-1, const String& ignore="");
void AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true);
void AddSeparator();

View File

@@ -1,15 +0,0 @@
*.coff
*.exe
*.d
*.o
*.sym
*.map
Debug
Release
UDebug
URelease
*.ncb
*.opt
*.aps
*.ncb
*.plg

View File

@@ -64,14 +64,21 @@ LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count)
String COMException::toString() const
{
TCHAR msg[4*BUFFER_LEN];
#ifdef __STDC_WANT_SECURE_LIB__
int l = 4*BUFFER_LEN;
#endif
LPTSTR p = msg;
#ifndef _NO_CONTEXT
p += _stprintf(p, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
int n = _stprintf_s2(p, l, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
p += n;
#ifdef __STDC_WANT_SECURE_LIB__
l -= n;
#endif
#endif
if (_file)
p += _stprintf(p, TEXT("\nLocation: %hs:%d"), _file, _line);
p += _stprintf_s2(p, l, TEXT("\nLocation: %hs:%d"), _file, _line);
return msg;
}
@@ -505,7 +512,7 @@ IContextMenu* CtxMenuInterfaces::query_interfaces(IContextMenu* pcm1)
_pctxmenu3 = (LPCONTEXTMENU3)pcm;
else
#endif
if (pcm1->QueryInterface (IID_IContextMenu2, (void**)&pcm) == NOERROR)
if (pcm1->QueryInterface(IID_IContextMenu2, (void**)&pcm) == NOERROR)
_pctxmenu2 = (LPCONTEXTMENU2)pcm;
if (pcm) {
@@ -552,7 +559,8 @@ HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int
hr = pcm->InvokeCommand(&cmi);
}
}
} else
cm_ifs.reset();
}
pcm->Release();

View File

@@ -1079,5 +1079,6 @@ protected:
CtxMenuInterfaces _cm_ifs;
};
extern HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int cidl,
LPCITEMIDLIST* ppidl, int x, int y, CtxMenuInterfaces& cm_ifs);

View File

@@ -160,11 +160,20 @@ String Context::getStackTrace() const
BOOL time_to_filetime(const time_t* t, FILETIME* ftime)
{
#ifdef __STDC_WANT_SECURE_LIB__
SYSTEMTIME stime;
struct tm tm_;
struct tm* tm = &tm_;
if (gmtime_s(tm, t) != 0)
return FALSE;
#else
struct tm* tm = gmtime(t);
SYSTEMTIME stime;
if (!tm)
return FALSE;
#endif
stime.wYear = tm->tm_year+1900;
stime.wMonth = tm->tm_mon+1;

View File

@@ -66,7 +66,11 @@ extern "C" {
#define for if (0) {} else for
#ifdef _countof
#define COUNTOF _countof
#else
#define COUNTOF(x) (sizeof(x)/sizeof(x[0]))
#endif
#define BUFFER_LEN 1024
@@ -158,6 +162,24 @@ DWORD RegGetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD def);
#endif
// secure CRT functions
#ifdef __STDC_WANT_SECURE_LIB__ // for VS 2005: _MSC_VER>=1400
#define _stprintf_s1 _stprintf_s
#define _stprintf_s2 _stprintf_s
#else // __STDC_WANT_SECURE_LIB__
#define strcpy_s(d, l, s) strcpy(d, s)
#define _tcscpy_s(d, l, s) _tcscpy(d, s)
#define wcsncpy_s(d, l, s, n) wcsncpy(d, s, n)
#define _stprintf_s1(b, l, f, p1) _stprintf(b, f, p1)
#define _stprintf_s2(b, l, f, p1,p2) _stprintf(b, f, p1,p2)
#define _tsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _tsplitpath(f, d, p, n, e)
#endif // __STDC_WANT_SECURE_LIB__
#ifdef __cplusplus
#ifdef _MSC_VER
@@ -666,6 +688,8 @@ struct String
operator LPCTSTR() const {return c_str();}
LPTSTR str() {return (LPTSTR)data();} /// return modifyable character string pointer
String& printf(LPCTSTR fmt, ...)
{
va_list l;
@@ -707,6 +731,12 @@ struct String
return *this;
}
void toLower()
{
if (!empty())
CharLower(str());
}
};