Getcommandline function in Win32

Source: Internet
Author: User

I just learned that I don't quite understand the function of getcommandline, so I searched for it online and made a note, which is not necessarily accurate. I hope you can give me some advice.

Win32 executableProgramThere are two types: console-based and Windows-based. The portal function of the console program is a traditional main function, while the window function is winmain. One major difference between these two entry functions is the processing of command line parameters. The prototype of the winmain function is:

IntWinapi winmain (hinstance, hinstance hprevinstance, lpstr lpcmdline,IntNshowcmd)

Window applications require support from command line parameters, that is, the third parameter of the winmain function. For example, when we open a TXT file, we can use notepad.exe c: \ abc.txt, in this case, c: \ abc.txtindicates a command line, and the command line prompts the application notepad.exe: the file to be opened is the file path in this example.

The getcommandline function is used to obtain the command line parameters of the program and pass them to the winmain function as parameters.

Invoke getcommandline;
MoV CommandLine, eax

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.