programming.nbk: Home | Index | Next Page: Code: spin | Previous Page: Code: readline


 Code: SetDlgItemFloat

#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;
}

programming.nbk: Home | Index | Next Page: Code: spin | Previous Page: Code: readline


Notebook exported on Monday, 7 July 2008, 18:56:06 PM Eastern Daylight Time