An 'copyable' messagebox

Sep 17, 2010 at 2:39am
Hello, again lol..

Well this time I want a way to display a messagebox, but allow the user to copy something from it. It doesn't have to be a messagebox, can be text on the screen or any form of display a message in the program that the user can copy.

Also if you help with the messagebox I have another question for messagebox's:

How do you use set fill in them, like if I was to display 08800000 it says 8800000 and I've used set fill in console applications to make it say 08800000 and not delete the first zero. If you can help with that too that would be great.

Thanks in advance to anyone who can help me with these things!
Sep 17, 2010 at 9:44am
Create a dialog box with a read-only Edit control to display your text and a Button for ok. The user can copy from the edit field.

I don't understand the second question.
Sep 17, 2010 at 10:38am
For the second question, use a stringstream. You can use fill on a stringstream, then get the string from the stringstream
Sep 17, 2010 at 6:21pm
Ok, thanks guys. Now I have another question: How would I display a hex value with a MessageBox, it always displays as a decimal when I need it to display as a hexadecimal value.
Sep 17, 2010 at 6:37pm
1
2
3
4
5
6
7
8
9
10
11
12
string num_as_hex(int number)
{
   stringstream ss;
   ss <<hex<< number; // notice hex manipulator
   return ss.str();
}

...

    string text=" blah blah balh "+num_as_hex(112)+" blah blah";
    MessageBox(0,text.c_str(),"",64);
Topic archived. No new replies allowed.