I'm making a Win32 GUI application and I want to display the ↺ character on a button.
Normally, I think one would insert a unicode character like this:
HWND button = CreateWindow("BUTTON", "\u27F3",
WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, size - 105,
size - 29, 100, 24, hwnd, (HMENU)IDI_BUTTON,
GetModuleHandle(NULL), NULL);
where "\u27F3" is the unicode character described here under "C/C++/Java" http://www.fileformat.info/info/unicode/char/27f3/index.htm
However, when I do this I don't get the arrow character but a different one? What's going wrong?
Thanks!
I'm going to shamelessly steal from Raymond Chen's comment and show the corrected code:
HWND button = CreateWindowW(L"BUTTON", L"\u27F3",
WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, size - 105,
size - 29, 100, 24, hwnd, (HMENU)IDI_BUTTON,
GetModuleHandle(NULL), NULL);
Naturally the font you have selected into the window will need to support the character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With