SetDlgItemInt()

This is a discussion on SetDlgItemInt() within the Windows Programming forums, part of the Platform Specific Boards category; This code works but i want to use SetDlgItemInt().Im trying to use it as shown below but it just won't ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    15

    SetDlgItemInt()

    This code works but i want to use SetDlgItemInt().Im trying to use it as shown below
    but it just won't work. hwndEdit is the handle to the edit window and 8 is the ID of the button.All help appreciated im very desperate.Thanks

    Code:
    if(LOWORD(wParam) == 8)
    		{
                if(HIWORD(wParam) == BN_CLICKED)
    			{
                    SetWindowText(hwndEdit,TEXT("8"));
    			}
    		}
    Code:
    if(LOWORD(wParam) == 8)
    		{
                if(HIWORD(wParam) == BN_CLICKED)
    			{
                    SetDlgItemInt(hwndEdit,8,8,FALSE);
    			}
    		}

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Try using GetDlgCtrlID with your handle to the control as the second parameter to SetDlgItemInt. The first parameter should be the handle to the dialog box also. If this fails to work, then use GetLastError to receive additional information about the problem.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GitDlgItemInt & SetDlgItemInt
    By ColdFire in forum Windows Programming
    Replies: 1
    Last Post: 05-29-2002, 10:58 PM

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