Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

commandline options 1

Status
Not open for further replies.

finnmike

Programmer
Oct 17, 2001
50
DE
Hej guys,
has anybody written a win-application with option keys?
I need to run my prog as a service with some options predefined (such is a preselected treenode for example), so that it can be started by the win-taskagent. I do not want to write all the stuff which is doable with that timeplanner on my own, or do I need to?

Best regards,

Michael

... Welladay! Welladay!
For the winds of May!
Love is unhappy when love is away!
-excerpt,see my profile- James Joyce,1907
 
ParamCount() and ParamSrt() are in your system.hpp file so you can use them without doing anything special.

ParamCount will count the parameters sent.
ParamStr(i) where i is the parameter number, will give you the parameter.

Heres an example for you, you can put it in your FormCreate

for (int i=0;i<=paramcount();i++)
{
if (LowerCase(ParamStr(i))="=" "-a") /*do something special here*/
if (LowerCase(ParamStr(i))="=" "-b") /*do something different here*/
if (LowerCase(ParamStr(i))="=" "-c") /*do something extra specially different*/
}

Also on another note, ParamStr(0) returns the path and file name of the executing program.
 
Dear Ruggie,

this is what I thought to find, great!

Best regards,

Michael

Winds of May, that dance on the sea,
Dancing a ringaround in glee
From furrow to furrow, while overhead
The foam flies up to be garlanded...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top