Link to home
Start Free TrialLog in
Avatar of Cyber-Dragon
Cyber-Dragon

asked on

C++ Passing Parameters to Silent Program

In a prior question I asked how to make the console window not show up in a Windows application and I was told to replace void main() with int __stdcall WinMain(), which worked perfectly. But now I wish to pass this silent program parameters when I execute the program from an external program and I am unsure of how I would do this with this function.

Previous Question: https://www.experts-exchange.com/questions/24330131/C-Hiding-Console-Window-of-Application.html

Can anyone help me?
Avatar of JohnGaby
JohnGaby
Flag of Afghanistan image

WinMain can also have parameters which include the command line:

http://msdn.microsoft.com/en-us/library/ms633559(VS.85).aspx
Avatar of Cyber-Dragon
Cyber-Dragon

ASKER

I don't quite understand this:
lpCmdLine
[in] Pointer to a null-terminated string specifying the command line for the application, excluding the program name. To retrieve the entire command line, use the GetCommandLine function.
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> If you have an ANSI project you may use the following function instead.
Yup, very true... I probably should have pointed this out. Thanks Alex.
>>>> I probably should have pointed this out.

I actually looked first for the CommandLineToArgvA in WINAPI and was puzzled that it doesn't exist. And writing the code above took more time than I thought ;-)
{http:#24178622} answers this with {http:#24187857} assisting.