Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How I can set time on windows 7 in c++ bulider ?? 1

Status
Not open for further replies.

macgyver2222

Programmer
Nov 14, 2010
2
PL
SetSystemTime don't work.
 
Did you do something like this:
Code:
BOOL SetNewTime(WORD hour, WORD minutes)
{
    SYSTEMTIME st;

    GetSystemTime(&st);       // gets current time
    st.wHour = hour;          // adjusts hours 
    st.wMinute = minutes;     // and minutes
    if (!SetSystemTime(&st))  // sets system time
        return FALSE;
    return TRUE;
}
Maybe related to privileges?

James P. Cottingham
I'm number 1,229!
I'm number 1,229!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top