Thread: Running Parameters

  1. #1
    Registered User
    Join Date
    Apr 2008

    Running Parameters

    Hey, I am pretty new to C and I am reading from books/websites but i wanted to take a break and learn how to pass/run parameters...

    Example: test.exe -parameter

    I want to have it read the parameter and set it as a handle to use later .

    So I'd like to know...

    -- How to grab a parameter and then use it in the C program.
    -- How to convert it to a HWND type if it isn't already :P.


  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    I have no idea how you make something into a HWND - as a handle to a window, I believe (but I could be wrong), is per process, it wouldn't make much sense to pass one along from somewhere else.

    But the FAQ describes how you get command line arguments into your program:

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Well basically i already got a program to grab a handle... But the program isn't able to send keys very well and PostMessage works great...

    So... I want to have my main proggy run the C prog .exe and have the handle in the parameter...

    Understand? ><.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 12-09-2008, 11:09 AM
  2. Check number of times a process is running
    By linuxwolf in forum Windows Programming
    Replies: 6
    Last Post: 10-17-2008, 11:08 AM
  3. Parameters quick Question
    By lifeis2evil in forum C++ Programming
    Replies: 2
    Last Post: 11-18-2007, 11:12 PM
  4. function with variable number of parameters
    By mikahell in forum C++ Programming
    Replies: 3
    Last Post: 07-23-2006, 03:35 PM
  5. multithreading question
    By ichijoji in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2005, 10:59 PM