From a0b3a370b8d19f51e8471c543e0ce447bf548431 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 17 Feb 2010 16:42:53 -0600 Subject: [PATCH] Fix quirk in open-in-explorer -- msft explorer wouldn't go to previous directory correctly if / was a path separator --- basis/tools/deploy/windows/windows.factor | 7 ++++++- basis/windows/shell32/shell32.factor | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/basis/tools/deploy/windows/windows.factor b/basis/tools/deploy/windows/windows.factor index 1dd60583fa..f52154ccd0 100755 --- a/basis/tools/deploy/windows/windows.factor +++ b/basis/tools/deploy/windows/windows.factor @@ -5,7 +5,8 @@ io.encodings.ascii kernel namespaces sequences locals system splitting tools.deploy.backend tools.deploy.config tools.deploy.config.editor assocs hashtables prettyprint combinators windows.kernel32 windows.shell32 windows.user32 -alien.c-types vocabs.metadata vocabs.loader tools.deploy.windows.ico ; +alien.c-types vocabs.metadata vocabs.loader tools.deploy.windows.ico +io.files.windows.nt ; IN: tools.deploy.windows CONSTANT: app-icon-resource-id "APPICON" @@ -22,6 +23,10 @@ CONSTANT: app-icon-resource-id "APPICON" dup copy-dll deploy-ui? get ".exe" ".com" ? copy-vm ; +: open-in-explorer ( dir -- ) + [ f "open" ] dip absolute-path normalize-separators + f f SW_SHOWNORMAL ShellExecute drop ; + : embed-ico ( vm vocab -- ) dup vocab-windows-icon-path vocab-append-path dup exists? [ binary file-contents app-icon-resource-id embed-icon-resource ] diff --git a/basis/windows/shell32/shell32.factor b/basis/windows/shell32/shell32.factor index 08474d4bdd..30104e7723 100644 --- a/basis/windows/shell32/shell32.factor +++ b/basis/windows/shell32/shell32.factor @@ -87,9 +87,6 @@ ALIAS: SHGetFolderPath SHGetFolderPathW FUNCTION: HINSTANCE ShellExecuteW ( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ) ; ALIAS: ShellExecute ShellExecuteW -: open-in-explorer ( dir -- ) - [ f "open" ] dip absolute-path f f SW_SHOWNORMAL ShellExecute drop ; - : shell32-directory ( n -- str ) f swap f SHGFP_TYPE_DEFAULT MAX_UNICODE_PATH -- 2.34.1