how to make GUIs in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • compman9902
    New Member
    • Mar 2007
    • 105

    how to make GUIs in C++

    Thank you for looking at my post.
    Okay, first of all I would like to point out that I have been all over the internet and the library and I cannot seem to get it through my head on how to make GUIs in C++.
    Here is what I need help with. All I need is a simple GUI window about 100 x 200 pixles. In it, I need to show a constantly changing intiger. What would be the best is if this window would open up when a function was called and the intiger being passed to the function through the function header.
    Please post code when you reply.
    Thanks.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by compman9902
    Thank you for looking at my post.
    Okay, first of all I would like to point out that I have been all over the internet and the library and I cannot seem to get it through my head on how to make GUIs in C++.
    Here is what I need help with. All I need is a simple GUI window about 100 x 200 pixles. In it, I need to show a constantly changing intiger. What would be the best is if this window would open up when a function was called and the intiger being passed to the function through the function header.
    Please post code when you reply.
    Thanks.
    You don't mention your OS. Look into the win32 api, and please look at the Posting Guidelines of the site, they clearly state that we will not give code - your responses will be proportionate to the effort you put into them. Asking for code gets a general wave of the hand towards a certain direction or reference. Posting what you have tried will get you specific references, and posting the code you have played around with will get that refined.

    Comment

    • compman9902
      New Member
      • Mar 2007
      • 105

      #3
      Originally posted by sicarie
      You don't mention your OS. Look into the win32 api, and please look at the Posting Guidelines of the site, they clearly state that we will not give code - your responses will be proportionate to the effort you put into them. Asking for code gets a general wave of the hand towards a certain direction or reference. Posting what you have tried will get you specific references, and posting the code you have played around with will get that refined.
      Hmm.. Okay
      Well, I run Windows XP and use Dev C++.

      Comment

      • arunmib
        New Member
        • May 2007
        • 104

        #4
        The standard template for "Windows Application" project in DevC++ will create a simple window by default.

        Then in that you need "draw" the integer you want to show as countdown. For more information about programming for Windows GUI refer



        in general to display text (for eg) you need to take care of "WM_PAINT" message and it's realted APIs....

        Hope this serves as an introduction and of some help....
        Last edited by arunmib; Aug 1 '07, 07:44 AM. Reason: comments

        Comment

        • compman9902
          New Member
          • Mar 2007
          • 105

          #5
          Originally posted by arunmib
          The standard template for "Windows Application" project in DevC++ will create a simple window by default.

          Then in that you need "draw" the integer you want to show as countdown. For more information about programming for Windows GUI refer

          http://msdn2.microsoft .com/en-us/library/ms632587.aspx

          Hope this serves as an introduction and of some help....
          That actually dosn't help me very much.
          I learn more by example then by anything else.
          Thanks for the effort, though.

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            Originally posted by compman9902
            That actually dosn't help me very much.
            I learn more by example then by anything else.
            Thanks for the effort, though.
            Start reading books. Start with Programming Windows by Charles Petzold.

            Your initial question is answered in about the first example.

            Comment

            • sicarie
              Recognized Expert Specialist
              • Nov 2006
              • 4677

              #7
              Originally posted by compman9902
              That actually dosn't help me very much.
              I learn more by example then by anything else.
              Thanks for the effort, though.
              I guess I'm missing why you can't come up with the example, either by searching those things, or by writing it yourself (an even better way to learn!)...

              As I said, come with a specific question, get a specific resource answer. We're not going to put in all the effort, you are doing this project, you need to do most of the work.

              Comment

              • arunmib
                New Member
                • May 2007
                • 104

                #8
                Originally posted by compman9902
                That actually dosn't help me very much.
                I learn more by example then by anything else.
                Thanks for the effort, though.
                Ok, to put things as an example "open the windows application in DevC++". Then do the painting part. For this handle the "WM_PAINT" message.
                You can also take a look at "BeginPaint ", "EndPaint" and it's related APIs to display text in the window.

                So from this on, think how you can construct a simple application. Trust me, the method of intuitive construction of a program will be fun.

                I hope, I haven't violated any rules and hope this is of some help to you.....If you still find it difficult, just buy some book on Windows Programming.

                Comment

                • compman9902
                  New Member
                  • Mar 2007
                  • 105

                  #9
                  Originally posted by weaknessforcats
                  Start reading books. Start with Programming Windows by Charles Petzold.

                  Your initial question is answered in about the first example.
                  Okay, I got the book...
                  What example??

                  Comment

                  • weaknessforcats
                    Recognized Expert Expert
                    • Mar 2007
                    • 9214

                    #10
                    There should be one like this.

                    Comment

                    • weaknessforcats
                      Recognized Expert Expert
                      • Mar 2007
                      • 9214

                      #11
                      Originally posted by compman9902
                      Okay, I got the book...
                      What example??
                      You got Programming Windows 5th Edition by Charles Petzold 1999
                      ISBN 1-57231-995-X ??

                      Comment

                      • compman9902
                        New Member
                        • Mar 2007
                        • 105

                        #12
                        Originally posted by weaknessforcats
                        You got Programming Windows 5th Edition by Charles Petzold 1999
                        ISBN 1-57231-995-X ??
                        Yes, sir-ee.
                        That very one.

                        Comment

                        • weaknessforcats
                          Recognized Expert Expert
                          • Mar 2007
                          • 9214

                          #13
                          Did you read to page 44 and get the example working?

                          That book as the Win32 API described and how to use it. A lot of Microsoft code is just wrappers for Win32. If you uinderstand how a Window is out together then these various wrappers like MFC and thew .NET Framework begin to make sense.

                          Unfortunately with Windows, some study is required. Several months most likely.

                          I realloy recommend starting at the beginning of that book and reading it and trying every example on your computer. It's only by doing that you learn Windows. No amount of explanation will help.

                          Comment

                          Working...