Ok, I defined IDC_STATIC in my resource.h file like this:
Code:
#define IDC_STATIC -1
Then I created a dialog box, and at runtime, I have created bunch of controls. Here's a sample code:
Code:
case WM_INITDIALOG:
.
.
.
CreateWindow("STATIC", "Sentence1", WS_CHILD | WS_VISIBLE, 10, 40, 50, 15, hwnd,
(HMENU)IDC_STATIC, NULL, NULL);
SendDlgItemMessage(hwnd, IDC_STATIC, WM_SETFONT, (WPARAM)textFont, 0);
CreateWindow("STATIC", "Sentence2", WS_CHILD | WS_VISIBLE, 10, 40, 50, 15, hwnd,
(HMENU)IDC_STATIC, NULL, NULL);
SendDlgItemMessage(hwnd, IDC_STATIC, WM_SETFONT, (WPARAM)textFont, 0);
break;
Now the problem is, the font of first STATIC control is sucessfully changed while the second control's remains the same. Is it because I used IDC_STATIC twice? What is the the right way of doing this? by defining another control?
Thanks!