Windows Application Command Line

This is a discussion on Windows Application Command Line within the Windows Programming forums, part of the Platform Specific Boards category; As a part of the WinMain function, LPSTR lpszCmdLine is accepted, but how is it different from the old dos ...

  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 02: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, 11:30 AM
  2. First Windows Application Error
    By Grimmy in forum Windows Programming
    Replies: 15
    Last Post: 03-06-2006, 08: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21