GetCommandLine() on Windows?

Discuss any general programming issues here
Post Reply
alfkil
Posts: 25
Joined: Sun Feb 14, 2010 1:54 pm

GetCommandLine() on Windows?

Post by alfkil »

I guess this is not possible on windows, since it returns n = 0?

I don't know much about windows, but is it possible somehow to know, if a file was opened with a hollywood app?
For instance, me and my friend have done a small image viewer app, and he wants to be able to use it as his standard tool for opening images.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GetCommandLine() on Windows?

Post by airsoftsoftwair »

GetCommandLine() works on Windows but not for your purpose. The problem is that GetCommandLine() only returns arguments that are passed to the app in the form of hyphenated arguments, i.e.

Code: Select all

myapp.exe filename -arg1 val1 -arg2 val2 -arg3 val3
GetCommandLine() will handle -arg1 to -arg3 just fine but not the filename argument because it is always passed to the app directly and not in a hyphenated form. I might add a new function for this in the future so that you will also be able to read the filename passed to compiled Hollywood scripts. This is currently not implemented because it's not always so easy. On Amiga one has to distinguish between CLI and WB start and on Mac OS X the filename is passed as a special Apple Finder event etc. But it might be added in the future.
alfkil
Posts: 25
Joined: Sun Feb 14, 2010 1:54 pm

Re: GetCommandLine() on Windows?

Post by alfkil »

Ok, thanks for the response. I really hope to see something like that implemented in a later version! :-)
admin
Site Admin
Posts: 149
Joined: Fri Feb 12, 2010 12:21 pm

Re: GetCommandLine() on Windows?

Post by admin »

Code: Select all

- New: GetFileArgument() allows you to retrieve the file argument passed to a compiled Hollywood
script; useful if you want to develop an application that should be used as a default tool
for a certain file type etc.; this function will only work correctly with compiled scripts;
for normal scripts, it will always return "" (empty string) (requested by Alfkil Wennermark)
Post Reply