#include <stdio.h> // sprintf
#include <windows.h>
+#include <tchar.h>
#include "stats.h"
#include "resource.h"
case WM_INITDIALOG:
hWndListBox = CreateWindow(
- "LISTBOX", // pointer to registered class name
- "Listbox", // pointer to window name
+ TEXT("LISTBOX"), // pointer to registered class name
+ TEXT("Listbox"), // pointer to window name
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LBS_NOINTEGRALHEIGHT, // window style
6, // horizontal position of window
6, // vertical position of window
case WM_PAINT:
{
- char s[CALC_BUF_SIZE];
+ TCHAR s[CALC_BUF_SIZE];
int lb_count;
HFONT hFont;
HFONT hFontOrg;
hFontOrg = SelectObject(hdc, hFont);
lb_count = SendMessage(hWndListBox, LB_GETCOUNT, 0, 0);
- sprintf(s, "n=%d", lb_count);
+ _stprintf(s, TEXT("n=%d"), lb_count);
SetBkMode(hdc, TRANSPARENT);
- TextOut(hdc, 98, 121, s, strlen(s));
+ TextOut(hdc, 98, 121, s, _tcslen(s));
SelectObject(hdc, hFontOrg);
EndPaint( hDlg, &ps );
}
case WM_CLOSE:
hWndDlgStats = 0; // invalidate stats dialog
- SendMessage(GetParent(hDlg), WM_CHAR, '\x13', 1); // disable stats related calculator buttons
+ SendMessage(GetParent(hDlg), WM_CHAR, TEXT('\x13'), 1); // disable stats related calculator buttons
DestroyWindow( hDlg );
return 0;