Custom Control_IDs?
Posted: Tue Apr 04, 2006 10:38 am
Hi there,
I was wondering whether I could assign Control_ID constants to the controls I dropped on a dialog.
E.g. I like to define a constant for a button IDC_BUTTON_OK.
In my code I Just include a definition header file which contains
#define IDC_BUTTON_OK 101
to use it in function calls as following:
GetDlgItem(hWndParent, IDC_BUTTON_OK)
or
switch (msg)
{
case WM_COMMAND:
if (id == IDC_BUTTON_OK)
// button clicked
}
However with resource builder I just managed to created .rc files with numbers as IDs. Maybe I am missing a point, but to scatter numbers through my code is a nightmare. This way Resource builder is no help to me. Otherwise I like the editor.
Semmel
I was wondering whether I could assign Control_ID constants to the controls I dropped on a dialog.
E.g. I like to define a constant for a button IDC_BUTTON_OK.
In my code I Just include a definition header file which contains
#define IDC_BUTTON_OK 101
to use it in function calls as following:
GetDlgItem(hWndParent, IDC_BUTTON_OK)
or
switch (msg)
{
case WM_COMMAND:
if (id == IDC_BUTTON_OK)
// button clicked
}
However with resource builder I just managed to created .rc files with numbers as IDs. Maybe I am missing a point, but to scatter numbers through my code is a nightmare. This way Resource builder is no help to me. Otherwise I like the editor.
Semmel