Code
- include <windows.h>
- include <windowsx.h>
- include <stdio.h>
//####################################################################################
// Set the text of a control in a dialog box to the string representation of the
// specified float value
//####################################################################################
BOOL SetDlgItemFloat(HWND hwnd, int nIDDlgItem, float value, char* format)
{
char work[100];
BOOL result;
sprintf(work, format, value);
dbgprintf("setting %d to %s\n", nIDDlgItem, work);
result = SetDlgItemText(hwnd, nIDDlgItem, work);
return result;
}