Thread: Odd results for such a simple procedure.

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    132

    Odd results for such a simple procedure.

    Can someone tell me why the following code is creating a new window just for my editbox?

    expHwnds.hEdit = CreateWindow("EDIT", "MM/DD/YYYY", WS_BORDER | WS_VISIBLE | ES_MULTILINE | ES_WANTRETURN, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, hwnd, NULL, g_hInst, NULL);

    I have never seen this happen before. The new "window" thats being created also has it's own title bar (with "MM/DD/YYYY" as the actual text on the title bar). I created a ListView in much the same manner and it didn't create it's own window. Anyone know why?

    Thanks
    Scott

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Create the window as a child window by passing WS_CHILD as a window style.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    132
    Wow, can't believe I overlooked that! Thanks for showing me my idiocy, definitely isn't the first time this has happened! haha.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Getting bizarre results from simple math
    By mmyers1 in forum C++ Programming
    Replies: 3
    Last Post: 04-20-2004, 06:39 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. C Subroutine produces odd results
    By IGAU in forum C Programming
    Replies: 8
    Last Post: 11-24-2003, 09:47 AM
  5. Same seed for srand yields different results
    By codegirl in forum C++ Programming
    Replies: 3
    Last Post: 06-23-2003, 02:39 PM