change mesage box text
-
hey every one! i was wondering is there any way that i can be able to change the text on a message box? what i mean is, in the funtion MessageBox(NULL,"text1","text2",MB_OK); is there any way that i can change the "text1" depending on what happends in the code? thanx, jt
-
hey every one! i was wondering is there any way that i can be able to change the text on a message box? what i mean is, in the funtion MessageBox(NULL,"text1","text2",MB_OK); is there any way that i can change the "text1" depending on what happends in the code? thanx, jt
just pass a pointer to text instead.
char *foo = "Hello"; char *bar = "World"; char *txt = foo; MessageBox(NULL,txt,bar,MB_OK); txt = bar; MessageBox(NULL,txt,bar,MB_OK);
You can then send in any string you like just by setting up a pointer. -
just pass a pointer to text instead.
char *foo = "Hello"; char *bar = "World"; char *txt = foo; MessageBox(NULL,txt,bar,MB_OK); txt = bar; MessageBox(NULL,txt,bar,MB_OK);
You can then send in any string you like just by setting up a pointer.hhhmm.. ya i tryed that it works great! thanx alot now i ave a good basis i can go on. ok quick question what about this piece of code
#include #include char *foo; char *fo="yo"; char *txt=foo; int main(){ char input; gets(input); input=foo; MessageBox(NULL,foo,fo,MB_OK); }
this dosnt seem to work for me can u shed some light? thanx, jt -
hey every one! i was wondering is there any way that i can be able to change the text on a message box? what i mean is, in the funtion MessageBox(NULL,"text1","text2",MB_OK); is there any way that i can change the "text1" depending on what happends in the code? thanx, jt
Can you more explain change text on a MessageBox do you need to change text on parameters?
WhiteSky
-
Can you more explain change text on a MessageBox do you need to change text on parameters?
WhiteSky
-
yea kinda like that. but i wanna be able to change parameter 2 in the message box. depending on if a certin thing happends or not. ya see?
Why waldermort answer doesnt work for you
WhiteSky
-
hhhmm.. ya i tryed that it works great! thanx alot now i ave a good basis i can go on. ok quick question what about this piece of code
#include #include char *foo; char *fo="yo"; char *txt=foo; int main(){ char input; gets(input); input=foo; MessageBox(NULL,foo,fo,MB_OK); }
this dosnt seem to work for me can u shed some light? thanx, jtthe line "input=foo" overwrites the text you input with an undefined string. I think what you meant was "foo=input"
-- Help me! I'm turning into a grapefruit! Buzzwords!
-
the line "input=foo" overwrites the text you input with an undefined string. I think what you meant was "foo=input"
-- Help me! I'm turning into a grapefruit! Buzzwords!
benjymous wrote:
I think what you meant was "foo=input"
foo = &input
perhaps.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
hey every one! i was wondering is there any way that i can be able to change the text on a message box? what i mean is, in the funtion MessageBox(NULL,"text1","text2",MB_OK); is there any way that i can change the "text1" depending on what happends in the code? thanx, jt
jqt wrote:
is there any way that i can change the "text1" depending on what happends in the code?
Yes, just use a variable instead of a string literal.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
jqt wrote:
is there any way that i can change the "text1" depending on what happends in the code?
Yes, just use a variable instead of a string literal.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb