[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Mon, 3 Jan 2011 00:33:31 +0000 (00:33 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Mon, 3 Jan 2011 00:33:31 +0000 (00:33 +0000)
- Sync with trunk head (r50270)
- This also reverts r49298.

svn path=/branches/cmake-bringup/; revision=50271

478 files changed:
1  2 
CMakeMacros.cmake
base/applications/CMakeLists.txt
base/applications/calc/lang/bg-BG.rc
base/applications/calc/lang/cs-CZ.rc
base/applications/calc/rpn.c
base/applications/cmdutils/reg/Bg.rc
base/applications/cmdutils/reg/rsrc.rc
base/applications/cmdutils/xcopy/It.rc
base/applications/cmdutils/xcopy/Ko.rc
base/applications/cmdutils/xcopy/Sr.rc
base/applications/cmdutils/xcopy/rsrc.rc
base/applications/cmdutils/xcopy/xcopy.c
base/applications/cmdutils/xcopy/xcopy.h
base/applications/findstr/CMakeLists.txt
base/applications/findstr/findstr.c
base/applications/findstr/findstr.rbuild
base/applications/findstr/findstr.rc
base/applications/findstr/lang/bg-BG.rc
base/applications/findstr/lang/ca-ES.rc
base/applications/findstr/lang/cs-CZ.rc
base/applications/findstr/lang/de-DE.rc
base/applications/findstr/lang/el-GR.rc
base/applications/findstr/lang/en-US.rc
base/applications/findstr/lang/es-ES.rc
base/applications/findstr/lang/fr-FR.rc
base/applications/findstr/lang/it-IT.rc
base/applications/findstr/lang/lt-LT.rc
base/applications/findstr/lang/no-NO.rc
base/applications/findstr/lang/pl-PL.rc
base/applications/findstr/lang/pt-BR.rc
base/applications/findstr/lang/ru-RU.rc
base/applications/findstr/lang/sk-SK.rc
base/applications/findstr/lang/sv-SE.rc
base/applications/findstr/lang/uk-UA.rc
base/applications/findstr/resource.h
base/applications/findstr/rsrc.rc
base/applications/games/winmine/lang/bg-BG.rc
base/applications/games/winmine/rsrc.rc
base/applications/iexplore/iexplore.rc
base/applications/mscutils/eventvwr/lang/bg-BG.rc
base/applications/mscutils/servman/lang/bg-BG.rc
base/applications/network/nslookup/nslookup.c
base/applications/rapps/lang/cs-CZ.rc
base/applications/rapps/rapps/ac97forvirtualbox.txt
base/applications/rapps/rapps/fap.txt
base/applications/rapps/rapps/firefox2.txt
base/applications/rapps/rapps/firefox3.txt
base/applications/rapps/rapps/firefox36.txt
base/applications/rapps/rapps/irfanview.txt
base/applications/rapps/rapps/irfanviewplugins.txt
base/applications/rapps/rapps/libreoffice.txt
base/applications/rapps/rapps/mirandaim.txt
base/applications/rapps/rapps/mirc.txt
base/applications/rapps/rapps/offbyone.txt
base/applications/rapps/rapps/opera.txt
base/applications/rapps/rapps/rosbe.txt
base/applications/rapps/rapps/rosbeamd64.txt
base/applications/rapps/rapps/scite.txt
base/applications/rapps/rapps/scummvm.txt
base/applications/rapps/rapps/sdl_mixer.txt
base/applications/rapps/rapps/seamonkey.txt
base/applications/rapps/rapps/thunderbird.txt
base/applications/rapps/rapps/tuxpaint.txt
base/applications/rapps/rapps/ultravnc.txt
base/applications/rapps/rsrc.rc
base/applications/regedit/childwnd.c
base/applications/regedit/clb/clb.c
base/applications/regedit/edit.c
base/applications/regedit/find.c
base/applications/regedit/framewnd.c
base/applications/regedit/hexedit.c
base/applications/regedit/lang/bg-BG.rc
base/applications/regedit/listview.c
base/applications/regedit/main.c
base/applications/regedit/main.h
base/applications/regedit/regedit.c
base/applications/regedit/regedit.rc
base/applications/regedit/regproc.c
base/applications/regedit/treeview.c
base/applications/taskmgr/applpage.c
base/applications/taskmgr/lang/bg-BG.rc
base/applications/taskmgr/procpage.c
base/applications/winhlp32/Ko.rc
base/applications/winhlp32/Zh.rc
base/applications/winhlp32/rsrc.rc
base/applications/wordpad/Zh.rc
base/applications/wordpad/wordpad.c
base/applications/write/Sr.rc
base/applications/write/Zh.rc
base/applications/write/rsrc.rc
base/services/svchost/svchost.c
base/services/umpnpmgr/umpnpmgr.c
base/setup/usetup/lang/bg-BG.h
base/setup/usetup/lang/cs-CZ.h
base/shell/cmd/cmd.c
base/shell/cmd/cmd.h
base/shell/cmd/console.c
base/shell/cmd/precomp.h
base/shell/explorer-new/dragdrop.c
base/shell/explorer-new/lang/bg-BG.rc
base/shell/explorer-new/lang/cs-CZ.rc
boot/bootdata/hivesys_i386.inf
boot/freeldr/freeldr/disk/scsiport.c
dll/cpl/console/lang/bg-BG.rc
dll/cpl/console/rsrc.rc
dll/cpl/input/lang/cs-CZ.rc
dll/cpl/input/rsrc.rc
dll/cpl/intl/lang/bg-BG.rc
dll/cpl/sysdm/lang/bg-BG.rc
dll/cpl/sysdm/lang/cs-CZ.rc
dll/cpl/timedate/lang/bg-BG.rc
dll/directx/ddraw/Ddraw/callbacks_dd_hel.c
dll/directx/ddraw/Ddraw/ddraw_main.c
dll/directx/ddraw/Ddraw/ddraw_stubs.c
dll/directx/ddraw/Palette/createpalette.c
dll/directx/ddraw/Palette/palette.c
dll/directx/ddraw/Surface/createsurface.c
dll/directx/ddraw/Surface/surface_main.c
dll/directx/ddraw/Vtable/DirectDrawSurface4_Vtable.c
dll/directx/ddraw/Vtable/DirectDrawSurface7_Vtable.c
dll/directx/ddraw/rosdraw.h
dll/directx/ddraw/startup.c
dll/ntdll/ldr/startup.c
dll/ntdll/ldr/utils.c
dll/ntdll/rtl/libsupp.c
dll/win32/advapi32/sec/sid.c
dll/win32/avifil32/avifile_Bg.rc
dll/win32/avifil32/rsrc.rc
dll/win32/browseui/browseui.rc
dll/win32/browseui/lang/Bg-bg.rc
dll/win32/devmgr/advprop.c
dll/win32/devmgr/lang/bg-BG.rc
dll/win32/fusion/asmcache.c
dll/win32/fusion/asmenum.c
dll/win32/fusion/asmname.c
dll/win32/fusion/assembly.c
dll/win32/fusion/fusionpriv.h
dll/win32/gdi32/include/gdi32p.h
dll/win32/gdi32/main/dllmain.c
dll/win32/gdi32/misc/gdientry.c
dll/win32/gdi32/misc/heap.c
dll/win32/gdi32/misc/misc.c
dll/win32/gdi32/misc/stubs.c
dll/win32/gdi32/misc/stubsa.c
dll/win32/gdi32/misc/stubsw.c
dll/win32/gdi32/misc/wingl.c
dll/win32/gdi32/objects/arc.c
dll/win32/gdi32/objects/bitmap.c
dll/win32/gdi32/objects/brush.c
dll/win32/gdi32/objects/coord.c
dll/win32/gdi32/objects/dc.c
dll/win32/gdi32/objects/eng.c
dll/win32/gdi32/objects/enhmfile.c
dll/win32/gdi32/objects/font.c
dll/win32/gdi32/objects/icm.c
dll/win32/gdi32/objects/linedda.c
dll/win32/gdi32/objects/metafile.c
dll/win32/gdi32/objects/painting.c
dll/win32/gdi32/objects/palette.c
dll/win32/gdi32/objects/path.c
dll/win32/gdi32/objects/pen.c
dll/win32/gdi32/objects/printdrv.c
dll/win32/gdi32/objects/region.c
dll/win32/gdi32/objects/text.c
dll/win32/gdi32/objects/utils.c
dll/win32/iphlpapi/iphlpapi_main.c
dll/win32/iphlpapi/iphlpapi_private.h
dll/win32/iphlpapi/resinfo_reactos.c
dll/win32/kernel32/file/move.c
dll/win32/mprapi/mprapi.c
dll/win32/mprapi/mprapi.spec
dll/win32/msvcrt/msvcrt.spec
dll/win32/netcfgx/tcpipconf_notify.c
dll/win32/netid/lang/bg-BG.rc
dll/win32/netid/lang/en-US.rc
dll/win32/rpcrt4/cproxy.c
dll/win32/rpcrt4/ndr_stubless.c
dll/win32/setupapi/devinst.c
dll/win32/setupapi/rpc.c
dll/win32/shell32/lang/bg-BG.rc
dll/win32/shell32/shellord.c
dll/win32/shell32/shlview.c
dll/win32/syssetup/lang/bg-BG.rc
dll/win32/urlmon/bindctx.c
dll/win32/urlmon/binding.c
dll/win32/urlmon/bindprot.c
dll/win32/urlmon/download.c
dll/win32/urlmon/file.c
dll/win32/urlmon/format.c
dll/win32/urlmon/ftp.c
dll/win32/urlmon/gopher.c
dll/win32/urlmon/http.c
dll/win32/urlmon/protocol.c
dll/win32/urlmon/sec_mgr.c
dll/win32/urlmon/session.c
dll/win32/urlmon/umon.c
dll/win32/urlmon/uri.c
dll/win32/urlmon/urlmon.spec
dll/win32/urlmon/urlmon_main.c
dll/win32/urlmon/urlmon_main.h
dll/win32/user32/controls/button.c
dll/win32/user32/controls/combo.c
dll/win32/user32/controls/edit.c
dll/win32/user32/controls/listbox.c
dll/win32/user32/controls/static.c
dll/win32/user32/include/user32p.h
dll/win32/user32/misc/stubs.c
dll/win32/user32/user32.spec
dll/win32/user32/windows/cursoricon.c
dll/win32/user32/windows/mdi.c
dll/win32/user32/windows/menu.c
dll/win32/user32/windows/message.c
dll/win32/user32/windows/window.c
dll/win32/user32/windows/winpos.c
dll/win32/winhttp/net.c
dll/win32/wininet/http.c
dll/win32/wininet/internet.c
dll/win32/wininet/netconnection.c
dll/win32/wininet/wininet.spec
dll/win32/winmm/mci.c
drivers/bus/acpi/compbatt/comppnp.c
drivers/filesystems/fastfat/finfo.c
drivers/filesystems/fastfat/rw.c
drivers/filesystems/fastfat/vfat.h
drivers/filesystems/fastfat/volume.c
drivers/filesystems/fastfat_new/cleanup.c
drivers/filesystems/fastfat_new/create.c
drivers/filesystems/fastfat_new/fatstruc.h
drivers/filesystems/fastfat_new/rw.c
drivers/filesystems/npfs/CMakeLists.txt
drivers/filesystems/npfs/create.c
drivers/filesystems/npfs/dirctl.c
drivers/filesystems/npfs/fsctrl.c
drivers/filesystems/npfs/npfs.c
drivers/filesystems/npfs/npfs.h
drivers/filesystems/npfs/rw.c
drivers/input/i8042prt/ps2pp.c
drivers/network/dd/ne2000/ne2000/8390.c
drivers/network/ndis/ndis/miniport.c
drivers/network/tcpip/datalink/lan.c
drivers/storage/class/disk/disk.c
drivers/storage/classpnp/class.c
drivers/storage/classpnp/dictlib.c
drivers/storage/ide/uniata/atapi.h
drivers/storage/ide/uniata/bm_devs.h
drivers/storage/ide/uniata/bsmaster.h
drivers/storage/ide/uniata/config.h
drivers/storage/ide/uniata/id_ata.cpp
drivers/storage/ide/uniata/id_dma.cpp
drivers/storage/ide/uniata/id_init.cpp
drivers/storage/ide/uniata/id_probe.cpp
drivers/storage/ide/uniata/id_queue.cpp
drivers/storage/ide/uniata/id_sata.cpp
drivers/storage/ide/uniata/id_sata.h
drivers/storage/ide/uniata/idedma.rc
drivers/storage/ide/uniata/inc/CrossNt.h
drivers/storage/ide/uniata/inc/PostDbgMesg.h
drivers/storage/ide/uniata/scsi.h
drivers/storage/ide/uniata/srb.h
drivers/storage/ide/uniata/todo.txt
drivers/storage/ide/uniata/uniata_ver.h
drivers/storage/scsiport/scsiport.c
drivers/storage/scsiport/stubs.c
drivers/usb/nt4compat/usbdriver/ehci.c
drivers/usb/nt4compat/usbdriver/keyboard.c
drivers/usb/nt4compat/usbdriver/umss.c
drivers/usb/usbehci/common.c
drivers/usb/usbehci/fdo.c
drivers/usb/usbehci/hardware.c
drivers/usb/usbehci/hardware.h
drivers/usb/usbehci/hwiface.c
drivers/usb/usbehci/hwiface.h
drivers/usb/usbehci/irp.c
drivers/usb/usbehci/pdo.c
drivers/usb/usbehci/physmem.c
drivers/usb/usbehci/physmem.h
drivers/usb/usbehci/transfer.c
drivers/usb/usbehci/transfer.h
drivers/usb/usbehci/usbehci.c
drivers/usb/usbehci/usbehci.h
drivers/usb/usbehci/usbiffn.c
drivers/video/displays/vga_new/debug.c
drivers/video/displays/vga_new/debug.h
drivers/video/displays/vga_new/driver.h
drivers/video/displays/vga_new/enable.c
drivers/video/displays/vga_new/palette.c
drivers/video/displays/vga_new/screen.c
drivers/video/displays/vga_new/vga_new.rbuild
drivers/video/displays/vga_new/vga_new.rc
drivers/video/displays/vga_new/vga_new.spec
drivers/video/miniport/vbe/vbemp.c
drivers/video/miniport/vga_new/vbe.c
drivers/video/miniport/vga_new/vbe.h
drivers/video/miniport/vga_new/vbemodes.c
drivers/video/miniport/vga_new/vga.h
drivers/video/miniport/vmx_svga/vmx_svga.c
drivers/video/videoprt/event.c
drivers/video/videoprt/videoprt.h
drivers/wdm/audio/backpln/portcls/propertyhandler.cpp
drivers/wdm/audio/backpln/portcls/undoc.cpp
gcc.cmake
hal/halx86/generic/timer.c
include/crt/dos.h
include/ddk/ndis.h
include/ddk/ntifs.h
include/ddk/srb.h
include/ndk/rtltypes.h
include/psdk/CMakeLists.txt
include/psdk/control.idl
include/psdk/exdisp.idl
include/psdk/exdispid.h
include/psdk/ipexport.h
include/psdk/mscoree.idl
include/psdk/mshtmdid.h
include/psdk/mshtml.idl
include/psdk/mstask.idl
include/psdk/msxml2.idl
include/psdk/msxml2did.h
include/psdk/msxml6.idl
include/psdk/msxml6did.h
include/psdk/objidl.idl
include/psdk/oledb.idl
include/psdk/propkeydef.h
include/psdk/propsys.idl
include/psdk/rpcndr.h
include/psdk/shellapi.h
include/psdk/tdiinfo.h
include/psdk/urlmon.idl
include/psdk/wbemcli.idl
include/psdk/wincodec.idl
include/psdk/winsxs.idl
include/psdk/wuapi.idl
include/reactos/asm.inc
include/reactos/idl/pnp.idl
include/reactos/ks386.inc
include/reactos/libs/pseh/pseh2.h
include/reactos/version.h
include/reactos/win32k/ntuser.h
lib/atl/atlcore.h
lib/rtl/actctx.c
lib/rtl/heap.c
lib/rtl/i386/rtlmem.s
lib/rtl/image.c
lib/sdk/crt/CMakeLists.txt
lib/sdk/crt/math/i386/pow_asm.s
lib/sdk/crt/math/powl.c
lib/sdk/crt/misc/i10output.c
lib/sdk/crt/misc/stubs.c
lib/sdk/crt/printf/_snprintf.c
lib/sdk/crt/printf/streamout.c
lib/sdk/crt/setjmp/i386/setjmp.s
lib/sdk/crt/string/strtoi64.c
media/doc/README.WINE
media/doc/apc
ntoskrnl/cache/cachesub.c
ntoskrnl/cache/fssup.c
ntoskrnl/cache/newcc.h
ntoskrnl/cache/pinsup.c
ntoskrnl/cache/section/swapout.c
ntoskrnl/cc/copy.c
ntoskrnl/cc/pin.c
ntoskrnl/ex/init.c
ntoskrnl/ex/rundown.c
ntoskrnl/fsrtl/dbcsname.c
ntoskrnl/fsrtl/name.c
ntoskrnl/fstub/fstubex.c
ntoskrnl/include/internal/amd64/ke.h
ntoskrnl/include/internal/arm/ke.h
ntoskrnl/include/internal/ex.h
ntoskrnl/include/internal/i386/asmmacro.S
ntoskrnl/include/internal/i386/ke.h
ntoskrnl/include/internal/i386/mm.h
ntoskrnl/include/internal/powerpc/ke.h
ntoskrnl/io/iomgr/driver.c
ntoskrnl/io/iomgr/iorsrce.c
ntoskrnl/io/iomgr/irp.c
ntoskrnl/kd64/kddata.c
ntoskrnl/mm/ARM3/arm/init.c
ntoskrnl/mm/ARM3/contmem.c
ntoskrnl/mm/ARM3/drvmgmt.c
ntoskrnl/mm/ARM3/dynamic.c
ntoskrnl/mm/ARM3/expool.c
ntoskrnl/mm/ARM3/hypermap.c
ntoskrnl/mm/ARM3/i386/init.c
ntoskrnl/mm/ARM3/iosup.c
ntoskrnl/mm/ARM3/largepag.c
ntoskrnl/mm/ARM3/mdlsup.c
ntoskrnl/mm/ARM3/miarm.h
ntoskrnl/mm/ARM3/mmdbg.c
ntoskrnl/mm/ARM3/mminit.c
ntoskrnl/mm/ARM3/mmsup.c
ntoskrnl/mm/ARM3/ncache.c
ntoskrnl/mm/ARM3/pagfault.c
ntoskrnl/mm/ARM3/pfnlist.c
ntoskrnl/mm/ARM3/pool.c
ntoskrnl/mm/ARM3/procsup.c
ntoskrnl/mm/ARM3/section.c
ntoskrnl/mm/ARM3/sysldr.c
ntoskrnl/mm/ARM3/syspte.c
ntoskrnl/mm/ARM3/vadnode.c
ntoskrnl/mm/ARM3/virtual.c
ntoskrnl/mm/ARM3/zeropage.c
ntoskrnl/mm/arm/page.c
ntoskrnl/mm/rmap.c
ntoskrnl/mm/section.c
ntoskrnl/ob/oblife.c
ntoskrnl/po/power.c
subsystems/win32/csrss/win32csr/desktopbg.c
subsystems/win32/win32k/CMakeLists.txt
subsystems/win32/win32k/eng/alphablend.c
subsystems/win32/win32k/eng/device.c
subsystems/win32/win32k/eng/engevent.c
subsystems/win32/win32k/eng/error.c
subsystems/win32/win32k/eng/ldevobj.c
subsystems/win32/win32k/eng/pdevobj.c
subsystems/win32/win32k/include/engevent.h
subsystems/win32/win32k/include/misc.h
subsystems/win32/win32k/include/msgqueue.h
subsystems/win32/win32k/include/win32.h
subsystems/win32/win32k/include/win32kp.h
subsystems/win32/win32k/main/dllmain.c
subsystems/win32/win32k/ntddraw/ddraw.c
subsystems/win32/win32k/ntuser/accelerator.c
subsystems/win32/win32k/ntuser/caret.c
subsystems/win32/win32k/ntuser/class.c
subsystems/win32/win32k/ntuser/clipboard.c
subsystems/win32/win32k/ntuser/cursoricon.c
subsystems/win32/win32k/ntuser/desktop.c
subsystems/win32/win32k/ntuser/display.c
subsystems/win32/win32k/ntuser/event.c
subsystems/win32/win32k/ntuser/focus.c
subsystems/win32/win32k/ntuser/hook.c
subsystems/win32/win32k/ntuser/input.c
subsystems/win32/win32k/ntuser/kbdlayout.c
subsystems/win32/win32k/ntuser/menu.c
subsystems/win32/win32k/ntuser/message.c
subsystems/win32/win32k/ntuser/misc.c
subsystems/win32/win32k/ntuser/monitor.c
subsystems/win32/win32k/ntuser/msgqueue.c
subsystems/win32/win32k/ntuser/ntstubs.c
subsystems/win32/win32k/ntuser/object.c
subsystems/win32/win32k/ntuser/painting.c
subsystems/win32/win32k/ntuser/scrollbar.c
subsystems/win32/win32k/ntuser/simplecall.c
subsystems/win32/win32k/ntuser/sysparams.c
subsystems/win32/win32k/ntuser/timer.c
subsystems/win32/win32k/ntuser/window.c
subsystems/win32/win32k/ntuser/winpos.c
subsystems/win32/win32k/ntuser/winsta.c
subsystems/win32/win32k/objects/arc.c
subsystems/win32/win32k/objects/bitblt.c
subsystems/win32/win32k/objects/bitmaps.c
subsystems/win32/win32k/objects/brush.c
subsystems/win32/win32k/objects/cliprgn.c
subsystems/win32/win32k/objects/coord.c
subsystems/win32/win32k/objects/dclife.c
subsystems/win32/win32k/objects/dcobjs.c
subsystems/win32/win32k/objects/dcstate.c
subsystems/win32/win32k/objects/dcutil.c
subsystems/win32/win32k/objects/device.c
subsystems/win32/win32k/objects/dibobj.c
subsystems/win32/win32k/objects/drawing.c
subsystems/win32/win32k/objects/fillshap.c
subsystems/win32/win32k/objects/font.c
subsystems/win32/win32k/objects/freetype.c
subsystems/win32/win32k/objects/gdiobj.c
subsystems/win32/win32k/objects/icm.c
subsystems/win32/win32k/objects/line.c
subsystems/win32/win32k/objects/metafile.c
subsystems/win32/win32k/objects/palette.c
subsystems/win32/win32k/objects/path.c
subsystems/win32/win32k/objects/pen.c
subsystems/win32/win32k/objects/print.c
subsystems/win32/win32k/objects/region.c
subsystems/win32/win32k/objects/text.c
subsystems/win32/win32k/objects/wingl.c
subsystems/win32/win32k/w32ksvc.db
toolchain-mingw32.cmake

index bf2d6b9,0000000..a1a754b
mode 100644,000000..100644
--- /dev/null
@@@ -1,270 -1,0 +1,270 @@@
-         COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_DLLDATA_ARG}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}\r
 +\r
 +if (NOT MSVC)\r
 +\r
 +macro(CreateBootSectorTarget _target_name _asm_file _object_file)\r
 +    get_filename_component(OBJECT_PATH ${_object_file} PATH)\r
 +    get_filename_component(OBJECT_NAME ${_object_file} NAME)\r
 +    file(MAKE_DIRECTORY ${OBJECT_PATH})\r
 +    get_directory_property(defines COMPILE_DEFINITIONS)\r
 +    get_directory_property(includes INCLUDE_DIRECTORIES)\r
 +\r
 +    foreach(arg ${defines})\r
 +        set(result_defs ${result_defs} -D${arg})\r
 +    endforeach()\r
 +\r
 +    foreach(arg ${includes})\r
 +        set(result_incs -I${arg} ${result_incs})\r
 +    endforeach()\r
 +\r
 +    add_custom_command(\r
 +        OUTPUT ${_object_file}\r
 +        COMMAND nasm -o ${_object_file} ${result_incs} ${result_defs} -f bin ${_asm_file}\r
 +        DEPENDS ${_asm_file})\r
 +    set_source_files_properties(${_object_file} PROPERTIES GENERATED TRUE)\r
 +    add_custom_target(${_target_name} ALL DEPENDS ${_object_file})\r
 +    add_minicd(${_object_file} loader ${OBJECT_NAME})\r
 +endmacro()\r
 +\r
 +else()\r
 +\r
 +macro(CreateBootSectorTarget _target_name _asm_file _object_file)\r
 +endmacro()\r
 +\r
 +endif()\r
 +\r
 +macro(idl_compile_object OBJECT SOURCE)\r
 +    get_property(FLAGS SOURCE ${SOURCE} PROPERTY COMPILE_FLAGS)\r
 +    get_property(DEFINES SOURCE ${SOURCE} PROPERTY COMPILE_DEFINITIONS)\r
 +    get_property(INCLUDE_DIRECTORIES DIRECTORY PROPERTY INCLUDE_DIRECTORIES)\r
 +\r
 +    foreach(DIR ${INCLUDE_DIRECTORIES})\r
 +        set(FLAGS "${FLAGS} -I${DIR}")\r
 +    endforeach()\r
 +\r
 +    set(IDL_COMMAND ${CMAKE_IDL_COMPILE_OBJECT})\r
 +    string(REPLACE "<CMAKE_IDL_COMPILER>" "${CMAKE_IDL_COMPILER}" IDL_COMMAND "${IDL_COMMAND}")\r
 +    string(REPLACE <FLAGS> "${FLAGS}" IDL_COMMAND "${IDL_COMMAND}")\r
 +    string(REPLACE "<DEFINES>" "${DEFINES}" IDL_COMMAND "${IDL_COMMAND}")\r
 +    string(REPLACE "<OBJECT>" "${OBJECT}" IDL_COMMAND "${IDL_COMMAND}")\r
 +    string(REPLACE "<SOURCE>" "${SOURCE}" IDL_COMMAND "${IDL_COMMAND}")\r
 +    separate_arguments(IDL_COMMAND)\r
 +\r
 +    add_custom_command(\r
 +        OUTPUT ${OBJECT}\r
 +        COMMAND ${IDL_COMMAND}\r
 +        DEPENDS ${SOURCE}\r
 +        VERBATIM)\r
 +endmacro()\r
 +\r
 +macro(add_interface_definitions TARGET)\r
 +    foreach(SOURCE ${ARGN})\r
 +        get_filename_component(FILE ${SOURCE} NAME_WE)\r
 +        set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.h)\r
 +        idl_compile_object(${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE})\r
 +        list(APPEND OBJECTS ${OBJECT})\r
 +    endforeach()\r
 +    add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})\r
 +endmacro()\r
 +\r
 +macro(add_minicd_target _targetname _dir) # optional parameter: _nameoncd\r
 +    if("${ARGN}" STREQUAL "")\r
 +        get_target_property(FILENAME ${_targetname} LOCATION)\r
 +        get_filename_component(_nameoncd ${FILENAME} NAME)\r
 +    else()\r
 +        set(_nameoncd ${ARGN})\r
 +    endif()\r
 +\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n")\r
 +endmacro()\r
 +\r
 +macro(add_minicd FILENAME _dir _nameoncd)\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n")\r
 +endmacro()\r
 +\r
 +macro(set_cpp)\r
 +    include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/c++/stlport)\r
 +    set(IS_CPP 1)\r
 +    add_definitions(\r
 +        -DNATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/include/c++\r
 +        -DNATIVE_C_INCLUDE=${REACTOS_SOURCE_DIR}/include/crt)\r
 +endmacro()\r
 +\r
 +macro(add_livecd_target _targetname _dir )# optional parameter : _nameoncd\r
 +    if("${ARGN}" STREQUAL "")\r
 +        get_target_property(FILENAME ${_targetname} LOCATION)\r
 +        get_filename_component(_nameoncd ${FILENAME} NAME)\r
 +    else()\r
 +        set(_nameoncd ${ARGN})\r
 +    endif()\r
 +\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n")\r
 +endmacro()\r
 +\r
 +macro(add_livecd FILENAME _dir)# optional parameter : _nameoncd\r
 +    if("${ARGN}" STREQUAL "")\r
 +        get_filename_component(_nameoncd ${FILENAME} NAME)\r
 +    else()\r
 +        set(_nameoncd ${ARGN})\r
 +    endif()\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n")\r
 +endmacro()\r
 +\r
 +macro(cab_to_dir _dir_num _var_name)\r
 +#   1 = system32\r
 +#   2 = system32\drivers\r
 +#   3 = Fonts\r
 +#   4 =\r
 +#   5 = system32\drivers\etc\r
 +#   6 = inf\r
 +#   7 = bin\r
 +#   8 = media\r
 +    if(${_dir_num} STREQUAL "1")\r
 +        set(${_var_name} "reactos/system32")\r
 +    elseif(${_dir_num} STREQUAL "2")\r
 +        set(${_var_name} "reactos/system32/drivers")\r
 +    elseif(${_dir_num} STREQUAL "3")\r
 +        set(${_var_name} "reactos/fonts")\r
 +    elseif(${_dir_num} STREQUAL "4")\r
 +        set(${_var_name} "reactos")\r
 +    elseif(${_dir_num} STREQUAL "5")\r
 +        set(${_var_name} "reactos/system32/drivers/etc")\r
 +    elseif(${_dir_num} STREQUAL "6")\r
 +        set(${_var_name} "reactos/inf")\r
 +    elseif(${_dir_num} STREQUAL "7")\r
 +        set(${_var_name} "reactos/bin")\r
 +    elseif(${_dir_num} STREQUAL "8")\r
 +        set(${_var_name} "reactos/system32/drivers")\r
 +    else()\r
 +        message(FATAL_ERROR "Wrong directory ${_dir_num}")\r
 +    endif()\r
 +endmacro()\r
 +\r
 +macro(add_cab_target _targetname _num )\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt "${_targetname}\t${_num}\n")\r
 +    cab_to_dir(${_num} _dir)\r
 +    add_livecd_target(${_targetname} ${_dir})\r
 +endmacro()\r
 +\r
 +macro(add_cab FILENAME _num)\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab.txt "${FILENAME}\t${_num}\n")\r
 +    cab_to_dir(${_num} _dir)\r
 +    add_livecd(${FILENAME} ${_dir})\r
 +endmacro()\r
 +\r
 +macro(custom_incdefs)\r
 +    if(NOT DEFINED result_incs) #rpc_defines\r
 +        get_directory_property(rpc_defines COMPILE_DEFINITIONS)\r
 +        get_directory_property(rpc_includes INCLUDE_DIRECTORIES)\r
 +\r
 +        foreach(arg ${rpc_defines})\r
 +            set(result_defs ${result_defs} -D${arg})\r
 +        endforeach()\r
 +\r
 +        foreach(arg ${rpc_includes})\r
 +            set(result_incs -I${arg} ${result_incs})\r
 +        endforeach()\r
 +    endif()\r
 +endmacro()\r
 +\r
 +macro(rpcproxy TARGET)\r
 +    custom_incdefs()\r
 +    list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)\r
 +\r
 +    foreach(_in_FILE ${ARGN})\r
 +        get_filename_component(FILE ${_in_FILE} NAME_WE)\r
 +        add_custom_command(\r
 +            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c\r
 +            COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h ${IDL_PROXY_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
 +            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)\r
 +        set_source_files_properties(\r
 +            ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c\r
 +            PROPERTIES GENERATED TRUE)\r
 +        list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)\r
 +        list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)\r
 +    endforeach()\r
 +\r
 +    add_custom_command(\r
 +        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c\r
-             COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
++        COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_DLLDATA_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}\r
 +        DEPENDS ${IDLS})\r
 +    set_source_files_properties(\r
 +        ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c\r
 +        PROPERTIES GENERATED TRUE)\r
 +endmacro()\r
 +\r
 +macro(idl_files)\r
 +    custom_incdefs()\r
 +    foreach(_in_FILE ${ARGN})\r
 +        get_filename_component(FILE ${_in_FILE} NAME_WE)\r
 +        add_custom_command(\r
 +            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c\r
-             COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
++            COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
 +            DEPENDS ${_in_file})\r
 +        set_source_files_properties(\r
 +            ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c\r
 +            PROPERTIES GENERATED TRUE)\r
 +        add_library(${FILE}_server ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)\r
 +        add_dependencies(${FILE}_server psdk)\r
 +\r
 +        add_custom_command(\r
 +            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c\r
-         COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} -u -U ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}\r
++            COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
 +            DEPENDS ${_in_file})\r
 +        set_source_files_properties(\r
 +            ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c\r
 +            PROPERTIES GENERATED TRUE)\r
 +        add_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)\r
 +        add_dependencies(${FILE}_client psdk)\r
 +    endforeach()\r
 +endmacro()\r
 +\r
 +macro(add_typelib TARGET)\r
 +    custom_incdefs()\r
 +    foreach(SOURCE ${ARGN})\r
 +        get_filename_component(FILE ${SOURCE} NAME_WE)\r
 +        set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb)\r
 +        add_custom_command(\r
 +            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb\r
 +            COMMAND ${IDL_COMPILER} ${result_incs} ${IDL_FLAGS} ${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}\r
 +            DEPENDS ${SOURCE})\r
 +        list(APPEND OBJECTS ${OBJECT})\r
 +    endforeach()\r
 +    add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})\r
 +endmacro()\r
 +\r
 +macro(add_idl_interface IDL_FILE)\r
 +    custom_incdefs()\r
 +    get_filename_component(FILE ${IDL_FILE} NAME_WE)\r
 +    add_custom_command(\r
 +        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c\r
++        COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_INTERFACE_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}\r
 +        DEPENDS ${IDL_FILE})\r
 +    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c PROPERTIES GENERATED TRUE)\r
 +endmacro()\r
 +\r
 +macro(add_dependency_node _node)\r
 +    if(GENERATE_DEPENDENCY_GRAPH)\r
 +        get_target_property(_type ${_node} TYPE)\r
 +        if(_type MATCHES SHARED_LIBRARY)\r
 +            file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "    <node id=\"${_node}\"/>\n")\r
 +        endif()\r
 +     endif()\r
 +endmacro()\r
 +\r
 +macro(add_dependency_edge _source _target)\r
 +    if(GENERATE_DEPENDENCY_GRAPH)\r
 +        get_target_property(_type ${_source} TYPE)\r
 +        if(_type MATCHES SHARED_LIBRARY)\r
 +            file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "    <edge source=\"${_source}\" target=\"${_target}\"/>\n")\r
 +        endif()\r
 +    endif()\r
 +endmacro()\r
 +\r
 +macro(add_dependency_header)\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<graphml>\n  <graph id=\"ReactOS dependencies\" edgedefault=\"directed\">\n")\r
 +    add_dependency_node(ntdll)\r
 +endmacro()\r
 +\r
 +macro(add_dependency_footer)\r
 +    file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "  </graph>\n</graphml>\n")\r
 +endmacro()\r
