Entering normal text into window box!

This is a discussion on Entering normal text into window box! within the Windows Programming forums, part of the Platform Specific Boards category; I know this sounds dumb...but i am a newbie at windows programming... I have looked into many tutorials...but still do ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    14

    Entering normal text into window box!

    I know this sounds dumb...but i am a newbie at windows programming...
    I have looked into many tutorials...but still do not understand it...
    How can you put text into the actual box...not the title?
    Is it possible to put in any other C++ coding so you can put in a small "guess-the-number-game" that i created? If yes...how?
    I appreciate any help...i want to become good at windows programming...
    If anyone knows how to put text in a box...can u then give a sample code please?
    Thanks in advance...

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    How can you put text into the actual box...not the title?
    Use TextOut() or DrawText().

    In your WM_PAINT handler:
    Code:
    PAINTSTRUCT ps;
    HDC hdc;
    hdc = BeginPaint(hwnd,&ps);
    TextOut(hdc,0,0,"hi there",8);
    EndPaint(hwnd,&ps);

  3. #3
    Registered User
    Join Date
    Mar 2005
    Posts
    135
    Quote Originally Posted by Shiv4life
    I know this sounds dumb...but i am a newbie at windows programming...
    I have looked into many tutorials...but still do not understand it...
    How can you put text into the actual box...not the title?
    Is it possible to put in any other C++ coding so you can put in a small "guess-the-number-game" that i created? If yes...how?
    I appreciate any help...i want to become good at windows programming...
    If anyone knows how to put text in a box...can u then give a sample code please?
    Thanks in advance...

    The "box" is called the "client" area. And as stated above, you would most likely do it in WM_PAINT.


    xeddiex.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 04:07 PM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Making dialog box the only window
    By PJYelton in forum Windows Programming
    Replies: 2
    Last Post: 09-06-2005, 01:02 PM
  4. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 06:48 PM
  5. dont want to use all params
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 02-18-2003, 08:10 AM

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