-
For Exepath Try this..
As it was correctly suggested, The lpCmdLine parameter gives the CommandLine
argument for WinMain .But it doesnt include the exe name.It only gives parameters
which are separated by spaces(char 32).
To get complete commandline argument like we get on DOS try ,
char *CmdArg=GetCommandLine();
Now CmdArg Contains the entire commandline arguments including exepath separated
by blanks.
So to retrieve our exe name just simply search for first blank.
Some thing like..
/*--------------------------------*/
char *CmdArg=GetCommandLine();
char *ExePath= strchr(CmdArg,32); //Searching First blank space
if(ExePath!=NULL)
*ExePath='\0';
MessageBox(NULL,ExePath,"ExePath",MB_OK);
/*-----------------------------------*/
The above gives the messagebox with exepath. When commandline contains no
arguments then ExePath would be NULL.
Hope this will do.
Thanking you,
Yours,
P.GopalaKrishna.
"Johnny" <p166@freemail.hu> wrote:
>
>Hi!
>
>I tried what you say, but how can I get these datas? In DOS it was very
simple
>but in Windows how can I get it? (my system is Win98SE)
>
>"jonnin" <jonnin@vol.com> wrote:
>>
>>should be the first commandline argument (you can add these to windows
programs
>>as well). This may vary on windows versions, so double check what happens
>>here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks