Thread: Windows Application Command Line

  1. #1
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640

    Windows Application Command Line

    As a part of the WinMain function, LPSTR lpszCmdLine is accepted, but how is it different from the old dos main function?
    Does it just contain any parameters passed to the program, or does it also have the program name?
    I'm writing a small program I want to accept one file as a parameter upon opening.
    Can I just use lpszCmdLine as the file? Or do I need to purge it of other strings?
    Last edited by neandrake; 12-02-2003 at 03:25 PM.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  2. #2
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    Well, after some testing, I've found out this.
    lpCmdLine does not include the name of the program run.
    Ex.

    C:\> program.exe barf -two -zimbalabimbabazaladuzalademd

    lpCmdLine contains
    "barf -two -zimbalabimbabazaladuzalademd"

    (no quotes, obviously)
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows | Application proxy
    By Eddie Dean in forum C++ Programming
    Replies: 2
    Last Post: 03-31-2006, 12:30 PM
  2. First Windows Application Error
    By Grimmy in forum Windows Programming
    Replies: 15
    Last Post: 03-06-2006, 09:45 AM
  3. How do you program a windows application?
    By Chrisab508 in forum Windows Programming
    Replies: 8
    Last Post: 10-18-2003, 10:21 AM
  4. Application Termination Problem in Windows XP
    By wasabee in forum Windows Programming
    Replies: 2
    Last Post: 04-11-2003, 12:53 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM