I have a dialog and a picture control inside of it. During OnInitDialog I try to obtain the text part of the picture control like this
1 2 3 4
CWnd *dialogHandle; // Handle of the dialog
CWnd *itemHandle; // Handle of the picture control
BOOL error;
dialogHandle->GetDlgItemInt(itemHandle->GetDlgCtrlID(), &error, 0);
however GetDlgItemInt function set error to 0 which says there is an error
here is the resource line
CONTROL 65443, IDC_PICTURE, "Static", SS_BITMAP, 13, 13, 40, 40
That is the ID of the BITMAP resource that the picture control is showing.
In order to use the GetDlgItemInt funtion on a window control, the window or control has to carry some sort of textbox or caption - because
the GetDlgItemInt function is just a cover for a WM_GETTEXT message.
So GetDlgItemInt can be used on things like editboxes and buttons.
So you have a static control being used to display a bitmap. Are you wanting the ID of the static control or the ID of the bitmap resource? If the latter are you defining BITMAP resources in the same file something like this?