Thread: problem in c windowsprogramming

  1. #1
    Registered User shubham's Avatar
    Join Date
    May 2011
    Posts
    14

    problem in c windowsprogramming

    hello friends ....i am having a problem in windows c programming....
    look at my code for making a message box.....
    Code:
    #include<windows.h>
    int main()
    {
       MessageBox(0,"MESSAGE","TITLE",MB_OK);
    }
    THIS CODE WORKS....BUT WHEN I RUN THIS CODE THERE IS A CMD WINDOW ALSO OPENED WITH MESSAGE BOX ......WANT TO GET RID OF THIS WINDOW.....

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    There's no need to SHOUT at us!

    Here, something to read -> Tutorial: A Simple Window
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by shubham View Post
    hello friends ....i am having a problem in windows c programming....
    look at my code for making a message box.....
    Code:
    #include<windows.h>
    int main()
    {
       MessageBox(0,"MESSAGE","TITLE",MB_OK);
    }
    THIS CODE WORKS....BUT WHEN I RUN THIS CODE THERE IS A CMD WINDOW ALSO OPENED WITH MESSAGE BOX ......WANT TO GET RID OF THIS WINDOW.....
    That's because you are running in console mode... Creating a GUI program is a totally different programming experience... What you've discovered is that you can use large parts of the Windows API... message boxes, file pickers, folder pickers, progress bars and such from console programs.

    Head on over to the Forger's Win Api Tutorial ... go through it page by page, do the exercises as you go... at the end you shold be able to write simple Gui mode programs. If you need more help post in the Windows forum here and we'll see what we can do...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp problem, whats the problem, i cant figure it out!
    By AvaGodess in forum C Programming
    Replies: 14
    Last Post: 10-18-2008, 06:45 PM
  2. Replies: 4
    Last Post: 10-16-2008, 07:30 PM
  3. Visual Studio Linker problem or my problem?
    By OOPboredom in forum C Programming
    Replies: 2
    Last Post: 04-13-2004, 12:32 AM
  4. syntax linked list problem & struct problem
    By beely in forum C Programming
    Replies: 5
    Last Post: 11-11-2002, 09:14 AM
  5. Texture Problem(I got the NeHe tut working, but I have a problem)
    By SyntaxBubble in forum Game Programming
    Replies: 2
    Last Post: 12-02-2001, 10:40 PM