Thread: "Edit Box" Maximized

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    8

    "Edit Box" Maximized

    Hi (first post WooT)!

    Anyway...I am using this good tutorial for windows stuff and I came accross something for an "Edit Box". It works great, except I need it to be made maximized instead of a number of pixels x a number of pixels.

    Link:
    http://winprog.org/tutorial/app_one.html

    Anybody know how?

    ---------------------------------
    And another question:

    How do I make it so it is impossible to go far enough so it requires horizontal scrolling? Or, how can I give the option of having a horizontal scroller or not through menus?

    Thanks in advance.

  2. #2
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Whatever sizing you want the Edit Box to be, you'll have to resize it yourself using functions like SetWindowPos or MoveWindow.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    57
    If you want to start with a maximized window,
    for the main window CreateWindowEx function,
    change "WS_OVERLAPPEDWINDOW" to "WS_OVERLAPPEDWINDOW | WS_MAXIMIZE"

    Try it.

    (the edit box is automatically resized to the main window size by the WM_SIZE message, as you can see in the code)

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    8
    Can you pretend for a moment that I have very limited C++ skills (well, you don't have to pretend) and need some help?

    I am also having some problems with the "Edit Box". Whenever you load it with a menu button, then you can type and all, but then when you select another menu button that goes over the textbox with text using the TextOut thingy, then you can still type in the box, and when you put your mouse over the spot where the vertical scroller should be, then it appears, and if you highlight the area behind, the textbox appears....How can I fix that? (I hope I explained it well enough)

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    57
    Quote Originally Posted by AoA
    Hi (first post WooT)!

    How do I make it so it is impossible to go far enough so it requires horizontal scrolling?
    Thanks in advance.
    You will need to keep track of the number of chars entered, and when the maximum line size is reached, don't allow any more chars on that line.
    (see the "winprog" tutorial section on keyboard input)

  6. #6
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    How do I make it so it is impossible to go far enough so it requires horizontal scrolling? Or, how can I give the option of having a horizontal scroller or not through menus?
    If you're trying to implement the "Word Wrap" feature in Notepad, it does it by destroying the edit control, and re-creating it with a new style.

  7. #7
    Registered User
    Join Date
    Sep 2004
    Posts
    57
    Quote Originally Posted by AoA
    I am also having some problems with the "Edit Box". Whenever you load it with a menu button, then you can type and all, but then when you select another menu button that goes over the textbox with text using the TextOut thingy, then you can still type in the box, and when you put your mouse over the spot where the vertical scroller should be, then it appears, and if you highlight the area behind, the textbox appears....How can I fix that? (I hope I explained it well enough)
    I don't understand. I assume you are using a "winprog" example, and that you are trying to build on that. Which example are you using?
    I'm guessing app_four.

    (btw, I downloaded the zip file, which has all source code and a working executable for each app)

  8. #8
    Registered User
    Join Date
    Oct 2005
    Posts
    8
    Well...I solved the problem of the vertical scrolling.

    I just needed to remove "ES_AUTOHSCROLL" from the code...

    So, now the other problem. My program has a menu with multiple menuitems. When you select (for example) "write -> new" then it opens the Edit Box just fine. But then, if you select "help -> about" (the about page displays text with the TextOut code) it just seems to cover up the Edit Box, not replace it. You can still type and if you highlight it, then you can see what you wrote and not the text on the page. What do you people suggest I do?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MDI children always maximized?
    By Devils Child in forum Windows Programming
    Replies: 4
    Last Post: 02-25-2009, 07:43 AM
  2. show window minimized maximized without focus taken
    By eXistenZ in forum Windows Programming
    Replies: 16
    Last Post: 12-15-2008, 12:38 PM
  3. starting with a maximized window
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 05-27-2002, 08:08 PM
  4. How to open window maximized
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 02-04-2002, 04:29 PM
  5. How To Execute In Full-Screen, Maximized, etc?
    By Sebastiani in forum C Programming
    Replies: 2
    Last Post: 10-06-2001, 03:28 PM