hi there!

i spent many hours reading this forum in the past and i'm happy there's such a nice place for assembly language programming on the web, with so many helpful people and valuable information.

ok my problem:
i have told windows95 to open all "*.bla" files with myprogram.exe, so when i double click on such a file e.g. "longfilename.bla" and i invoke getcommandline i get "c:\masm32\blah\myprogram.exe longfi~1.bla" ....is there a possibility to get the _entire_ filename instead of the 8.3 format? or how could i easily find the original filename if i have the alias?

since i'm pretty new to win32asm it's quite possible that there is a very obvious solution but really, i have no idea what it is.

i hope anybody can help me... thanks in advance & have a nice day
Posted on 2003-03-10 16:14:03 by c--
I've found that GetCommandLine returns filename (argv[0] if you may) based on where it is ran from. You can specficially see in Windows 2000, where you have Win32 shell (cmd.exe) and DOS shell (command.com). Any program ran from win32 shell (cmd.exe, explorer.exe, etc) would receive full filename. Anything ran from DOS shells (command.com, nc.exe, etc) would receive 8.3 filename.
Posted on 2003-03-10 22:41:27 by comrade

You can try the __getmainargs function provided by msvcrt.dll



Posted on 2003-03-11 02:05:44 by Vortex
i tried it with winxp and it seems like it's some sort of chance if it works or not. i don't know how to control which "command"-program windows uses. sometimes the argument was in 8.3 format and sometimes not, and once it even was only partially uppercase. the only thing i changed between these tests was the path to my testprogram.

now i moved the program to it's "final" location on winxp and it seems to work, but i'm not able to tell you what was wrong, because for any reason winxp wont let me change the program assignment again. it always forces me to use the standard editor... i don't know.
but since it works now and it's only a small utility with no need to run error free on all computers, i will leave it this way and do further checks at a later time.

thanks again, nice week to all

Posted on 2003-03-13 16:41:04 by c--