| | |
Windows Main and Command Line Parameters
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Does anyone know how to have a windows program accept command line options?
For example a terminal program just needs a parameter in the main function to accept command line parameters, how can I do the same for a windows main functions, since parameters are already there?
For example a terminal program just needs a parameter in the main function to accept command line parameters, how can I do the same for a windows main functions, since parameters are already there?
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
From the Win32 API reference (as supplied by Microsoft):
You're not getting it as a nice array of commandline arguments but you are getting it.
Full helpfile is available here: http://www.borland.com/devsupport/bo...s/BC52HLP1.ZIP (it's a Microsoft file supplied by Borland including complete search index).
C Syntax (Toggle Plain Text)
int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // pointer to command line int nCmdShow // show state of window );
•
•
•
•
lpCmdLine
Points to a null-terminated string specifying the command line for the application.
Full helpfile is available here: http://www.borland.com/devsupport/bo...s/BC52HLP1.ZIP (it's a Microsoft file supplied by Borland including complete search index).
![]() |
Similar Threads
- how to run windows installer from the command line (C#)
- command line parameters part 2! (VB.NET)
- Command line parameters (VB.NET)
- command line arguments help (C)
- Using command line parameters (C++)
Other Threads in the C Forum
- Previous Thread: can anyone assiat in getting my function to work?
- Next Thread: (dda)
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks bash binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h