index 201c623,0000000..c76ee13
mode 100644,000000..100644
--- /dev/null
@@@ -1,36 -1,0 +1,37 @@@
 +
 +add_subdirectory(cacls)
 +add_subdirectory(calc)
 +add_subdirectory(charmap)
 +add_subdirectory(cmdutils)
 +add_subdirectory(control)
 +add_subdirectory(dxdiag)
 +add_subdirectory(extrac32)
++add_subdirectory(findstr)
 +add_subdirectory(fontview)
 +add_subdirectory(games)
 +add_subdirectory(hh)
 +add_subdirectory(iexplore)
 +add_subdirectory(kbswitch)
 +add_subdirectory(logoff)
 +add_subdirectory(magnify)
 +add_subdirectory(mmc)
 +add_subdirectory(mplay32)
 +add_subdirectory(msconfig)
 +add_subdirectory(mscutils)
 +add_subdirectory(mstsc)
 +add_subdirectory(network)
 +add_subdirectory(notepad)
 +add_subdirectory(paint)
 +add_subdirectory(rapps)
 +add_subdirectory(regedit)
 +add_subdirectory(regedt32)
 +add_subdirectory(sc)
 +add_subdirectory(screensavers)
 +add_subdirectory(shutdown)
 +#add_subdirectory(sndrec32)
 +add_subdirectory(sndvol32)
 +add_subdirectory(taskmgr)
 +add_subdirectory(winhlp32)
 +add_subdirectory(winver)
 +add_subdirectory(wordpad)
 +add_subdirectory(write)
