Make your dialog UNICODE , here is how :
#define UNICODE
#define _UNICODE
#include <windows.h>
#include <tchar.h>
#include "main.h"
static INT_PTR CALLBACK MainDlgProc(HWND, UINT, WPARAM, LPARAM);
static HANDLE ghInstance;
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
WNDCLASSEX wcx;
ghInstance = hInstance;
wcx.cbSize = sizeof(wcx);
if (!GetClassInfoEx(NULL, MAKEINTRESOURCE(32770), &wcx)) return 0;
wcx.hInstance = hInstance;
wcx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(8001));
wcx.lpszClassName =L"buttonClass";
if (!RegisterClassEx(&wcx)) return 0;
return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)MainDlgProc);
}
static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
HFONT hFont = CreateFont(0, 0, 0, 0, FW_MEDIUM, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("Arial"));
SendDlgItemMessage(hwndDlg,IDOK,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(1, 0));
wchar_t *c = L"\x263C";
SendDlgItemMessage(hwndDlg,IDOK,WM_SETTEXT,0,(LPARAM) c);
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
EndDialog(hwndDlg, TRUE);
return TRUE;
}
break;
case WM_CLOSE:
EndDialog(hwndDlg, 0);
return TRUE;
}
return FALSE;
}
Laur