static text won't change
I have a dialogbox that pops up containing two static text controls and a text edit control. Now I want to change the content of the second static control.
Here's what I have tried:
In my resource .h
#define IDC_SCORE 103 // second static text control
#define IDC_TEXT1 104
my resource script
LTEXT "Your score:", IDC_TEXT1, 18, 3, 39, 10
LTEXT "0", IDC_SCORE, 58, 3, 29, 10 // second static text control
Now in my dialogProcedure while handling the WM_INITDIALOG message i call SetDlgItemInt(hwnd, IDC_SCORE,score, FALSE );
But it doesn't change from zero to the new value.
From reading a previous discussion on this topic I can't see anything wrong with my code. Maybe you can?
I'm also including an attachment with the code. It's mostly in the hiscore.c in the add_highscore().
SetDlgItemInt? You can only SetDialogItemText on a string, can't you?
Try an itoa() to turn an integer to a string.
Will I tried you suggestion and still didn't work.
Here's the code I wrote using your suggestion.
The only thing i can suggest to you:
before inserting the new value in it.its a very faint chance.
because no focus is needed for this kind of window.
but in your dlg why are you returning TRUE for default msgs?
are you processing all the msgs intended for
the dlg in your dlg proc. all of it?
i dont think so.change it to FALSE & see what happens.
Ok. I have solved my problem by creating a new static text control and removing the old one.
As for why I'm returning TRUE for default messages, I don't really know yet. I'm following theForger's tutorial.
Thank all for your help.