Simple merge
Simple merge
Simple merge
index 0000000,0000000..bcb2633
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,11 @@@
++
++add_definitions(-D_DLL -D__USE_CRTIMP)
++
++add_executable(findstr
++    findstr.c
++    findstr.rc
++    rsrc.rc)
++
++set_module_type(findstr win32cui)
++add_importlibs(findstr user32 msvcrt kernel32)
++add_cab_target(findstr 1)
Simple merge
index b9a6bb3,0000000..4be2390
mode 100644,000000..100644
--- /dev/null
@@@ -1,11 -1,0 +1,12 @@@
 +#include "lang/bg-BG.rc"
++#include "lang/cs-CZ.rc"
 +#include "lang/de-DE.rc"
 +#include "lang/en-US.rc"
 +#include "lang/es-ES.rc"
 +#include "lang/it-IT.rc"
 +//#include "lang/ja-JP.rc" FIXME: iconv issue
 +#include "lang/no-NO.rc"
 +#include "lang/pl-PL.rc"
 +#include "lang/ru-RU.rc"
 +#include "lang/sk-SK.rc"
 +#include "lang/uk-UA.rc"
Simple merge
Simple merge
Simple merge
Simple merge
index d11c8a0,0000000..5d9a682
mode 100644,000000..100644
--- /dev/null
@@@ -1,1159 -1,0 +1,1187 @@@
-     if (IsWindowVisible(hStatusBar)) {
 +/*
 + * Regedit frame window
 + *
 + * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * This library is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 + */
 +
 +#include <regedit.h>
 +
 +/********************************************************************************
 + * Global and Local Variables:
 + */
 +
 +#define FAVORITES_MENU_POSITION 3
 +
 +static TCHAR s_szFavoritesRegKey[] = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Favorites");
 +
 +static BOOL bInMenuLoop = FALSE;        /* Tells us if we are in the menu loop */
 +
 +/*******************************************************************************
 + * Local module support methods
 + */
 +
 +static void resize_frame_rect(HWND hWnd, PRECT prect)
 +{
 +    RECT rt;
 +    /*
 +      if (IsWindowVisible(hToolBar)) {
 +              SendMessage(hToolBar, WM_SIZE, 0, 0);
 +              GetClientRect(hToolBar, &rt);
 +              prect->top = rt.bottom+3;
 +              prect->bottom -= rt.bottom+3;
 +      }
 +     */
-     if (nFlags & MF_POPUP) {
-         if (hSysMenu != GetMenu(hWnd)) {
++    if (IsWindowVisible(hStatusBar))
++    {
 +        SetupStatusBar(hWnd, TRUE);
 +        GetClientRect(hStatusBar, &rt);
 +        prect->bottom -= rt.bottom;
 +    }
 +    MoveWindow(g_pChildWnd->hWnd, prect->left, prect->top, prect->right, prect->bottom, TRUE);
 +}
 +
 +static void resize_frame_client(HWND hWnd)
 +{
 +    RECT rect;
 +
 +    GetClientRect(hWnd, &rect);
 +    resize_frame_rect(hWnd, &rect);
 +}
 +
 +/********************************************************************************/
 +
 +static void OnInitMenu(HWND hWnd)
 +{
 +    LONG lResult;
 +    HKEY hKey = NULL;
 +    DWORD dwIndex, cbValueName, cbValueData, dwType;
 +    TCHAR szValueName[256];
 +    BYTE abValueData[256];
 +    static int s_nFavoriteMenuSubPos = -1;
 +    HMENU hMenu;
 +    BOOL bDisplayedAny = FALSE;
 +
 +    /* Find Favorites menu and clear it out */
 +    hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
 +    if (!hMenu)
 +        goto done;
 +    if (s_nFavoriteMenuSubPos < 0)
 +    {
 +        s_nFavoriteMenuSubPos = GetMenuItemCount(hMenu);
 +    }
 +    else
 +    {
 +        while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION))
 +            ;
 +    }
 +
 +    lResult = RegOpenKey(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
 +    if (lResult != ERROR_SUCCESS)
 +        goto done;
 +
 +    dwIndex = 0;
 +    do
 +    {
 +        cbValueName = COUNT_OF(szValueName);
 +        cbValueData = sizeof(abValueData);
 +        lResult = RegEnumValue(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
 +        if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
 +        {
 +            if (!bDisplayedAny)
 +            {
 +                AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
 +                bDisplayedAny = TRUE;
 +            }
 +            AppendMenu(hMenu, 0, ID_FAVORITES_MIN + GetMenuItemCount(hMenu), szValueName);
 +        }
 +        dwIndex++;
 +    }
 +    while(lResult == ERROR_SUCCESS);
 +
 +done:
 +    if (hKey)
 +        RegCloseKey(hKey);
 +}
 +
 +static void OnEnterMenuLoop(HWND hWnd)
 +{
 +    int nParts;
 +    UNREFERENCED_PARAMETER(hWnd);
 +
 +    /* Update the status bar pane sizes */
 +    nParts = -1;
 +    SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
 +    bInMenuLoop = TRUE;
 +    SendMessage(hStatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)_T(""));
 +}
 +
 +static void OnExitMenuLoop(HWND hWnd)
 +{
 +    bInMenuLoop = FALSE;
 +    /* Update the status bar pane sizes*/
 +    SetupStatusBar(hWnd, TRUE);
 +    UpdateStatusBar();
 +}
 +
 +static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
 +{
 +    TCHAR str[100];
 +
 +    _tcscpy(str, _T(""));
-     if (LoadString(hInst, nItemID, str, 100)) {
++    if (nFlags & MF_POPUP)
++    {
++        if (hSysMenu != GetMenu(hWnd))
++        {
 +            if (nItemID == 2) nItemID = 5;
 +        }
 +    }
-       NMHDR nmhdr;
-       ZeroMemory(&nmhdr, sizeof(NMHDR));
++    if (LoadString(hInst, nItemID, str, 100))
++    {
 +        /* load appropriate string*/
 +        LPTSTR lpsz = str;
 +        /* first newline terminates actual string*/
 +        lpsz = _tcschr(lpsz, _T('\n'));
 +        if (lpsz != NULL)
 +            *lpsz = '\0';
 +    }
 +    SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)str);
 +}
 +
 +void SetupStatusBar(HWND hWnd, BOOL bResize)
 +{
 +    RECT  rc;
 +    int nParts;
 +    GetClientRect(hWnd, &rc);
 +    nParts = rc.right;
 +    /*    nParts = -1;*/
 +    if (bResize)
 +        SendMessage(hStatusBar, WM_SIZE, 0, 0);
 +    SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
 +}
 +
 +void UpdateStatusBar(void)
 +{
-     switch (dwErrorCode) {
++    NMHDR nmhdr;
++    ZeroMemory(&nmhdr, sizeof(NMHDR));
 +    nmhdr.code = TVN_SELCHANGED;
 +    SendMessage(g_pChildWnd->hWnd, WM_NOTIFY, (WPARAM)TREE_WINDOW, (LPARAM)&nmhdr);
 +}
 +
 +static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
 +{
 +    BOOL vis = IsWindowVisible(hchild);
 +    HMENU hMenuView = GetSubMenu(hMenuFrame, ID_VIEW_MENU);
 +
 +    CheckMenuItem(hMenuView, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
 +    ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
 +    resize_frame_client(hWnd);
 +}
 +
 +static BOOL CheckCommDlgError(HWND hWnd)
 +{
 +    DWORD dwErrorCode = CommDlgExtendedError();
 +    UNREFERENCED_PARAMETER(hWnd);
-   UINT DisplayID;
-   UINT FilterID;
++    switch (dwErrorCode)
++    {
 +    case CDERR_DIALOGFAILURE:
 +        break;
 +    case CDERR_FINDRESFAILURE:
 +        break;
 +    case CDERR_NOHINSTANCE:
 +        break;
 +    case CDERR_INITIALIZATION:
 +        break;
 +    case CDERR_NOHOOK:
 +        break;
 +    case CDERR_LOCKRESFAILURE:
 +        break;
 +    case CDERR_NOTEMPLATE:
 +        break;
 +    case CDERR_LOADRESFAILURE:
 +        break;
 +    case CDERR_STRUCTSIZE:
 +        break;
 +    case CDERR_LOADSTRFAILURE:
 +        break;
 +    case FNERR_BUFFERTOOSMALL:
 +        break;
 +    case CDERR_MEMALLOCFAILURE:
 +        break;
 +    case FNERR_INVALIDFILENAME:
 +        break;
 +    case CDERR_MEMLOCKFAILURE:
 +        break;
 +    case FNERR_SUBCLASSFAILURE:
 +        break;
 +    default:
 +        break;
 +    }
 +    return TRUE;
 +}
 +
 +TCHAR FileNameBuffer[_MAX_PATH];
 +TCHAR FileTitleBuffer[_MAX_PATH];
 +
 +typedef struct
 +{
-   int i, c;
++    UINT DisplayID;
++    UINT FilterID;
 +} FILTERPAIR, *PFILTERPAIR;
 +
 +void
 +BuildFilterStrings(TCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
 +{
-   c = 0;
-   for(i = 0; i < PairCount; i++)
-   {
-     c += LoadString(hInst, Pairs[i].DisplayID, &Filter[c], 255 * sizeof(TCHAR));
-     Filter[++c] = '\0';
-     c += LoadString(hInst, Pairs[i].FilterID, &Filter[c], 255 * sizeof(TCHAR));
++    int i, c;
 +
-   }
-   Filter[++c] = '\0';
++    c = 0;
++    for(i = 0; i < PairCount; i++)
++    {
++        c += LoadString(hInst, Pairs[i].DisplayID, &Filter[c], 255 * sizeof(TCHAR));
++        Filter[++c] = '\0';
++        c += LoadString(hInst, Pairs[i].FilterID, &Filter[c], 255 * sizeof(TCHAR));
++        Filter[++c] = '\0';
++    }
 +    Filter[++c] = '\0';
-      case WM_INITDIALOG:
 +}
 +
 +static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
 +{
 +    FILTERPAIR FilterPairs[3];
 +    static TCHAR Filter[1024];
 +
 +    memset(pofn, 0, sizeof(OPENFILENAME));
 +    pofn->lStructSize = sizeof(OPENFILENAME);
 +    pofn->hwndOwner = hWnd;
 +    pofn->hInstance = hInst;
 +
 +    /* create filter string */
 +    FilterPairs[0].DisplayID = IDS_FLT_REGFILES;
 +    FilterPairs[0].FilterID = IDS_FLT_REGFILES_FLT;
 +    FilterPairs[1].DisplayID = IDS_FLT_REGEDIT4;
 +    FilterPairs[1].FilterID = IDS_FLT_REGEDIT4_FLT;
 +    FilterPairs[2].DisplayID = IDS_FLT_ALLFILES;
 +    FilterPairs[2].FilterID = IDS_FLT_ALLFILES_FLT;
 +    BuildFilterStrings(Filter, FilterPairs, sizeof(FilterPairs) / sizeof(FILTERPAIR));
 +
 +    pofn->lpstrFilter = Filter;
 +    pofn->lpstrFile = FileNameBuffer;
 +    pofn->nMaxFile = _MAX_PATH;
 +    pofn->lpstrFileTitle = FileTitleBuffer;
 +    pofn->nMaxFileTitle = _MAX_PATH;
 +    pofn->Flags = OFN_HIDEREADONLY;
 +    pofn->lpstrDefExt = TEXT("reg");
 +    return TRUE;
 +}
 +
 +static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 +{
 +    static LPTSTR sKey = NULL;
 +    static INT sLength = 0;
 +    switch(uMsg)
 +    {
-      case WM_COMMAND:
++    case WM_INITDIALOG:
 +        sKey = (LPTSTR)lParam;
 +        sLength = 128; /* FIXME: Ugly hack! */
-          case IDOK:
++    case WM_COMMAND:
 +        switch(LOWORD(wParam))
 +        {
-          case IDCANCEL:
++        case IDOK:
 +            if(GetDlgItemText(hWndDlg, IDC_EDIT_KEY, sKey, sLength))
 +                return EndDialog(hWndDlg, -1);
 +            else
 +                return EndDialog(hWndDlg, 0);
-     } else {
++        case IDCANCEL:
 +            return EndDialog(hWndDlg, 0);
 +        }
 +        break;
 +    }
 +    return FALSE;
 +}
 +
 +static BOOL LoadHive(HWND hWnd)
 +{
 +    OPENFILENAME ofn;
 +    TCHAR Caption[128];
 +    LPCTSTR pszKeyPath;
 +    TCHAR xPath[128];
 +    HKEY hRootKey;
 +    TCHAR Filter[1024];
 +    FILTERPAIR filter;
 +    /* get the item key to load the hive in */
 +    pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
 +    /* initialize the "open file" dialog */
 +    InitOpenFileName(hWnd, &ofn);
 +    /* build the "All Files" filter up */
 +    filter.DisplayID = IDS_FLT_ALLFILES;
 +    filter.FilterID = IDS_FLT_ALLFILES_FLT;
 +    BuildFilterStrings(Filter, &filter, sizeof(filter));
 +    ofn.lpstrFilter = Filter;
 +    /* load and set the caption and flags for dialog */
 +    LoadString(hInst, IDS_LOAD_HIVE, Caption, COUNT_OF(Caption));
 +    ofn.lpstrTitle = Caption;
 +    ofn.Flags |= OFN_ENABLESIZING;
 +    /*    ofn.lCustData = ;*/
 +    /* now load the hive */
 +    if (GetOpenFileName(&ofn))
 +    {
 +        if(DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_LOADHIVE), hWnd, &LoadHive_KeyNameInHookProc, (LPARAM)xPath))
 +        {
 +            LONG regLoadResult = RegLoadKey(hRootKey, xPath, ofn.lpstrFile);
 +            if(regLoadResult == ERROR_SUCCESS)
 +            {
 +                /* refresh tree and list views */
 +                RefreshTreeView(g_pChildWnd->hTreeWnd);
 +                pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
 +                RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
 +            }
 +            else
 +            {
 +                ErrorMessageBox(hWnd, Caption, regLoadResult);
 +                return FALSE;
 +            }
 +        }
-     if (GetOpenFileName(&ofn)) {
++    }
++    else
++    {
 +        CheckCommDlgError(hWnd);
 +    }
 +    return TRUE;
 +}
 +
 +static BOOL UnloadHive(HWND hWnd)
 +{
 +    TCHAR Caption[128];
 +    LPCTSTR pszKeyPath;
 +    HKEY hRootKey;
 +    LONG regUnloadResult;
 +
 +    /* get the item key to unload */
 +    pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
 +    /* load and set the caption and flags for dialog */
 +    LoadString(hInst, IDS_UNLOAD_HIVE, Caption, COUNT_OF(Caption));
 +    /* now unload the hive */
 +    regUnloadResult = RegUnLoadKey(hRootKey, pszKeyPath);
 +    if(regUnloadResult == ERROR_SUCCESS)
 +    {
 +        /* refresh tree and list views */
 +        RefreshTreeView(g_pChildWnd->hTreeWnd);
 +        pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
 +        RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
 +    }
 +    else
 +    {
 +        ErrorMessageBox(hWnd, Caption, regUnloadResult);
 +        return FALSE;
 +    }
 +    return TRUE;
 +}
 +
 +static BOOL ImportRegistryFile(HWND hWnd)
 +{
 +    OPENFILENAME ofn;
 +    TCHAR Caption[128];
 +    LPCTSTR pszKeyPath;
 +    HKEY hRootKey;
 +
 +    InitOpenFileName(hWnd, &ofn);
 +    LoadString(hInst, IDS_IMPORT_REG_FILE, Caption, COUNT_OF(Caption));
 +    ofn.lpstrTitle = Caption;
 +    ofn.Flags |= OFN_ENABLESIZING;
 +    /*    ofn.lCustData = ;*/
-         if (fp == NULL || !import_registry_file(fp)) {
++    if (GetOpenFileName(&ofn))
++    {
 +        FILE *fp = _wfopen(ofn.lpstrFile, L"r");
-     } else {
++        if (fp == NULL || !import_registry_file(fp))
++        {
 +            LPSTR p = GetMultiByteString(ofn.lpstrFile);
 +            fprintf(stderr, "Can't open file \"%s\"\n", p);
 +            HeapFree(GetProcessHeap(), 0, p);
 +            if (fp != NULL)
 +                fclose(fp);
 +            return FALSE;
 +        }
 +        fclose(fp);
-       switch(uiMsg) {
-       case WM_INITDIALOG:
++    }
++    else
++    {
 +        CheckCommDlgError(hWnd);
 +    }
 +
 +    RefreshTreeView(g_pChildWnd->hTreeWnd);
 +    pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
 +    RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
 +
 +    return TRUE;
 +}
 +
 +static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
 +{
 +    HWND hwndExportAll;
 +    HWND hwndExportBranch;
 +    HWND hwndExportBranchText;
 +    UINT_PTR iResult = 0;
 +    OPENFILENAME *pOfn;
 +    LPTSTR pszSelectedKey;
 +    OFNOTIFY *pOfnNotify;
 +
 +    UNREFERENCED_PARAMETER(wParam);
 +
-       case WM_NOTIFY:
++    switch(uiMsg)
++    {
++    case WM_INITDIALOG:
 +        pOfn = (OPENFILENAME *) lParam;
 +        pszSelectedKey = (LPTSTR) pOfn->lCustData;
 +
 +        hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
 +        if (hwndExportAll)
 +            SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
 +
 +        hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
 +        if (hwndExportBranch)
 +            SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
 +
 +        hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
 +        if (hwndExportBranchText)
 +            SetWindowText(hwndExportBranchText, pszSelectedKey);
 +        break;
 +
-                 && (SendMessage(hwndExportBranch, BM_GETCHECK, 0, 0) == BST_CHECKED))
-                       {
-                           GetWindowText(hwndExportBranchText, pszSelectedKey, _MAX_PATH);
-                       }
-                       else
-                       {
-                           pszSelectedKey[0] = '\0';
-                       }
-               }
++    case WM_NOTIFY:
 +        if (((NMHDR *) lParam)->code == CDN_FILEOK)
 +        {
 +            pOfnNotify = (OFNOTIFY *) lParam;
 +            pszSelectedKey = (LPTSTR) pOfnNotify->lpOFN->lCustData;
 +
 +            hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
 +            hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
 +            if (hwndExportBranch && hwndExportBranchText
-     if (GetSaveFileName(&ofn)) {
++                    && (SendMessage(hwndExportBranch, BM_GETCHECK, 0, 0) == BST_CHECKED))
++            {
++                GetWindowText(hwndExportBranchText, pszSelectedKey, _MAX_PATH);
++            }
++            else
++            {
++                pszSelectedKey[0] = '\0';
++            }
++        }
 +        break;
 +    }
 +    return iResult;
 +}
 +
 +BOOL ExportRegistryFile(HWND hWnd)
 +{
 +    OPENFILENAME ofn;
 +    TCHAR ExportKeyPath[_MAX_PATH];
 +    TCHAR Caption[128];
 +    HKEY hKeyRoot;
 +    LPCTSTR pszKeyPath;
 +
 +    /* Figure out which key path we are exporting */
 +    pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
 +    GetKeyName(ExportKeyPath, COUNT_OF(ExportKeyPath), hKeyRoot, pszKeyPath);
 +
 +    InitOpenFileName(hWnd, &ofn);
 +    LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, sizeof(Caption)/sizeof(TCHAR));
 +    ofn.lpstrTitle = Caption;
 +
 +    /* Only set the path if a key (not the root node) is selected */
 +    if (hKeyRoot != 0)
 +    {
 +        ofn.lCustData = (LPARAM) ExportKeyPath;
 +    }
 +    ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_OVERWRITEPROMPT;
 +    ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
 +    ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);
-         if (!result) {
++    if (GetSaveFileName(&ofn))
++    {
 +        BOOL result;
 +        DWORD format;
 +
 +        if (ofn.nFilterIndex == 1)
 +            format = REG_FORMAT_5;
 +        else
 +            format = REG_FORMAT_4;
 +        result = export_registry_key(ofn.lpstrFile, ExportKeyPath, format);
-     } else {
++        if (!result)
++        {
 +            LPSTR p = GetMultiByteString(ofn.lpstrFile);
 +            fprintf(stderr, "Can't open file \"%s\"\n", p);
 +            HeapFree(GetProcessHeap(), 0, p);
 +            return FALSE;
 +        }
-     if (PrintDlg(&pd)) {
++    }
++    else
++    {
 +        CheckCommDlgError(hWnd);
 +    }
 +    return TRUE;
 +}
 +
 +BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
 +{
 +#if 1
 +    PRINTDLG pd;
 +    UNREFERENCED_PARAMETER(path);
 +
 +    ZeroMemory(&pd, sizeof(PRINTDLG));
 +    pd.lStructSize = sizeof(PRINTDLG);
 +    pd.hwndOwner   = hWnd;
 +    pd.hDevMode    = NULL;     /* Don't forget to free or store hDevMode*/
 +    pd.hDevNames   = NULL;     /* Don't forget to free or store hDevNames*/
 +    pd.Flags       = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC;
 +    pd.nCopies     = 1;
 +    pd.nFromPage   = 0xFFFF;
 +    pd.nToPage     = 0xFFFF;
 +    pd.nMinPage    = 1;
 +    pd.nMaxPage    = 0xFFFF;
-     if (hResult == S_OK) {
-         switch (pd.dwResultAction) {
++    if (PrintDlg(&pd))
++    {
 +        /* GDI calls to render output. */
 +        DeleteDC(pd.hDC); /* Delete DC when done.*/
 +    }
 +#else
 +    HRESULT hResult;
 +    PRINTDLGEX pd;
 +
 +    hResult = PrintDlgEx(&pd);
-     } else {
-         switch (hResult) {
++    if (hResult == S_OK)
++    {
++        switch (pd.dwResultAction)
++        {
 +        case PD_RESULT_APPLY:
 +            /*The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. */
 +            break;
 +        case PD_RESULT_CANCEL:
 +            /*The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. */
 +            break;
 +        case PD_RESULT_PRINT:
 +            /*The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. */
 +            break;
 +        default:
 +            break;
 +        }
-     } while(lResult == ERROR_SUCCESS);
++    }
++    else
++    {
++        switch (hResult)
++        {
 +        case E_OUTOFMEMORY:
 +            /*Insufficient memory. */
 +            break;
 +        case E_INVALIDARG:
 +            /* One or more arguments are invalid. */
 +            break;
 +        case E_POINTER:
 +            /*Invalid pointer. */
 +            break;
 +        case E_HANDLE:
 +            /*Invalid handle. */
 +            break;
 +        case E_FAIL:
 +            /*Unspecified error. */
 +            break;
 +        default:
 +            break;
 +        }
 +        return FALSE;
 +    }
 +#endif
 +    return TRUE;
 +}
 +
 +static void ChooseFavorite(LPCTSTR pszFavorite)
 +{
 +    HKEY hKey = NULL;
 +    TCHAR szFavoritePath[512];
 +    DWORD cbData, dwType;
 +
 +    if (RegOpenKeyEx(HKEY_CURRENT_USER, s_szFavoritesRegKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
 +        goto done;
 +
 +    cbData = (sizeof(szFavoritePath) / sizeof(szFavoritePath[0])) - 1;
 +    memset(szFavoritePath, 0, sizeof(szFavoritePath));
 +    if (RegQueryValueEx(hKey, pszFavorite, NULL, &dwType, (LPBYTE) szFavoritePath, &cbData) != ERROR_SUCCESS)
 +        goto done;
 +
 +    if (dwType == REG_SZ)
 +        SelectNode(g_pChildWnd->hTreeWnd, szFavoritePath);
 +
 +done:
 +    if (hKey)
 +        RegCloseKey(hKey);
 +}
 +
 +BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCTSTR keyName)
 +{
 +    BOOL bClipboardOpened = FALSE;
 +    BOOL bSuccess = FALSE;
 +    TCHAR szBuffer[512];
 +    HGLOBAL hGlobal;
 +    LPTSTR s;
 +
 +    if (!OpenClipboard(hWnd))
 +        goto done;
 +    bClipboardOpened = TRUE;
 +
 +    if (!EmptyClipboard())
 +        goto done;
 +
 +    if (!GetKeyName(szBuffer, COUNT_OF(szBuffer), hRootKey, keyName))
 +        goto done;
 +
 +    hGlobal = GlobalAlloc(GMEM_MOVEABLE, (lstrlen(szBuffer) + 1) * sizeof(TCHAR));
 +    if (!hGlobal)
 +        goto done;
 +
 +    s = GlobalLock(hGlobal);
 +    _tcscpy(s, szBuffer);
 +    GlobalUnlock(hGlobal);
 +
 +#ifdef UNICODE
 +    SetClipboardData(CF_UNICODETEXT, hGlobal);
 +#else
 +    SetClipboardData(CF_TEXT, hGlobal);
 +#endif
 +    bSuccess = TRUE;
 +
 +done:
 +    if (bClipboardOpened)
 +        CloseClipboard();
 +    return bSuccess;
 +}
 +
 +static BOOL CreateNewValue(HKEY hRootKey, LPCTSTR pszKeyPath, DWORD dwType)
 +{
 +    TCHAR szNewValueFormat[128];
 +    TCHAR szNewValue[128];
 +    int iIndex = 1;
 +    BYTE data[128];
 +    DWORD dwExistingType, cbData;
 +    LONG lResult;
 +    HKEY hKey;
 +    LVFINDINFO lvfi;
 +
 +    if (RegOpenKeyEx(hRootKey, pszKeyPath, 0, KEY_QUERY_VALUE | KEY_SET_VALUE,
 +                     &hKey) != ERROR_SUCCESS)
 +        return FALSE;
 +
 +    LoadString(hInst, IDS_NEW_VALUE, szNewValueFormat, COUNT_OF(szNewValueFormat));
 +
 +    do
 +    {
 +        wsprintf(szNewValue, szNewValueFormat, iIndex++);
 +        cbData = sizeof(data);
 +        lResult = RegQueryValueEx(hKey, szNewValue, NULL, &dwExistingType, data, &cbData);
-     switch(dwType) {
++    }
++    while(lResult == ERROR_SUCCESS);
 +
-                     DSOP_SCOPE_TYPE_GLOBAL_CATALOG | DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN |
-                     DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN | DSOP_SCOPE_TYPE_WORKGROUP |
-                     DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN | DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN,
++    switch(dwType)
++    {
 +    case REG_DWORD:
 +        cbData = sizeof(DWORD);
 +        break;
 +    case REG_SZ:
 +    case REG_EXPAND_SZ:
 +        cbData = sizeof(TCHAR);
 +        break;
 +    case REG_MULTI_SZ:
 +        cbData = sizeof(TCHAR) * 2;
 +        break;
 +    case REG_QWORD:
 +        cbData = sizeof(DWORD) * 2;
 +        break;
 +    default:
 +        cbData = 0;
 +        break;
 +    }
 +    memset(data, 0, cbData);
 +    lResult = RegSetValueEx(hKey, szNewValue, 0, dwType, data, cbData);
 +    RegCloseKey(hKey);
 +    if (lResult != ERROR_SUCCESS)
 +    {
 +        return FALSE;
 +    }
 +
 +    RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
 +
 +    /* locate the newly added value, and get ready to rename it */
 +    memset(&lvfi, 0, sizeof(lvfi));
 +    lvfi.flags = LVFI_STRING;
 +    lvfi.psz = szNewValue;
 +    iIndex = ListView_FindItem(g_pChildWnd->hListWnd, -1, &lvfi);
 +    if (iIndex >= 0)
 +        (void)ListView_EditLabel(g_pChildWnd->hListWnd, iIndex);
 +
 +    return TRUE;
 +}
 +
 +static HRESULT
 +InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
 +{
 +    HRESULT hRet;
 +
 +    *pDsObjectPicker = NULL;
 +
 +    hRet = CoCreateInstance(&CLSID_DsObjectPicker,
 +                            NULL,
 +                            CLSCTX_INPROC_SERVER,
 +                            &IID_IDsObjectPicker,
 +                            (LPVOID*)pDsObjectPicker);
 +    if (SUCCEEDED(hRet))
 +    {
 +        DSOP_INIT_INFO InitInfo;
 +        static DSOP_SCOPE_INIT_INFO Scopes[] =
 +        {
 +            {
 +                sizeof(DSOP_SCOPE_INIT_INFO),
 +                DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE | DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE |
-                                                       &InitInfo);
++                DSOP_SCOPE_TYPE_GLOBAL_CATALOG | DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN |
++                DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN | DSOP_SCOPE_TYPE_WORKGROUP |
++                DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN | DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN,
 +                0,
 +                {
 +                    {
 +                        DSOP_FILTER_COMPUTERS,
 +                        0,
 +                        0
 +                    },
 +                    DSOP_DOWNLEVEL_FILTER_COMPUTERS
 +                },
 +                NULL,
 +                NULL,
 +                S_OK
 +            },
 +        };
 +
 +        InitInfo.cbSize = sizeof(InitInfo);
 +        InitInfo.pwzTargetComputer = NULL;
 +        InitInfo.cDsScopeInfos = sizeof(Scopes) / sizeof(Scopes[0]);
 +        InitInfo.aDsScopeInfos = Scopes;
 +        InitInfo.flOptions = 0;
 +        InitInfo.cAttributesToFetch = 0;
 +        InitInfo.apwzAttributeNames = NULL;
 +
 +        hRet = (*pDsObjectPicker)->lpVtbl->Initialize(*pDsObjectPicker,
-                                                  hwndParent,
-                                                  &pdo);
++                &InitInfo);
 +
 +        if (FAILED(hRet))
 +        {
 +            /* delete the object picker in case initialization failed! */
 +            (*pDsObjectPicker)->lpVtbl->Release(*pDsObjectPicker);
 +        }
 +    }
 +
 +    return hRet;
 +}
 +
 +static HRESULT
 +InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
 +                                 IN HWND hwndParent  OPTIONAL,
 +                                 OUT LPTSTR lpBuffer,
 +                                 IN UINT uSize)
 +{
 +    IDataObject *pdo = NULL;
 +    HRESULT hRet;
 +
 +    hRet = pDsObjectPicker->lpVtbl->InvokeDialog(pDsObjectPicker,
-     switch (LOWORD(wParam)) {
++            hwndParent,
++            &pdo);
 +    if (hRet == S_OK)
 +    {
 +        STGMEDIUM stm;
 +        FORMATETC fe;
 +
 +        fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
 +        fe.ptd = NULL;
 +        fe.dwAspect = DVASPECT_CONTENT;
 +        fe.lindex = -1;
 +        fe.tymed = TYMED_HGLOBAL;
 +
 +        hRet = pdo->lpVtbl->GetData(pdo,
 +                                    &fe,
 +                                    &stm);
 +        if (SUCCEEDED(hRet))
 +        {
 +            PDS_SELECTION_LIST SelectionList = (PDS_SELECTION_LIST)GlobalLock(stm.hGlobal);
 +            if (SelectionList != NULL)
 +            {
 +                if (SelectionList->cItems == 1)
 +                {
 +                    size_t nlen = wcslen(SelectionList->aDsSelection[0].pwzName);
 +                    if (nlen >= uSize)
 +                    {
 +                        nlen = uSize - 1;
 +                    }
 +#if UNICODE
 +                    memcpy(lpBuffer,
 +                           SelectionList->aDsSelection[0].pwzName,
 +                           nlen * sizeof(WCHAR));
 +#else
 +                    WideCharToMultiByte(CP_ACP,
 +                                        0,
 +                                        SelectionList->aDsSelection[0].pwzName,
 +                                        nlen,
 +                                        lpBuffer,
 +                                        uSize,
 +                                        NULL,
 +                                        NULL);
 +#endif
 +                    lpBuffer[nlen] = L'\0';
 +                }
 +
 +                GlobalUnlock(stm.hGlobal);
 +            }
 +
 +            ReleaseStgMedium(&stm);
 +        }
 +
 +        pdo->lpVtbl->Release(pdo);
 +    }
 +
 +    return hRet;
 +}
 +
 +static VOID
 +FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
 +{
 +    pDsObjectPicker->lpVtbl->Release(pDsObjectPicker);
 +}
 +
 +/*******************************************************************************
 + *
 + *  FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
 + *
 + *  PURPOSE:  Processes WM_COMMAND messages for the main frame window.
 + *
 + */
 +static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 +{
 +    HKEY hKeyRoot = 0, hKey = 0;
 +    LPCTSTR keyPath;
 +    LPCTSTR valueName;
 +    BOOL result = TRUE;
 +    REGSAM regsam = KEY_READ;
 +    LONG lRet;
 +    int item;
 +
 +    UNREFERENCED_PARAMETER(lParam);
 +    UNREFERENCED_PARAMETER(message);
 +
-           SetCursorPos(pts.x, pts.y);
-           SetCursor(LoadCursor(0, IDC_SIZEWE));
-           SendMessage(g_pChildWnd->hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
++    switch (LOWORD(wParam))
++    {
 +    case ID_REGISTRY_LOADHIVE:
 +        LoadHive(hWnd);
 +        return TRUE;
 +    case ID_REGISTRY_UNLOADHIVE:
 +        UnloadHive(hWnd);
 +        return TRUE;
 +    case ID_REGISTRY_IMPORTREGISTRYFILE:
 +        ImportRegistryFile(hWnd);
 +        return TRUE;
 +    case ID_REGISTRY_EXPORTREGISTRYFILE:
 +        ExportRegistryFile(hWnd);
 +        return TRUE;
 +    case ID_REGISTRY_CONNECTNETWORKREGISTRY:
 +    {
 +        IDsObjectPicker *ObjectPicker;
 +        TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
 +        HRESULT hRet;
 +
 +        hRet = CoInitialize(NULL);
 +        if (SUCCEEDED(hRet))
 +        {
 +            hRet = InitializeRemoteRegistryPicker(&ObjectPicker);
 +            if (SUCCEEDED(hRet))
 +            {
 +                hRet = InvokeRemoteRegistryPickerDialog(ObjectPicker,
 +                                                        hWnd,
 +                                                        szComputerName,
 +                                                        sizeof(szComputerName) / sizeof(szComputerName[0]));
 +                if (hRet == S_OK)
 +                {
 +                    /* FIXME - connect to the registry */
 +                }
 +
 +                FreeObjectPicker(ObjectPicker);
 +            }
 +
 +            CoUninitialize();
 +        }
 +
 +        return TRUE;
 +    }
 +    case ID_REGISTRY_DISCONNECTNETWORKREGISTRY:
 +        return TRUE;
 +    case ID_REGISTRY_PRINT:
 +        PrintRegistryHive(hWnd, _T(""));
 +        return TRUE;
 +    case ID_REGISTRY_EXIT:
 +        DestroyWindow(hWnd);
 +        return TRUE;
 +    case ID_VIEW_STATUSBAR:
 +        toggle_child(hWnd, LOWORD(wParam), hStatusBar);
 +        return TRUE;
 +    case ID_HELP_HELPTOPICS:
 +        WinHelp(hWnd, _T("regedit"), HELP_FINDER, 0);
 +        return TRUE;
 +    case ID_HELP_ABOUT:
 +        ShowAboutBox(hWnd);
 +        return TRUE;
 +    case ID_VIEW_SPLIT:
 +    {
 +        RECT rt;
 +        POINT pt, pts;
 +        GetClientRect(g_pChildWnd->hWnd, &rt);
 +        pt.x = rt.left + g_pChildWnd->nSplitPos;
 +        pt.y = (rt.bottom / 2);
 +        pts = pt;
 +        if(ClientToScreen(g_pChildWnd->hWnd, &pts))
 +        {
-     if (keyPath) {
++            SetCursorPos(pts.x, pts.y);
++            SetCursor(LoadCursor(0, IDC_SIZEWE));
++            SendMessage(g_pChildWnd->hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
 +        }
 +        return TRUE;
 +    }
 +    case ID_EDIT_RENAME:
 +    case ID_EDIT_MODIFY:
 +    case ID_EDIT_MODIFY_BIN:
 +    case ID_EDIT_DELETE:
 +        regsam |= KEY_WRITE;
 +        break;
 +    }
 +
 +    keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
 +    valueName = GetValueName(g_pChildWnd->hListWnd, -1);
-     switch (LOWORD(wParam)) {
++    if (keyPath)
++    {
 +        lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, regsam, &hKey);
 +        if (lRet != ERROR_SUCCESS) hKey = 0;
 +    }
 +
-           UINT nSelected = ListView_GetSelectedCount(g_pChildWnd->hListWnd);
-           if(nSelected >= 1)
-           {
-             TCHAR msg[128], caption[128];
-             LoadString(hInst, IDS_QUERY_DELETE_CONFIRM, caption, sizeof(caption)/sizeof(TCHAR));
-             LoadString(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, sizeof(msg)/sizeof(TCHAR));
-             if(MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
++    switch (LOWORD(wParam))
++    {
 +    case ID_EDIT_MODIFY:
 +        if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE))
 +            RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
 +        break;
 +    case ID_EDIT_MODIFY_BIN:
 +        if (valueName && ModifyValue(hWnd, hKey, valueName, TRUE))
 +            RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
 +        break;
 +    case ID_EDIT_RENAME:
 +        if (GetFocus() == g_pChildWnd->hListWnd)
 +        {
 +            if(ListView_GetSelectedCount(g_pChildWnd->hListWnd) == 1)
 +            {
 +                item = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED);
 +                if(item > -1)
 +                {
 +                    (void)ListView_EditLabel(g_pChildWnd->hListWnd, item);
 +                }
 +            }
 +        }
 +        else if (GetFocus() == g_pChildWnd->hTreeWnd)
 +        {
 +            /* Get focused entry of treeview (if any) */
 +            HTREEITEM hItem = TreeView_GetSelection(g_pChildWnd->hTreeWnd);
 +            if (hItem != NULL)
 +                (void)TreeView_EditLabel(g_pChildWnd->hTreeWnd, hItem);
 +        }
 +        break;
 +    case ID_EDIT_DELETE:
 +    {
 +        if (GetFocus() == g_pChildWnd->hListWnd)
 +        {
-               int ni, errs;
-               item = -1;
-               errs = 0;
-               while((ni = ListView_GetNextItem(g_pChildWnd->hListWnd, item, LVNI_SELECTED)) > -1)
-               {
-                 valueName = GetValueName(g_pChildWnd->hListWnd, item);
-                 if(RegDeleteValue(hKey, valueName) != ERROR_SUCCESS)
++            UINT nSelected = ListView_GetSelectedCount(g_pChildWnd->hListWnd);
++            if(nSelected >= 1)
 +            {
-                   errs++;
++                TCHAR msg[128], caption[128];
++                LoadString(hInst, IDS_QUERY_DELETE_CONFIRM, caption, sizeof(caption)/sizeof(TCHAR));
++                LoadString(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, sizeof(msg)/sizeof(TCHAR));
++                if(MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
 +                {
-                 item = ni;
-               }
-               RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
-               if(errs > 0)
-               {
-                 LoadString(hInst, IDS_ERR_DELVAL_CAPTION, caption, sizeof(caption)/sizeof(TCHAR));
-                 LoadString(hInst, IDS_ERR_DELETEVALUE, msg, sizeof(msg)/sizeof(TCHAR));
-                 MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONSTOP);
-               }
++                    int ni, errs;
++
++                    item = -1;
++                    errs = 0;
++                    while((ni = ListView_GetNextItem(g_pChildWnd->hListWnd, item, LVNI_SELECTED)) > -1)
++                    {
++                        valueName = GetValueName(g_pChildWnd->hListWnd, item);
++                        if(RegDeleteValue(hKey, valueName) != ERROR_SUCCESS)
++                        {
++                            errs++;
++                        }
++                        item = ni;
++                    }
++
++                    RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
++                    if(errs > 0)
++                    {
++                        LoadString(hInst, IDS_ERR_DELVAL_CAPTION, caption, sizeof(caption)/sizeof(TCHAR));
++                        LoadString(hInst, IDS_ERR_DELETEVALUE, msg, sizeof(msg)/sizeof(TCHAR));
++                        MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONSTOP);
++                    }
 +                }
-           }
 +            }
-           if (keyPath == 0 || *keyPath == 0)
-           {
-              MessageBeep(MB_ICONHAND);
-           } else
-           if (DeleteKey(hWnd, hKeyRoot, keyPath))
-           {
-             DeleteNode(g_pChildWnd->hTreeWnd, 0);
-             RefreshTreeView(g_pChildWnd->hTreeWnd);
-           }
 +        }
 +        else if (GetFocus() == g_pChildWnd->hTreeWnd)
 +        {
-    /*case ID_OPTIONS_TOOLBAR:*/
-    /* toggle_child(hWnd, LOWORD(wParam), hToolBar);*/
-    /*    break;*/
++            if (keyPath == 0 || *keyPath == 0)
++            {
++                MessageBeep(MB_ICONHAND);
++            }
++            else if (DeleteKey(hWnd, hKeyRoot, keyPath))
++            {
++                DeleteNode(g_pChildWnd->hTreeWnd, 0);
++                RefreshTreeView(g_pChildWnd->hTreeWnd);
++            }
 +        }
 +        break;
 +    }
 +    case ID_EDIT_NEW_STRINGVALUE:
 +        CreateNewValue(hKeyRoot, keyPath, REG_SZ);
 +        break;
 +    case ID_EDIT_NEW_BINARYVALUE:
 +        CreateNewValue(hKeyRoot, keyPath, REG_BINARY);
 +        break;
 +    case ID_EDIT_NEW_DWORDVALUE:
 +        CreateNewValue(hKeyRoot, keyPath, REG_DWORD);
 +        break;
 +    case ID_EDIT_NEW_MULTISTRINGVALUE:
 +        CreateNewValue(hKeyRoot, keyPath, REG_MULTI_SZ);
 +        break;
 +    case ID_EDIT_NEW_EXPANDABLESTRINGVALUE:
 +        CreateNewValue(hKeyRoot, keyPath, REG_EXPAND_SZ);
 +        break;
 +    case ID_EDIT_FIND:
 +        FindDialog(hWnd);
 +        break;
 +    case ID_EDIT_FINDNEXT:
 +        FindNext(hWnd);
 +        break;
 +    case ID_EDIT_COPYKEYNAME:
 +        CopyKeyName(hWnd, hKeyRoot, keyPath);
 +        break;
 +    case ID_EDIT_PERMISSIONS:
 +        RegKeyEditPermissions(hWnd, hKeyRoot, NULL, keyPath);
 +        break;
 +    case ID_REGISTRY_PRINTERSETUP:
 +        /*PRINTDLG pd;*/
 +        /*PrintDlg(&pd);*/
 +        /*PAGESETUPDLG psd;*/
 +        /*PageSetupDlg(&psd);*/
 +        break;
 +    case ID_REGISTRY_OPENLOCAL:
 +        break;
 +
 +    case ID_VIEW_REFRESH:
 +        RefreshTreeView(g_pChildWnd->hTreeWnd);
 +        /*RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, NULL); */
 +        break;
-       RegCloseKey(hKey);
++        /*case ID_OPTIONS_TOOLBAR:*/
++        /*    toggle_child(hWnd, LOWORD(wParam), hToolBar);*/
++        /*    break;*/
 +    case ID_EDIT_NEW_KEY:
 +        CreateNewKey(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd));
 +        break;
 +    default:
 +        if ((LOWORD(wParam) >= ID_FAVORITES_MIN) && (LOWORD(wParam) <= ID_FAVORITES_MAX))
 +        {
 +            HMENU hMenu;
 +            MENUITEMINFO mii;
 +            TCHAR szFavorite[512];
 +
 +            hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
 +
 +            memset(&mii, 0, sizeof(mii));
 +            mii.cbSize = sizeof(mii);
 +            mii.fMask = MIIM_TYPE;
 +            mii.fType = MFT_STRING;
 +            mii.dwTypeData = szFavorite;
 +            mii.cch = sizeof(szFavorite) / sizeof(szFavorite[0]);
 +
 +            if (GetMenuItemInfo(hMenu, LOWORD(wParam) - ID_FAVORITES_MIN, TRUE, &mii))
 +            {
 +                ChooseFavorite(szFavorite);
 +            }
 +        }
 +        else
 +        {
 +            result = FALSE;
 +        }
 +        break;
 +    }
 +
 +    if(hKey)
-     switch (message) {
++        RegCloseKey(hKey);
 +    return result;
 +}
 +
 +/********************************************************************************
 + *
 + *  FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
 + *
 + *  PURPOSE:  Processes messages for the main frame window.
 + *
 + *  WM_COMMAND  - process the application menu
 + *  WM_DESTROY  - post a quit message and return
 + *
 + */
 +
 +LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 +{
++    switch (message)
++    {
 +    case WM_CREATE:
 +        CreateWindowEx(0, szChildClass, NULL, WS_CHILD | WS_VISIBLE,
 +                       CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
 +                       hWnd, (HMENU)0, hInst, 0);
 +        break;
 +    case WM_COMMAND:
 +        if (!_CmdWndProc(hWnd, message, wParam, lParam))
 +            return DefWindowProc(hWnd, message, wParam, lParam);
 +        break;
 +    case WM_ACTIVATE:
 +        if (LOWORD(hWnd))
 +            SetFocus(g_pChildWnd->hWnd);
 +        break;
 +    case WM_SIZE:
 +        resize_frame_client(hWnd);
 +        break;
 +    case WM_TIMER:
 +        break;
 +    case WM_INITMENU:
 +        OnInitMenu(hWnd);
 +        break;
 +    case WM_ENTERMENULOOP:
 +        OnEnterMenuLoop(hWnd);
 +        break;
 +    case WM_EXITMENULOOP:
 +        OnExitMenuLoop(hWnd);
 +        break;
 +    case WM_MENUSELECT:
 +        OnMenuSelect(hWnd, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam);
 +        break;
 +    case WM_DESTROY:
 +        WinHelp(hWnd, _T("regedit"), HELP_QUIT, 0);
 +        PostQuitMessage(0);
 +    default:
 +        return DefWindowProc(hWnd, message, wParam, lParam);
 +    }
 +    return 0;
 +}
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index a88d5b7,0000000..94c7d85
mode 100644,000000..100644
--- /dev/null
@@@ -1,498 -1,0 +1,500 @@@
-             MENUITEM "选中信息(&I)", ID_EDIT_SELECTIONINFO
 +/*
 + * wordpad (Simplified and Traditional Chinese Resource)
 + *
 + * Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
 + * Copyright 2010 Cheer Xiao <xiaqqaix.at.gmail.com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * This library is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 + */
 +
 +#include "wordpad.h"
 +
 +/* Chinese text is encoded in UTF-8 */
 +#pragma code_page(65001)
 +
 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
 +
 +IDM_MAINMENU MENU
 +BEGIN
 +    POPUP "文件(&F)"
 +    BEGIN
 +        MENUITEM "新建(&N)...\tCtrl+N", ID_FILE_NEW
 +        MENUITEM "打开(&O)...\tCtrl+O", ID_FILE_OPEN
 +        MENUITEM "保存(&S)\tCtrl+S", ID_FILE_SAVE
 +        MENUITEM "另存为(&A)...", ID_FILE_SAVEAS
 +        MENUITEM SEPARATOR
 +        MENUITEM "打印(&P)...\tCtrl+P", ID_PRINT
 +        MENUITEM "打印预览(&W)...", ID_PREVIEW
 +        MENUITEM "页面设置(&E)...", ID_PRINTSETUP
 +        MENUITEM SEPARATOR
 +        MENUITEM "退出(&X)", ID_FILE_EXIT
 +    END
 +    POPUP "编辑(&E)"
 +    BEGIN
 +        MENUITEM "撤销(&U)\tCtrl+Z", ID_EDIT_UNDO
 +        MENUITEM "重做(&E)\tCtrl+Y", ID_EDIT_REDO
 +        MENUITEM SEPARATOR
 +        MENUITEM "剪切(&T)\tCtrl+X", ID_EDIT_CUT
 +        MENUITEM "复制(&C)\tCtrl+C", ID_EDIT_COPY
 +        MENUITEM "粘贴(&P)\tCtrl+V", ID_EDIT_PASTE
 +        MENUITEM "删除(&D)\tDEL", ID_EDIT_CLEAR
 +        MENUITEM "全选(&S)\tCtrl+A", ID_EDIT_SELECTALL
 +        MENUITEM SEPARATOR
 +        MENUITEM "查找(&F)...\tCtrl+F", ID_FIND
 +        MENUITEM "找下一个(&N)\tF3", ID_FIND_NEXT
 +        MENUITEM "替换(&R)...\tCtrl+H", ID_REPLACE
 +        MENUITEM SEPARATOR
 +        MENUITEM "只读(&O)", ID_EDIT_READONLY
 +        MENUITEM "已改动(&M)", ID_EDIT_MODIFIED
 +        MENUITEM SEPARATOR
 +        POPUP "其他(&X)"
 +        BEGIN
-         MENUITEM "项目符号(&B)",      ID_BULLET
-         MENUITEM "段落(&P)...",       ID_PARAFORMAT
++            MENUITEM "选中信息(&I)", ID_EDIT_SELECTIONINFO /* 准确性待议 */
 +            MENUITEM "文字格式(&F)", ID_EDIT_CHARFORMAT
 +            MENUITEM "默认格式(&D)", ID_EDIT_DEFCHARFORMAT
 +            MENUITEM "段落格式(&H)", ID_EDIT_PARAFORMAT
 +            MENUITEM "获取文字(&G)", ID_EDIT_GETTEXT
 +        END
 +    END
 +    POPUP "视图(&V)"
 +    BEGIN
 +        MENUITEM "工具栏(&T)", ID_TOGGLE_TOOLBAR
 +        MENUITEM "格式工具栏(&F)", ID_TOGGLE_FORMATBAR
 +        MENUITEM "标尺(&R)", ID_TOGGLE_RULER
 +        MENUITEM "状态栏(&S)", ID_TOGGLE_STATUSBAR
 +        MENUITEM SEPARATOR
 +        MENUITEM "选项(&O)...", ID_VIEWPROPERTIES
 +    END
 +    POPUP "插入(&I)"
 +    BEGIN
 +        MENUITEM "日期时间(&D)...", ID_DATETIME
 +    END
 +    POPUP "格式(&O)"
 +    BEGIN
 +        MENUITEM "字体(&F)..", ID_FONTSETTINGS
 +        MENUITEM "项目符号(&B)", ID_BULLET
 +        MENUITEM "段落(&P)...", ID_PARAFORMAT
 +        MENUITEM "制表位(&T)...", ID_TABSTOPS
 +        POPUP "背景(&D)"
 +        BEGIN
 +            MENUITEM "系统(&S)\tCtrl+1", ID_BACK_1
 +            MENUITEM "淡黄色(&P)\tCtrl+2", ID_BACK_2
 +        END
 +    END
 +    POPUP "帮助(&H)"
 +    BEGIN
 +        MENUITEM "关于 &Wine 写字板", ID_ABOUT
 +    END
 +END
 +
 +IDM_POPUP MENU
 +BEGIN
 +    POPUP ""
 +    BEGIN
 +        MENUITEM "剪切(&T)", ID_EDIT_CUT
 +        MENUITEM "复制(&C)", ID_EDIT_COPY
 +        MENUITEM "粘贴(&P)", ID_EDIT_PASTE
 +        MENUITEM SEPARATOR
-         MENUITEM "调和绿",      ID_COLOR_GREEN
-         MENUITEM "橄榄色",      ID_COLOR_OLIVE
-         MENUITEM "藏青",       ID_COLOR_NAVY
-         MENUITEM "紫色",     ID_COLOR_PURPLE
-         MENUITEM "鸭翅绿",       ID_COLOR_TEAL
-         MENUITEM "灰色",       ID_COLOR_GRAY
-         MENUITEM "银色",     ID_COLOR_SILVER
-         MENUITEM "红色",        ID_COLOR_RED
-         MENUITEM "绿色",       ID_COLOR_LIME
-         MENUITEM "黄色",     ID_COLOR_YELLOW
-         MENUITEM "蓝色",       ID_COLOR_BLUE
-         MENUITEM "洋红",    ID_COLOR_FUCHSIA /* =magenta? */
-         MENUITEM "水绿",       ID_COLOR_AQUA
-         MENUITEM "白色",      ID_COLOR_WHITE
-         MENUITEM "自动",  ID_COLOR_AUTOMATIC
++        MENUITEM "项目符号(&B)",       ID_BULLET
++        MENUITEM "段落(&P)...",        ID_PARAFORMAT
 +    END
 +END
 +
 +IDM_COLOR_POPUP MENU
 +BEGIN
 +    POPUP ""
 +    BEGIN
 +        MENUITEM "黑色",      ID_COLOR_BLACK /* 未找到“标准译名表” */
 +        MENUITEM "栗色",     ID_COLOR_MAROON
-         MENUITEM "子彈點(&B)",      ID_BULLET
-         MENUITEM "段落(&P)...",       ID_PARAFORMAT
++        MENUITEM "绿色",      ID_COLOR_GREEN
++        MENUITEM "橄榄色",       ID_COLOR_OLIVE
++        MENUITEM "藏青",        ID_COLOR_NAVY
++        MENUITEM "紫色",      ID_COLOR_PURPLE
++        MENUITEM "鸭翅绿",        ID_COLOR_TEAL
++        MENUITEM "灰色",        ID_COLOR_GRAY
++        MENUITEM "银色",      ID_COLOR_SILVER
++        MENUITEM "红色",         ID_COLOR_RED
++        MENUITEM "青柠色",        ID_COLOR_LIME
++        MENUITEM "黄色",      ID_COLOR_YELLOW
++        MENUITEM "蓝色",        ID_COLOR_BLUE
++        MENUITEM "洋红",     ID_COLOR_FUCHSIA /* =magenta? */
++        MENUITEM "水绿",        ID_COLOR_AQUA
++        MENUITEM "白色",       ID_COLOR_WHITE
++        MENUITEM "自动",   ID_COLOR_AUTOMATIC
 +    END
 +END
 +
 +IDD_DATETIME DIALOG 30, 20, 130, 80
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "日期和时间"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    LTEXT        "可选格式",-1,3,2,100,15
 +    LISTBOX      IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY
 +    PUSHBUTTON   "确定(&O)",IDOK,87,12,40,12
 +    PUSHBUTTON   "取消(&C)",IDCANCEL,87,26,40,12
 +END
 +
 +IDD_NEWFILE DIALOG 30, 20, 140, 80
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "新建"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    LTEXT        "新文件类型",-1,3,2,100,15
 +    LISTBOX      IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
 +    PUSHBUTTON   "确定(&O)",IDOK,97,12,40,12
 +    PUSHBUTTON   "取消(&C)",IDCANCEL,97,26,40,12
 +END
 +
 +IDD_PARAFORMAT DIALOG 30, 20, 200, 110
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "段落格式"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    GROUPBOX "缩进", -1, 10, 10, 120, 68
 +    LTEXT "左", -1, 15, 22, 40, 13
 +    EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
 +    LTEXT "右", -1, 15, 40, 40, 13
 +    EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
 +    LTEXT "首行", -1, 15, 58, 40, 13
 +    EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
 +    LTEXT "对齐", -1, 15, 87, 40, 13
 +    COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
 +    PUSHBUTTON "确定(&O)", IDOK, 137, 15, 50, 15
 +    PUSHBUTTON "取消(&C)", IDCANCEL, 137, 33, 50, 15
 +END
 +
 +IDD_TABSTOPS DIALOG 30, 20, 200, 110
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "制表位"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    GROUPBOX "制表位宽度", -1, 10, 10, 120, 90
 +    COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
 +    DEFPUSHBUTTON "添加(&A)", ID_TAB_ADD, 20, 80, 45, 15
 +    PUSHBUTTON "删除(&R)", ID_TAB_DEL, 72, 80, 45, 15
 +    PUSHBUTTON "确定(&O)", IDOK, 137, 15, 50, 15
 +    PUSHBUTTON "取消(&C)", IDCANCEL, 137, 33, 50, 15
 +    PUSHBUTTON "全部删除(&R)", ID_TAB_EMPTY, 137, 51, 50, 15
 +END
 +
 +IDD_FORMATOPTS DIALOG 0, 0, 280, 110
 +STYLE DS_SYSMODAL
 +CAPTION ""
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    GROUPBOX "自动换行", -1, 10, 10, 130, 85
 +    RADIOBUTTON "不要自动换行", IDC_PAGEFMT_WN, 18, 25, 117, 15
 +    RADIOBUTTON "按窗口宽度(&W)", IDC_PAGEFMT_WW, 18, 45, 117, 15
 +    RADIOBUTTON "按纸张宽度(&M)", IDC_PAGEFMT_WM, 18, 65, 117, 15
 +    GROUPBOX "工具栏", -1, 150, 10, 120, 85
 +    CHECKBOX "工具栏(&T)", IDC_PAGEFMT_TB, 160, 20, 80, 15
 +    CHECKBOX "格式工具栏(&F)", IDC_PAGEFMT_FB, 160, 38, 80, 15
 +    CHECKBOX "标尺(&R)", IDC_PAGEFMT_RU, 160, 56, 80, 15
 +    CHECKBOX "状态栏(&S)", IDC_PAGEFMT_SB, 160, 74, 80, 15
 +    LTEXT "", IDC_PAGEFMT_ID, 0,0,0,0
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_RICHTEXT_FILES_RTF,     "RTF 富文本 (*.rtf)"
 +    STRING_TEXT_FILES_TXT,         "文本文件 (*.txt)"
 +    STRING_TEXT_FILES_UNICODE_TXT, "Unicode 文本文件 (*.txt)"
 +    STRING_ALL_FILES,              "所有文件 (*.*)"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_ALIGN_LEFT,            "左"
 +    STRING_ALIGN_RIGHT,           "右"
 +    STRING_ALIGN_CENTER,          "中"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_NEWFILE_RICHTEXT,     "RTF 富文本"
 +    STRING_NEWFILE_TXT,          "文本文件 "
 +    STRING_NEWFILE_TXT_UNICODE,  "Unicode 文本文件"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_PRINTER_FILES_PRN,        "打印文件 (*.PRN)"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_VIEWPROPS_TITLE,          "选项"
 +    STRING_VIEWPROPS_TEXT,           "文本文字"
 +    STRING_VIEWPROPS_RICHTEXT,       "富文本格式"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_PREVIEW_PRINT,            "打印"
 +    STRING_PREVIEW_NEXTPAGE,         "下一页"
 +    STRING_PREVIEW_PREVPAGE,         "上一页"
 +    STRING_PREVIEW_TWOPAGES,         "双页"
 +    STRING_PREVIEW_ONEPAGE,          "单页"
 +    STRING_PREVIEW_ZOOMIN,           "放大"
 +    STRING_PREVIEW_ZOOMOUT,          "缩小"
 +    STRING_PREVIEW_CLOSE,            "关闭"
 +    STRING_PREVIEW_PAGE,             "页"
 +    STRING_PREVIEW_PAGES,            "页"
 +    STRING_UNITS_CM,                 "cm"
 +    STRING_UNITS_IN,                 "in"
 +    STRING_UNITS_INCH,               "英寸"
 +    STRING_UNITS_PT,                 "pt"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_DEFAULT_FILENAME,     "文档"
 +    STRING_PROMPT_SAVE_CHANGES,  "要保存“%s”吗?"
 +    STRING_SEARCH_FINISHED,      "文件查找结束。"
 +    STRING_LOAD_RICHED_FAILED,   "RichEdit 装载失败。"
 +    STRING_SAVE_LOSEFORMATTING,  "你已经选择保存为文本文件,而这可能导致格式丢失。你确定要这么做吗?"
 +    STRING_INVALID_NUMBER,       "数字格式无效"
 +    STRING_OLE_STORAGE_NOT_SUPPORTED, "不支持 OLE 储存文件"
 +    STRING_WRITE_FAILED,              "不能保存文件。"
 +    STRING_WRITE_ACCESS_DENIED,       "你没有保存文件的权限。"
 +    STRING_OPEN_FAILED,               "不能打开文件。"
 +    STRING_OPEN_ACCESS_DENIED,        "你没有打开文件的权限。"
 +    STRING_PRINTING_NOT_IMPLEMENTED,  "打印功能尚未实现"
 +    STRING_MAX_TAB_STOPS,             "最多只能添加 32 个制表位宽度。"
 +END
 +
 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
 +
 +IDM_MAINMENU MENU
 +BEGIN
 +    POPUP "檔案(&F)"
 +    BEGIN
 +        MENUITEM "新建(&N)...\tCtrl+N", ID_FILE_NEW
 +        MENUITEM "開啟(&O)...\tCtrl+O", ID_FILE_OPEN
 +        MENUITEM "儲存(&S)\tCtrl+S", ID_FILE_SAVE
 +        MENUITEM "另存為(&A)...", ID_FILE_SAVEAS
 +        MENUITEM SEPARATOR
 +        MENUITEM "列印(&P)...\tCtrl+P", ID_PRINT
 +        MENUITEM "列印預覽(&W)...", ID_PREVIEW
 +        MENUITEM "頁面設定(&E)...", ID_PRINTSETUP
 +        MENUITEM SEPARATOR
 +        MENUITEM "結束(&X)", ID_FILE_EXIT
 +    END
 +    POPUP "編輯(&E)"
 +    BEGIN
 +        MENUITEM "復原(&U)\tCtrl+Z", ID_EDIT_UNDO
 +        MENUITEM "重做(&E)\tCtrl+Y", ID_EDIT_REDO
 +        MENUITEM SEPARATOR
 +        MENUITEM "剪下(&T)\tCtrl+X", ID_EDIT_CUT
 +        MENUITEM "複製(&C)\tCtrl+C", ID_EDIT_COPY
 +        MENUITEM "貼上(&P)\tCtrl+V", ID_EDIT_PASTE
 +        MENUITEM "刪除(&D)\tDEL", ID_EDIT_CLEAR
 +        MENUITEM "全選(&S)\tCtrl+A", ID_EDIT_SELECTALL
 +        MENUITEM SEPARATOR
 +        MENUITEM "查找(&F)...\tCtrl+F", ID_FIND
 +        MENUITEM "找下一個(&N)\tF3", ID_FIND_NEXT
 +        MENUITEM "替換(&R)...\tCtrl+H", ID_REPLACE
 +        MENUITEM SEPARATOR
 +        MENUITEM "唯讀(&0))", ID_EDIT_READONLY
 +        MENUITEM "已改動(M)", ID_EDIT_MODIFIED
 +        MENUITEM SEPARATOR
 +        POPUP "其他(&X)"
 +        BEGIN
 +            MENUITEM "選擇資訊(&I)", ID_EDIT_SELECTIONINFO
 +            MENUITEM "文字格式(&F)", ID_EDIT_CHARFORMAT
 +            MENUITEM "默認格式(&D)", ID_EDIT_DEFCHARFORMAT
 +            MENUITEM "段落格式(&H)", ID_EDIT_PARAFORMAT
 +            MENUITEM "獲取文字(&G)", ID_EDIT_GETTEXT
 +        END
 +    END
 +    POPUP "檢視(&V)"
 +    BEGIN
 +        MENUITEM "工具欄(&T)", ID_TOGGLE_TOOLBAR
 +        MENUITEM "格式工具欄(&F)", ID_TOGGLE_FORMATBAR
 +        MENUITEM "標尺(&R)", ID_TOGGLE_RULER
 +        MENUITEM "狀態欄(&S)", ID_TOGGLE_STATUSBAR
 +        MENUITEM SEPARATOR
 +        MENUITEM "選項(&O)...", ID_VIEWPROPERTIES
 +    END
 +    POPUP "插入(&I)"
 +    BEGIN
 +        MENUITEM "日期時間(&D)...", ID_DATETIME
 +    END
 +    POPUP "格式(&O)"
 +    BEGIN
 +        MENUITEM "字型(&F)..", ID_FONTSETTINGS
 +        MENUITEM "子彈點(&B)", ID_BULLET
 +        MENUITEM "段落(&P)...", ID_PARAFORMAT
 +        MENUITEM "標籤(&T)...", ID_TABSTOPS
 +        POPUP "背景(&D)"
 +        BEGIN
 +            MENUITEM "系統(&S)\tCtrl+1", ID_BACK_1
 +            MENUITEM "淡黃色(&P)\tCtrl+2", ID_BACK_2
 +        END
 +    END
 +    POPUP "幫助(&H)"
 +    BEGIN
 +        MENUITEM "關於 &Wine 寫字板", ID_ABOUT
 +    END
 +END
 +
 +IDM_POPUP MENU
 +BEGIN
 +    POPUP ""
 +    BEGIN
 +        MENUITEM "剪下(&T)", ID_EDIT_CUT
 +        MENUITEM "複製(&C)", ID_EDIT_COPY
 +        MENUITEM "貼上(&P)", ID_EDIT_PASTE
 +        MENUITEM SEPARATOR
-     STRING_SAVE_LOSEFORMATTING,  "你已經選擇儲存為文本檔案, 這可能導致格式丟失. 你確定要這麼做嗎?"
++        MENUITEM "子彈點(&B)",       ID_BULLET
++        MENUITEM "段落(&P)...",        ID_PARAFORMAT
 +    END
 +END
 +
 +IDD_DATETIME DIALOG 30, 20, 130, 80
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "日期和時間"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    LTEXT        "可用格式",-1,3,2,100,15
 +    LISTBOX      IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
 +    PUSHBUTTON   "確定(&O)",IDOK,87,12,40,12
 +    PUSHBUTTON   "取消(&C)",IDCANCEL,87,26,40,12
 +END
 +
 +IDD_NEWFILE DIALOG 30, 20, 140, 80
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "新建"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    LTEXT        "新檔案類型",-1,3,2,100,15
 +    LISTBOX      IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
 +    PUSHBUTTON   "確定(&O)",IDOK,97,12,40,12
 +    PUSHBUTTON   "取消(&C)",IDCANCEL,97,26,40,12
 +END
 +
 +IDD_PARAFORMAT DIALOG 30, 20, 200, 110
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "段落格式"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    GROUPBOX "縮進", -1, 10, 10, 120, 68
 +    LTEXT "左", -1, 15, 22, 40, 13
 +    EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
 +    LTEXT "右", -1, 15, 40, 40, 13
 +    EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
 +    LTEXT "第一行", -1, 15, 58, 40, 13
 +    EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
 +    LTEXT "對齊", -1, 15, 87, 40, 13
 +    COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST
 +    PUSHBUTTON "確定(&O)", IDOK, 137, 15, 50, 15
 +    PUSHBUTTON "取消(&C)", IDCANCEL, 137, 33, 50, 15
 +END
 +
 +IDD_TABSTOPS DIALOG 30, 20, 200, 110
 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
 +CAPTION "標籤"
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    GROUPBOX "標籤停點", -1, 10, 10, 120, 90
 +    COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
 +    DEFPUSHBUTTON "添加(&A)", ID_TAB_ADD, 20, 80, 45, 15
 +    PUSHBUTTON "刪除(&R)", ID_TAB_DEL, 72, 80, 45, 15
 +    PUSHBUTTON "確定(&O)", IDOK, 137, 15, 50, 15
 +    PUSHBUTTON "取消(&C)", IDCANCEL, 137, 33, 50, 15
 +    PUSHBUTTON "全部刪除(&R)", ID_TAB_EMPTY, 137, 51, 50, 15
 +END
 +
 +IDD_FORMATOPTS DIALOG 0, 0, 280, 110
 +STYLE DS_SYSMODAL
 +CAPTION ""
 +FONT 9, "MS Shell Dlg"
 +BEGIN
 +    GROUPBOX "自動換行", -1, 10, 10, 130, 85
 +    RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
 +    RADIOBUTTON "按視窗寬度(&W)", IDC_PAGEFMT_WW, 18, 25, 117, 15
 +    RADIOBUTTON "按紙張寬度(&M)", IDC_PAGEFMT_WM, 18, 45, 117, 15
 +    GROUPBOX "工具欄", -1, 150, 10, 120, 85
 +    CHECKBOX "工具欄(&T)", IDC_PAGEFMT_TB, 160, 20, 80, 15
 +    CHECKBOX "格式工具欄(&F)", IDC_PAGEFMT_FB, 160, 38, 80, 15
 +    CHECKBOX "標尺(&R)", IDC_PAGEFMT_RU, 160, 56, 80, 15
 +    CHECKBOX "狀態欄(&S)", IDC_PAGEFMT_SB, 160, 74, 80, 15
 +    LTEXT "", IDC_PAGEFMT_ID, 0,0,0,0
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_RICHTEXT_FILES_RTF,     "RTF豐富格式 (*.rtf)"
 +    STRING_TEXT_FILES_TXT,         "文本檔案 (*.txt)"
 +    STRING_TEXT_FILES_UNICODE_TXT, "統一碼文本檔案 (*.txt)"
 +    STRING_ALL_FILES,              "所有檔案 (*.*)"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_ALIGN_LEFT,            "左"
 +    STRING_ALIGN_RIGHT,           "右"
 +    STRING_ALIGN_CENTER,          "中"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_NEWFILE_RICHTEXT,     "RTF豐富格式檔案"
 +    STRING_NEWFILE_TXT,          "文本檔案 "
 +    STRING_NEWFILE_TXT_UNICODE,  "統一碼文本檔案"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_PRINTER_FILES_PRN,        "列印檔案 (*.PRN)"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_VIEWPROPS_TITLE,          "選項"
 +    STRING_VIEWPROPS_TEXT,           "文本文字"
 +    STRING_VIEWPROPS_RICHTEXT,       "豐富格式文字"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_PREVIEW_PRINT,            "列印"
 +    STRING_PREVIEW_NEXTPAGE,         "下一頁"
 +    STRING_PREVIEW_PREVPAGE,         "上一頁"
 +    STRING_PREVIEW_TWOPAGES,         "雙頁"
 +    STRING_PREVIEW_ONEPAGE,          "單頁"
 +    STRING_PREVIEW_ZOOMIN,           "Zoom in"
 +    STRING_PREVIEW_ZOOMOUT,          "Zoom out"
 +    STRING_PREVIEW_CLOSE,            "關閉"
 +END
 +
 +STRINGTABLE
 +BEGIN
 +    STRING_DEFAULT_FILENAME,     "Document"
 +    STRING_PROMPT_SAVE_CHANGES,  "儲存改動到 '%s'?"
 +    STRING_SEARCH_FINISHED,      "檔案查找結束."
 +    STRING_LOAD_RICHED_FAILED,   "RichEdit 裝載失敗."
++    STRING_SAVE_LOSEFORMATTING,  "你已經選擇儲存為文本檔案, " \
++                                 "這可能導致格式丟失. " \
++                                 "你確定要這麼做嗎?"
 +    STRING_INVALID_NUMBER,       "數字格式無效"
 +    STRING_OLE_STORAGE_NOT_SUPPORTED, "不支援OLE 儲存檔案"
 +    STRING_WRITE_FAILED,              "不能儲存檔案."
 +    STRING_WRITE_ACCESS_DENIED,       "你沒有儲存檔案的權力."
 +    STRING_OPEN_FAILED,               "不能開啟檔案."
 +    STRING_OPEN_ACCESS_DENIED,        "你沒有開啟檔案的權力."
 +    STRING_PRINTING_NOT_IMPLEMENTED,  "Printing not implemented"
 +END
Simple merge
index 0000000,da4dae9..da4dae9
mode 000000,100644..100644
--- /dev/null
index 0000000,1ff92b3..1ff92b3
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000,0ed6ad3..0ed6ad3
mode 000000,100644..100644
--- /dev/null
Simple merge
index 0000000,886a181..886a181
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000,91372aa..91372aa
mode 000000,100644..100644
--- /dev/null
Simple merge
index 4df4ad6,0000000..1dfde6d
mode 100644,000000..100644
--- /dev/null
@@@ -1,78 -1,0 +1,80 @@@
- //#include "lang/bg-BG.rc"
 +/*
 + * Top level resource file for browseui stuff
 + *
 + * Copyright 2009 Andrew Hill
 + *
 + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 + */
 +
 +#include <windows.h>
 +#include "shlobj.h"
 +#include "resource.h"
 +
 +#include "version.rc"
 +
 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 +
 +/////////////////////////////////////////////////////////////////////////////
 +//
 +// REGISTRY
 +//
 +IDR_ADDRESSBAND          REGISTRY                "res/addressband.rgs"
 +IDR_ADDRESSEDITBOX       REGISTRY                "res/addresseditbox.rgs"
 +IDR_ACLMULTI             REGISTRY                "res/autocompletecontainer.rgs"
 +IDR_BANDPROXY            REGISTRY                "res/bandproxy.rgs"
 +IDR_BANDSITE             REGISTRY                "res/rebarbandsite.rgs"
 +IDR_BANDSITEMENU         REGISTRY                "res/bandsitemenu.rgs"
 +IDR_BRANDBAND            REGISTRY                "res/brandband.rgs"
 +IDR_COMMONBROWSER        REGISTRY                "res/commonbrowser.rgs"
 +IDR_GLOBALFOLDERSETTINGS REGISTRY                "res/globalfoldersettings.rgs"
 +IDR_INTERNETTOOLBAR      REGISTRY                "res/internettoolbar.rgs"
 +IDR_REGTREEOPTIONS       REGISTRY                "res/regtreeoptions.rgs"
 +
 +
 +/*
 + * Everything specific to any language goes
 + * in one of the specific files.
 + */
 +//#include "lang/ca-ES.rc"
 +//#include "lang/cs-CZ.rc"
 +//#include "lang/da-DK.rc"
 +//#include "lang/de-DE.rc"
 +//#include "lang/el-GR.rc"
 +//#include "lang/en-GB.rc"
 +#include "lang/en-US.rc"
 +#include "lang/es-ES.rc"
 +//#include "lang/fi-FI.rc"
 +//#include "lang/fr-FR.rc"
 +//#include "lang/hu-HU.rc"
 +//#include "lang/it-IT.rc"
 +//#include "lang/ja-JP.rc"
 +//#include "lang/ko-KR.rc"
 +//#include "lang/nl-NL.rc"
 +//#include "lang/no-NO.rc"
 +//#include "lang/pl-PL.rc"
 +//#include "lang/pt-BR.rc"
 +//#include "lang/pt-PT.rc"
 +//#include "lang/ro-RO.rc"
 +//#include "lang/ru-RU.rc"
 +//#include "lang/sl-SI.rc"
 +//#include "lang/sk-SK.rc"
 +//#include "lang/sv-SE.rc"
 +//#include "lang/tr-TR.rc"
 +#include "lang/uk-UA.rc"
 +//#include "lang/zh-CN.rc"
 +//#include "lang/zh-TW.rc"
++
++/* UTF-8 */
++#include "lang/bg-BG.rc"
index 0000000,ba762f9..ba762f9
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 846d78c,0000000..cfbe5f2
mode 100644,000000..100644
--- /dev/null
@@@ -1,796 -1,0 +1,796 @@@
-                  if (hFile == NULL) 
 +/* $Id$
 + *
 + * COPYRIGHT:       See COPYING in the top level directory
 + * PROJECT:         ReactOS system libraries
 + * FILE:            lib/kernel32/file/file.c
 + * PURPOSE:         Directory functions
 + * PROGRAMMER:      Ariadne ( ariadne@xs4all.nl)
 + *                  Gerhard W. Gruber (sparhawk_at_gmx.at)
 + *                  Dmitry Philippov (shedon@mail.ru)
 + * UPDATE HISTORY:
 + *                  Created 01/11/98
 + *                  DP (29/07/2006)
 + *                      Fix some bugs in the add_boot_rename_entry function
 + */
 +
 +/* INCLUDES *****************************************************************/
 +
 +#include <k32.h>
 +#include <malloc.h>
 +#define NDEBUG
 +#include <debug.h>
 +DEBUG_CHANNEL(kernel32file);
 +
 +/* GLOBALS *****************************************************************/
 +
 +/* FUNCTIONS ****************************************************************/
 +static BOOL
 +RemoveReadOnlyAttributeW(IN LPCWSTR lpFileName)
 +{
 +    DWORD Attributes;
 +    Attributes = GetFileAttributesW(lpFileName);
 +    if (Attributes != INVALID_FILE_ATTRIBUTES)
 +    { 
 +        return SetFileAttributesW(lpFileName,Attributes - 
 +                                            (Attributes & ~FILE_ATTRIBUTE_READONLY));
 +    }
 + 
 +    return FALSE;
 +}
 +
 +
 +/***********************************************************************
 + *           add_boot_rename_entry
 + *
 + * Adds an entry to the registry that is loaded when windows boots and
 + * checks if there are some files to be removed or renamed/moved.
 + * <fn1> has to be valid and <fn2> may be NULL. If both pointers are
 + * non-NULL then the file is moved, otherwise it is deleted.  The
 + * entry of the registrykey is always appended with two zero
 + * terminated strings. If <fn2> is NULL then the second entry is
 + * simply a single 0-byte. Otherwise the second filename goes
 + * there. The entries are prepended with \??\ before the path and the
 + * second filename gets also a '!' as the first character if
 + * MOVEFILE_REPLACE_EXISTING is set. After the final string another
 + * 0-byte follows to indicate the end of the strings.
 + * i.e.:
 + * \??\D:\test\file1[0]
 + * !\??\D:\test\file1_renamed[0]
 + * \??\D:\Test|delete[0]
 + * [0]                        <- file is to be deleted, second string empty
 + * \??\D:\test\file2[0]
 + * !\??\D:\test\file2_renamed[0]
 + * [0]                        <- indicates end of strings
 + *
 + * or:
 + * \??\D:\test\file1[0]
 + * !\??\D:\test\file1_renamed[0]
 + * \??\D:\Test|delete[0]
 + * [0]                        <- file is to be deleted, second string empty
 + * [0]                        <- indicates end of strings
 + *
 + */
 +static BOOL add_boot_rename_entry( LPCWSTR source, LPCWSTR dest, DWORD flags )
 +{
 +    static const WCHAR ValueName[] = {'P','e','n','d','i','n','g',
 +                                      'F','i','l','e','R','e','n','a','m','e',
 +                                      'O','p','e','r','a','t','i','o','n','s',0};
 +
 +    UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Session Manager");
 +
 +    static const int info_size = FIELD_OFFSET( KEY_VALUE_PARTIAL_INFORMATION, Data );
 +
 +    OBJECT_ATTRIBUTES ObjectAttributes;
 +    UNICODE_STRING nameW, source_name, dest_name;
 +    KEY_VALUE_PARTIAL_INFORMATION *info;
 +    BOOL rc = FALSE;
 +    HANDLE Reboot = NULL;
 +    DWORD len1, len2;
 +    DWORD DestLen = 0;
 +    DWORD DataSize = 0;
 +    BYTE *Buffer = NULL;
 +    WCHAR *p;
 +    NTSTATUS Status;
 +
 +    TRACE("add_boot_rename_entry( %S, %S, %d ) \n", source, dest, flags);
 +
 +    if(dest)
 +        DestLen = wcslen(dest);
 +
 +    if (!RtlDosPathNameToNtPathName_U( source, &source_name, NULL, NULL ))
 +    {
 +        SetLastError( ERROR_PATH_NOT_FOUND );
 +        return FALSE;
 +    }
 +    dest_name.Buffer = NULL;
 +    if (DestLen && !RtlDosPathNameToNtPathName_U( dest, &dest_name, NULL, NULL ))
 +    {
 +        RtlFreeHeap( RtlGetProcessHeap(), 0, source_name.Buffer );
 +        SetLastError( ERROR_PATH_NOT_FOUND );
 +        return FALSE;
 +    }
 +
 +    InitializeObjectAttributes(&ObjectAttributes,
 +                               &KeyName,
 +                               OBJ_OPENIF | OBJ_CASE_INSENSITIVE,
 +                               NULL,
 +                               NULL);
 +
 +     Status = NtCreateKey(&Reboot, 
 +                          KEY_QUERY_VALUE | KEY_SET_VALUE,
 +                          &ObjectAttributes,
 +                          0,
 +                          NULL,
 +                          REG_OPTION_NON_VOLATILE,
 +                          NULL);
 +
 +     if (Status == STATUS_ACCESS_DENIED)
 +     {
 +         Status = NtCreateKey(
 +             &Reboot, 
 +             KEY_QUERY_VALUE | KEY_SET_VALUE,
 +             &ObjectAttributes,
 +             0,
 +             NULL,
 +             REG_OPTION_BACKUP_RESTORE,
 +             NULL);
 +     }
 +
 +    if (!NT_SUCCESS(Status))
 +    {
 +        WARN("NtCreateKey() failed (Status 0x%lx)\n", Status);
 +        if (source_name.Buffer)
 +            RtlFreeHeap(RtlGetProcessHeap(), 0, source_name.Buffer);
 +        if (dest_name.Buffer)
 +            RtlFreeHeap(RtlGetProcessHeap(), 0, dest_name.Buffer);
 +        return FALSE;
 +    }
 +
 +    len1 = source_name.Length + sizeof(WCHAR);
 +    if (DestLen)
 +    {
 +        len2 = dest_name.Length + sizeof(WCHAR);
 +        if (flags & MOVEFILE_REPLACE_EXISTING)
 +            len2 += sizeof(WCHAR); /* Plus 1 because of the leading '!' */
 +    }
 +    else
 +    {
 +        len2 = sizeof(WCHAR); /* minimum is the 0 characters for the empty second string */
 +    }
 +
 +    RtlInitUnicodeString( &nameW, ValueName );
 +
 +    /* First we check if the key exists and if so how many bytes it already contains. */
 +    Status = NtQueryValueKey(
 +        Reboot,
 +        &nameW,
 +        KeyValuePartialInformation,
 +        NULL,
 +        0, 
 +        &DataSize );
 +    if ((Status == STATUS_BUFFER_OVERFLOW) ||
 +        (Status == STATUS_BUFFER_TOO_SMALL))
 +    {
 +        if (!(Buffer = HeapAlloc(GetProcessHeap(), 0, DataSize + len1 + len2 + sizeof(WCHAR))))
 +            goto Quit;
 +        Status = NtQueryValueKey(Reboot, &nameW, KeyValuePartialInformation,
 +            Buffer, DataSize, &DataSize);
 +        if(!NT_SUCCESS(Status))
 +            goto Quit;
 +        info = (KEY_VALUE_PARTIAL_INFORMATION *)Buffer;
 +        if (info->Type != REG_MULTI_SZ) goto Quit;
 +        if (DataSize > sizeof(info)) DataSize -= sizeof(WCHAR);  /* remove terminating null (will be added back later) */
 +    }
 +    else
 +    {
 +        DataSize = info_size;
 +        if (!(Buffer = HeapAlloc( GetProcessHeap(), 0, DataSize + len1 + len2 + sizeof(WCHAR) )))
 +            goto Quit;
 +    }
 +
 +    memcpy( Buffer + DataSize, source_name.Buffer, len1 );
 +    DataSize += len1;
 +    p = (WCHAR *)(Buffer + DataSize);
 +    if (DestLen)
 +    {
 +        if (flags & MOVEFILE_REPLACE_EXISTING)
 +            *p++ = '!';
 +        memcpy( p, dest_name.Buffer, len2 );
 +        DataSize += len2;
 +    }
 +    else
 +    {
 +        *p = 0;
 +        DataSize += sizeof(WCHAR);
 +    }
 +
 +    /* add final null */
 +    p = (WCHAR *)(Buffer + DataSize);
 +    *p = 0;
 +    DataSize += sizeof(WCHAR);
 +
 +    rc = NT_SUCCESS(NtSetValueKey(Reboot, &nameW, 0, REG_MULTI_SZ, Buffer + info_size, DataSize - info_size));
 +
 + Quit:
 +    RtlFreeHeap(RtlGetProcessHeap(), 0, source_name.Buffer);
 +    if (dest_name.Buffer)
 +        RtlFreeHeap(RtlGetProcessHeap(), 0, dest_name.Buffer);
 +    NtClose(Reboot);
 +    if(Buffer)
 +        HeapFree(GetProcessHeap(), 0, Buffer);
 +    return(rc);
 +}
 +
 +
 +/*
 + * @implemented
 + */
 +BOOL
 +WINAPI
 +MoveFileWithProgressW (
 +      LPCWSTR                 lpExistingFileName,
 +      LPCWSTR                 lpNewFileName,
 +      LPPROGRESS_ROUTINE      lpProgressRoutine,
 +      LPVOID                  lpData,
 +      DWORD                   dwFlags
 +      )
 +{
 +      HANDLE hFile = NULL, hNewFile = NULL;
 +      IO_STATUS_BLOCK IoStatusBlock;
 +    OBJECT_ATTRIBUTES ObjectAttributes;
 +      PFILE_RENAME_INFORMATION FileRename;
 +      NTSTATUS errCode;
 +      BOOL Result;
 +      UNICODE_STRING DstPathU;
 +      BOOL folder = FALSE;
 +
 +      TRACE("MoveFileWithProgressW()\n");
 +
 +      if (dwFlags & MOVEFILE_DELAY_UNTIL_REBOOT)
 +              return add_boot_rename_entry( lpExistingFileName, lpNewFileName, dwFlags );
 +
 +//    if (dwFlags & MOVEFILE_WRITE_THROUGH)
 +//        FIXME("MOVEFILE_WRITE_THROUGH unimplemented\n");
 +
 +    if (!lpNewFileName)
 +        return DeleteFileW(lpExistingFileName);
 +
 +    /* validate & translate the filename */
 +    if (!RtlDosPathNameToNtPathName_U (lpNewFileName,
 +                                         &DstPathU,
 +                                         NULL,
 +                                         NULL))
 +    {
 +        WARN("Invalid destination path\n");
 +        SetLastError(ERROR_PATH_NOT_FOUND);
 +        return FALSE;
 +    }
 +
 +    InitializeObjectAttributes(&ObjectAttributes,
 +                               &DstPathU,
 +                               OBJ_CASE_INSENSITIVE,
 +                               NULL,
 +                               NULL);
 +
 +    errCode = NtOpenFile( &hNewFile,
 +                          GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
 +                          &ObjectAttributes,
 +                          &IoStatusBlock,
 +                          0,
 +                          FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT |
 +                          ((dwFlags & MOVEFILE_WRITE_THROUGH) ? FILE_WRITE_THROUGH : 0) );
 +
 +    if (NT_SUCCESS(errCode)) /* Destination exists */
 +    {
 +        NtClose(hNewFile);
 +
 +        if (!(dwFlags & MOVEFILE_REPLACE_EXISTING))
 +        {
 +                      SetLastError(ERROR_ALREADY_EXISTS);
 +                      return FALSE;
 +      }
 +      else if (GetFileAttributesW(lpNewFileName) & FILE_ATTRIBUTE_DIRECTORY)
 +      {
 +              SetLastError(ERROR_ACCESS_DENIED);
 +              return FALSE;
 +      }
 +    }
 +
 +      hFile = CreateFileW (lpExistingFileName,
 +                           GENERIC_ALL,
 +                           FILE_SHARE_WRITE|FILE_SHARE_READ,
 +                           NULL,
 +                           OPEN_EXISTING,
 +                           FILE_FLAG_BACKUP_SEMANTICS |
 +                           ((dwFlags & MOVEFILE_WRITE_THROUGH) ? FILE_FLAG_WRITE_THROUGH : 0),
 +                           NULL);
 +
 +      if (hFile == INVALID_HANDLE_VALUE)
 +      {
 +          return FALSE;
 +      }
 +
 +      FileRename = RtlAllocateHeap(
 +              RtlGetProcessHeap(),
 +              HEAP_ZERO_MEMORY,
 +              sizeof(FILE_RENAME_INFORMATION) + DstPathU.Length);
 +      if( !FileRename ) {
 +              CloseHandle(hFile);
 +              SetLastError(ERROR_NOT_ENOUGH_MEMORY);
 +              return FALSE;
 +      }
 +      if( dwFlags & MOVEFILE_REPLACE_EXISTING ) {
 +              FileRename->ReplaceIfExists = TRUE;
 +      }
 +      else {
 +              FileRename->ReplaceIfExists = FALSE;
 +      }
 +
 +
 +      memcpy(FileRename->FileName, DstPathU.Buffer, DstPathU.Length);
 +        RtlFreeHeap (RtlGetProcessHeap (),
 +                   0,
 +                   DstPathU.Buffer);
 +
 +      FileRename->FileNameLength = DstPathU.Length;
 +      errCode = NtSetInformationFile (hFile,
 +                                      &IoStatusBlock,
 +                                      FileRename,
 +                                      sizeof(FILE_RENAME_INFORMATION) + DstPathU.Length,
 +                                      FileRenameInformation);
 +      CloseHandle(hFile);
 +      RtlFreeHeap(RtlGetProcessHeap(), 0, FileRename);
 +
 +      if (GetFileAttributesW(lpExistingFileName) & FILE_ATTRIBUTE_DIRECTORY)
 +      {
 +           folder = TRUE;
 +      }
 +
 +      
 +      /*
 +       *  FIXME:
 +       *  Fail now move the folder 
 +       *  Before we fail at CreateFileW 
 +       */
 +       
 +       
 +      if (NT_SUCCESS(errCode))
 +      {
 +              Result = TRUE;
 +      }
 +      else 
 +      {
 +              if (folder==FALSE)
 +              {
 +                  Result = CopyFileExW (lpExistingFileName,
 +                                    lpNewFileName,
 +                                    lpProgressRoutine,
 +                                    lpData,
 +                                    NULL,
 +                                    (dwFlags & MOVEFILE_REPLACE_EXISTING) ? 0 : COPY_FILE_FAIL_IF_EXISTS);
 +                  if (Result)
 +                  {
 +                      /* Cleanup the source file */                   
 +                      Result = DeleteFileW (lpExistingFileName);
 +                  }
 +                  }
 +               else
 +               {
 +                 /* move folder code start */
 +                 WIN32_FIND_DATAW findBuffer;
 +                 LPWSTR lpExistingFileName2 = NULL;
 +                 LPWSTR lpNewFileName2 = NULL; 
 +                 LPWSTR lpDeleteFile = NULL;
 +                 INT size;
 +                 INT size2;
 +                 BOOL loop = TRUE;
 +                 BOOL Result = FALSE;
 +                 INT max_size = MAX_PATH;
 +
 +
 +                                 /* Build the string */
 +                 size = wcslen(lpExistingFileName); 
 +                 if (size+6> max_size)
 +                         max_size = size + 6;
 +
 +                 lpDeleteFile = (LPWSTR) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,max_size * sizeof(WCHAR));
 +                 if (lpDeleteFile == NULL)               
 +                     return FALSE;                              
 +
 +                 lpNewFileName2 = (LPWSTR) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,max_size * sizeof(WCHAR));
 +                 if (lpNewFileName2 == NULL)
 +                 {            
 +                   HeapFree(GetProcessHeap(),0,(VOID *)  lpDeleteFile);
 +                       return FALSE;
 +                 }
 +
 +                 lpExistingFileName2 = (LPWSTR) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,max_size * sizeof(WCHAR));
 +                 if (lpExistingFileName2 == NULL)
 +                 {            
 +                   HeapFree(GetProcessHeap(),0,(VOID *)  lpNewFileName2);                                                     
 +                   HeapFree(GetProcessHeap(),0,(VOID *) lpDeleteFile);                
 +                   return FALSE;
 +                 }                               
 +              
 +                 wcscpy( (WCHAR *)lpExistingFileName2,lpExistingFileName);
 +                 wcscpy( (WCHAR *)&lpExistingFileName2[size],L"\\*.*\0");
 +        
 +                 /* Get the file name */
 +                 memset(&findBuffer,0,sizeof(WIN32_FIND_DATAW));
 +                 hFile = FindFirstFileW(lpExistingFileName2,  &findBuffer);
-                          FindClose(hFile);                         
++                 if (hFile == INVALID_HANDLE_VALUE) 
 +                     loop=FALSE;
 +
 +                 if (findBuffer.cFileName[0] == L'\0')
 +                     loop=FALSE;
 +              
 +
 +                  /* FIXME 
 +                       * remove readonly flag from source folder and do not set the readonly flag to dest folder 
 +                       */
 +                 RemoveReadOnlyAttributeW(lpExistingFileName);
 +           RemoveReadOnlyAttributeW(lpNewFileName);
 +                 //CreateDirectoryExW(lpExistingFileName,lpNewFileName,NULL);
 +                 CreateDirectoryW(lpNewFileName, NULL);
 +                                 
 +                 /* search the files/folders and move them */
 +                 while (loop==TRUE)
 +                 {    
 +                   Result = TRUE;
 +
 +                   if ((!wcscmp(findBuffer.cFileName,L"..")) || (!wcscmp(findBuffer.cFileName,L".")))
 +                   {            
 +                     loop = FindNextFileW(hFile, &findBuffer);                  
 +                                
 +                     if (!loop)
 +                     {                                         
 +                       size = wcslen(lpExistingFileName2)-4;
 +                       FindClose(hFile);
++                       hFile = INVALID_HANDLE_VALUE;
++
 +                       wcscpy( &lpExistingFileName2[size],L"\0");
 +
 +                       if (wcsncmp(lpExistingFileName,lpExistingFileName2,size))
 +                       {  
 +                                 DWORD Attributes;
 +
 +                                 /* delete folder */                                                                   
 +                                 TRACE("MoveFileWithProgressW : Delete folder : %S\n",lpDeleteFile);
 +
 +                                 /* remove system folder flag other wise we can not delete the folder */
 +                                 Attributes = GetFileAttributesW(lpExistingFileName2);
 +                   if (Attributes != INVALID_FILE_ATTRIBUTES)
 +                   {  
 +                     SetFileAttributesW(lpExistingFileName2,(Attributes & ~FILE_ATTRIBUTE_SYSTEM));
 +                                 }
 +                                 
 +                                 RemoveReadOnlyAttributeW(lpExistingFileName2);
 +                                                                         
 +                                 Result = RemoveDirectoryW(lpExistingFileName2);
 +                                 if (Result == FALSE)
 +                                     break;
 +                                                               
 +                                 loop=TRUE;                                                            
 +                                 size = wcslen(lpExistingFileName); 
 +                              
 +                                 if (size+6>max_size)
 +                                 {                                   
 +                            if (lpNewFileName2 != NULL)                                       
 +                                HeapFree(GetProcessHeap(),0,(VOID *)  lpNewFileName2);
 +                         
 +                            if (lpExistingFileName2 != NULL)                            
 +                                HeapFree(GetProcessHeap(),0,(VOID *) lpExistingFileName2);            
 +                                         
 +                            if (lpDeleteFile != NULL)                         
 +                                HeapFree(GetProcessHeap(),0,(VOID *) lpDeleteFile);           
 +                        
 +                                    return FALSE;
 +                                 }
 +
 +                                 wcscpy( lpExistingFileName2,lpExistingFileName);
 +                                 wcscpy( &lpExistingFileName2[size],L"\\*.*\0");
 +
 +                                 /* Get the file name */
 +                                 memset(&findBuffer,0,sizeof(WIN32_FIND_DATAW));
 +                                 hFile = FindFirstFileW(lpExistingFileName2, &findBuffer);                     
 +                       }
 +               }                
 +               continue;                                
 +             }
 +                        
 +                   if (findBuffer.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
 +                   {                 
 +
 +               /* Build the new src string */                                           
 +               size = wcslen(findBuffer.cFileName); 
 +               size2= wcslen(lpExistingFileName2);
 +
 +               if (size2+size+6>max_size)
 +               {
 +                    FindClose(hFile);                  
 +
 +                       if (lpNewFileName2 != NULL)                                    
 +                            HeapFree(GetProcessHeap(),0,(VOID *)  lpNewFileName2);
 +                         
 +                       if (lpExistingFileName2 != NULL)                                 
 +                            HeapFree(GetProcessHeap(),0,(VOID *) lpExistingFileName2);                
 +                                         
 +                       if (lpDeleteFile != NULL)                              
 +                            HeapFree(GetProcessHeap(),0,(VOID *) lp