How can I create a window application instead of a console one?

This is a discussion on How can I create a window application instead of a console one? within the C Programming forums, part of the General Programming Boards category; Hi! I'd like to ask you if there is any way to "convert" a console application to a window one. ...

  1. #1
    Registered User paok's Avatar
    Join Date
    Nov 2007
    Posts
    8

    How can I create a window application instead of a console one?

    Hi! I'd like to ask you if there is any way to "convert" a console application to a window one. I use Dev C++, and I see that there is an option for window application, but I don't know how to use the window.h! Is there any tutorial? I want to build a window application which looks like the attached image. Each of the selection that the user makes will be stored in a variable which will be used by the program!
    Attached Images Attached Images  

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    GUI programming is a big step up from console applications.

    I'm sure there are few sites that describe it.

    In your case, you need a dialog box with a few radio buttons and a text entry field.

    Here's one tutorial:
    http://www.functionx.com/win32/Lesson01.htm

    --
    Mats
    Last edited by matsp; 11-29-2007 at 10:04 AM.
    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.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    48
    I'm pretty new in C. Wich is the best visual editor to get this done?. It's just a lot of code to write. Thanks!.

  5. #5
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    VC++ is free for the downloading. If you want to write Windows apps, it's a good choice.

  6. #6
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,614
    Visual Studio Express is usually recommended by many.

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    1

    This site is a good entry point to windows programming


  8. #8
    Aia
    Aia is offline
    Beautiful to C Aia's Avatar
    Join Date
    Jun 2007
    Posts
    124
    Here. Knock yourself out!

  9. #9
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    In general, if you're brand new to C and are not experienced with pointers (including function pointers), structs, functions, memory management, and strings, don't do GUI programming just yet. Stick with console programming until you get good with the language.

    This should be a warning somewhere.

  10. #10
    Registered User paok's Avatar
    Join Date
    Nov 2007
    Posts
    8
    I've read some things about window programming, but I don't understand....!! My code is written in c. Window Programming is something different? Is it like another programming language? Can I use my c code, doing some changes, or I have to write all the code using another language? Is there any way just put a user interfcace in the c code?
    You may think that I'm asking stupid questions.....sorry, I haven't understood....!

  11. #11
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,614
    No, it's not a different language. But it's more than just pure "C."
    Maybe someone else can explain better, I don't have time.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,682
    Well i don't really program windows, but what i understand is that, if you wanted to do a windows programming there are many API which does that for you. You will have to clearly understand the functioning of those API's and see what parameters need to be sent and all those calculation. More over windows API function names are like so crazy its very hard for me remember. But MSDN would be a good friend for you. As other said , if u are new to C, i would rather suggest to start programming with console get familiarized and then get started with windows.

    ssharish

  13. #13
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,614
    The thing is, with dos prompts, there isn't much you really have to do or understand. Much other than some basic functions for I/O and the language itself.
    When it comes to windows programming, it's like an entirely different world. Not only must you know the language, but you must also know the OS, what to do and what not to do. Creating a simple thing such as a window is no trivial task. Messages are no trivial task, you have to have such a thing as message pump and respond to messages. You may have to worry about how threads work, and so on.
    This is where the difficulty lies. And even if you think you do right (this applies especially to multi-threading), you aren't most of the time. You have to learn by trial and error.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 01:39 PM
  2. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 05:57 AM
  3. Output to console window...
    By alvifarooq in forum C++ Programming
    Replies: 2
    Last Post: 10-26-2004, 08:56 PM
  4. Getting rid of the console window in a glut application.
    By ganonl in forum Game Programming
    Replies: 0
    Last Post: 08-02-2004, 10:48 AM
  5. win32 apps compiled with GCC start console window!
    By Citrus538 in forum Windows Programming
    Replies: 5
    Last Post: 02-18-2002, 09:35 PM

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