News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

GetCurrentDirectory in Explorer, 2x, FreeCommander

Started by jj2007, December 10, 2013, 09:01:36 AM

Previous topic - Next topic

jj2007

Build this one:

include \masm32\include\masm32rt.inc

.data?
buffer   db MAX_PATH dup(?)

.code
start:
   invoke GetCurrentDirectory, MAX_PATH, addr buffer
   invoke GetCommandLine
   MsgBox 0, addr buffer, eax, MB_OK
   exit

end start


Then
1. launch it by selecting and hitting Enter
2. launch it by dragging a file over it

Only 2xExplorer shows a decent behaviour.

dedndave

no pictures ?   :(

you're going to make me build that up, install 2x and freecommander ????

Evan

Quote from: jj2007 on December 10, 2013, 09:01:36 AM
Build this one:

include \masm32\include\masm32rt.inc

.data?
buffer   db MAX_PATH dup(?)

.code
start:
   invoke GetCurrentDirectory, MAX_PATH, addr buffer
   invoke GetCommandLine
   MsgBox 0, addr buffer, eax, MB_OK
   exit

end start


Then
1. launch it by selecting and hitting Enter
2. launch it by dragging a file over it

Only 2xExplorer shows a decent behaviour.

Yeah umm naww it's okay I'll just keep writing lines that I know work.

Evan

Quote from: Evan on December 10, 2013, 11:29:31 AM
Quote from: jj2007 on December 10, 2013, 09:01:36 AM
Build this one:

include \masm32\include\masm32rt.inc

.data?
buffer   db MAX_PATH dup(?)

.code
start:
   invoke GetCurrentDirectory, MAX_PATH, addr buffer
   invoke GetCommandLine
   MsgBox 0, addr buffer, eax, MB_OK
   exit

end start


Then
1. launch it by selecting and hitting Enter
2. launch it by dragging a file over it

Only 2xExplorer shows a decent behaviour.

Yeah umm naww it's okay I'll just keep writing lines that I know work.
I'm like flying or something I thought this was a thread I started sorry.

sinsi

🍺🍺🍺

jj2007

Quote from: dedndave on December 10, 2013, 09:39:24 AM
you're going to make me build that up, install 2x and freecommander ????
Quote from: sinsi on December 10, 2013, 03:35:38 PM
Define "a decent behaviour"

Sorry, folks. Point is that FC and Windows Explorer surprised me with claiming that current folder (in my opinion C:\Masm32\Examples) was something crappy like C:\Users\jj\Documents

That was XP, now I'm on Win7-32, and it works as expected.

@Evan: This forum is not a playground. Post only if you have something substantial to contribute. There is the Romper room if you want to play around. And, please, don't quote entire posts, and don't open new threads for every little question you may have. Open one thread, e.g. "Beginner's questions", and keep posting there.

sinsi

I think it has to do with Microsoft wanting a "docu-centric" approach, that the document is more important than the program.
Open a text file with notepad, the title bar is "document.txt - Notepad"
🍺🍺🍺

Magnum

I can not find lite version on the site.


2xExplorer is officially pronounced dead. You can still download it for free, but that's about it. xplorer² is the way to the future. It comes with a "pro" and a "lite" version. The lite version is free and much more powerful than 2xExplorer, and you should really give it a try!
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

Back to WinXP SP3 (open=simply open the exe, drag=drag a file over the exe):

Open FreeCommander        current dir: D:\Masm32\examples
Drag FreeCommander        current dir: D:\xxx\FreeCommander

Open WinXP Explorer        current dir: D:\Masm32\examples
Drag WinXP Explorer        current dir: C:\Documents and Settings\user

Open 2xExplorer        current dir: D:\Masm32\examples
Drag 2xExplorer        current dir: D:\Masm32\examples


Interesting that Win7 behaves better. Apparently they have learned something ;-)

This may be a minor issue, but the dragged files were always in the same folder; so why set the obscure path "C:\Documents and Settings\user" as current directory??

Applications assuming that a filename without path is sufficient may fail miserably, if they don't explicitly set the current folder based either on the commandline or on the executable's path. They will work on Win7 but fail on XP.

By the way, a simple batch file behaves exactly the same:
@echo off
echo %cd% && pause


Quote from: sinsi on December 10, 2013, 06:58:55 PM
I think it has to do with Microsoft wanting a "docu-centric" approach, that the document is more important than the program.

I would agree if Windows Explorer set the current dir to the folder of the document passed in the commandline. But it doesn't, on XP...

Magnum

Works here.

C:\MASM32\SOURCE
Press any key to continue . . .
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org