Thread: How can I pass arguments through a GUI (win32)?

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    241

    How can I pass arguments through a GUI (win32)?

    Hey, I learned how to make a GUI and I see all the buttons and other neato things I can do, the thing is how do I give them values to pass through the main program? Also, does the GUI and main program have to be in the same source file?
    Sorry if my questions were naive and/or worded poorly or vague.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    If by GUI in the same source file you mean the window procedure then no but you'll need to declare it's prototype in a header and include the header in the source file that calls CreateWindowEx so that it knows where to look for the function defination.

    As for giving them values. There are messages like EM_SETTEXT/WM_SETTEXT for setting the tex on controls. Some controls like listboxes let you set an lParam value to each item when you send the appropriate message.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    241
    Quote Originally Posted by Quantum1024
    If by GUI in the same source file you mean the window procedure then no but you'll need to declare it's prototype in a header and include the header in the source file that calls CreateWindowEx so that it knows where to look for the function defination.

    As for giving them values. There are messages like EM_SETTEXT/WM_SETTEXT for setting the tex on controls. Some controls like listboxes let you set an lParam value to each item when you send the appropriate message.
    Ugh, that is confusing, how is the input supposed to reach the main source for like what was typed in the edit box and stuff...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GUI Programming...
    By ShadeS_07 in forum C++ Programming
    Replies: 12
    Last Post: 12-28-2008, 04:58 PM
  2. Command Line Arguments Dilemma!!
    By Want2Know in forum C Programming
    Replies: 2
    Last Post: 09-14-2005, 10:35 AM
  3. Thread Synchronization :: Win32 API vs. MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-09-2002, 09:09 AM
  4. .NET And GUI Programming :: C++
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 01-27-2002, 04:22 PM
  5. GUI Programming :: C++ Exclusive
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2002, 03:22 PM