how to change system time at right hand side corner
i change system time, right hand corner 's clock not change
just doing testing instead of manually change clock
private void testing(object o) { int count = 0; while (!stopallthread) { if (count == 0) { systemtime st = new systemtime(); st.wyear = 2013; // must short st.wmonth = 6; st.wday = 25; st.whour = 5; st.wminute = 59; st.wsecond = 57; setsystemtime(ref st); thread.sleep(1000 * 20); } else if (count == 1) { systemtime st = new systemtime(); st.wyear = 2013; // must short st.wmonth = 6; st.wday = 25; st.whour = 8; st.wminute = 59; st.wsecond = 57; setsystemtime(ref st); thread.sleep(1000 * 20); } else if (count == 2) { systemtime st = new systemtime(); st.wyear = 2013; // must short st.wmonth = 6; st.wday = 25; st.whour = 16; st.wminute = 01; st.wsecond = 57; setsystemtime(ref st); thread.sleep(1000 * 10); } else if (count == 3) { systemtime st = new systemtime(); st.wyear = 2013; // must short st.wmonth = 6; st.wday = 25; st.whour = 19; st.wminute = 0; st.wsecond = 57; setsystemtime(ref st); thread.sleep(1000 * 30); } count = count + 1; if (count == 4) { count = 0; } } }
designer
if call function not work expected idea examine error returned function.
return value
if function succeeds, return value nonzero.
if function fails, return value zero. extended error information, call getlasterror.
remarks
the calling process must have se_systemtime_name privilege. privilege disabled default. setsystemtime function enables se_systemtime_name privilege before changing system time , disables privilege before returning. more information, see running special privileges.
ps - c# code? suspect c++, in case asking in c++ forum ikely better responses.
paul linton
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment