SetDlgItemText?

This is a discussion on SetDlgItemText? within the Windows Programming forums, part of the Platform Specific Boards category; Change your CreateWindowEx to : Code: html = CreateWindowEx( WS_EX_STATICEDGE | WS_EX_CLIENTEDGE , "edit", "", WS_CHILD|WS_VISIBLE|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL|ES_LEFT|ES_AUTOHSCROLL| ES_AUTOVSCROLL, 0, 0, 540, ...

  1. #16
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Change your CreateWindowEx to :

    Code:
    html = CreateWindowEx( WS_EX_STATICEDGE | WS_EX_CLIENTEDGE  ,
    			"edit", "", WS_CHILD|WS_VISIBLE|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL|ES_LEFT|ES_AUTOHSCROLL| ES_AUTOVSCROLL,
    			0, 0, 540, 330 , hWnd, (HMENU) 1, hInst, NULL );
    SetDlgItemText() wants a handle to the parent window and an ID of the child window. You can either use the handle to your edit window -

    Code:
    SetWindowText(html,"<a href=""> </a>");
    or use your parent handle -

    Code:
    SetDlgItemText(hWnd, 1,"<a href=""> </a>" );
    You've defined IDC_NSRT as 1001 but given your edit child window an ID of 1 in your CreateWindowEx() call, so if you want to use IDC_NSRT you'll have to change one of the values.
    zen

  2. #17
    BubbleMan
    Guest

    Angry Still

    That still doesn't work.

  3. #18
    BubbleMan
    Guest

    Post Nevermind..I got it!

    that last reply did it! Thank you for helping me!

  4. #19
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    I am assuming this is in a callback function. You may need to set the HWND to a static. Many messages pass thru the callback and it will have lost the value before the next msg is processed.

    Try GetActiveWindow() as this will return the HWND of the dlg with the focus.

    Test that the Edit has been created ie html!=NULL or can see it on screen. Use GetLastError() if not.

    Ensure you are setting the ID (IDC_NSRT) as the HMENU param in the CreateWindowEx, ie

    (HMENU)IDC_NSRT

    Read the help for this.

  5. #20
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    Next time look at the second page!!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SetDlgItemText not working
    By viaxd in forum Windows Programming
    Replies: 4
    Last Post: 01-14-2006, 01:55 AM
  2. Dialog doesn't respond to tab key
    By dhaupt in forum Windows Programming
    Replies: 8
    Last Post: 08-11-2004, 12:41 PM
  3. Using the SetDlgItemText function
    By nima_ranjbar in forum Windows Programming
    Replies: 4
    Last Post: 04-25-2002, 02:44 PM
  4. Problem with SetDlgItemText
    By face_master in forum Windows Programming
    Replies: 7
    Last Post: 01-28-2002, 09:24 PM
  5. SetDlgItemText()
    By C_Coder in forum Windows Programming
    Replies: 3
    Last Post: 12-05-2001, 10:02 PM

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