Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can referesh a List Ctrl? Pin
ThatsAlok24-Sep-08 19:55
ThatsAlok24-Sep-08 19:55 
GeneralRe: How can referesh a List Ctrl? Pin
Le@rner24-Sep-08 20:21
Le@rner24-Sep-08 20:21 
GeneralRe: How can referesh a List Ctrl? Pin
ThatsAlok24-Sep-08 20:51
ThatsAlok24-Sep-08 20:51 
GeneralRe: How can referesh a List Ctrl? Pin
Le@rner24-Sep-08 21:25
Le@rner24-Sep-08 21:25 
GeneralRe: How can referesh a List Ctrl? Pin
Roger Allen25-Sep-08 0:26
Roger Allen25-Sep-08 0:26 
GeneralRe: How can referesh a List Ctrl? Pin
Le@rner25-Sep-08 0:33
Le@rner25-Sep-08 0:33 
GeneralRe: How can referesh a List Ctrl? Pin
Roger Allen25-Sep-08 0:51
Roger Allen25-Sep-08 0:51 
Questionrestart system by code Pin
Madan Chauhan24-Sep-08 19:35
Madan Chauhan24-Sep-08 19:35 
Hi all,
At one point of my application(using vc++) I need to restart the system. That I am doing like-

BOOL CtestShutDlg::RestartSystem()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;

// Get a token for this process.

if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return( FALSE );

// Get the LUID for the shutdown privilege.

LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid);


tkp.PrivilegeCount = 1; // one privilege to set
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

// Get the shutdown privilege for this process.

AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);


if (GetLastError() != ERROR_SUCCESS)
return FALSE;

// Shut down the system and force all applications to close.

if (!ExitWindowsEx(EWX_REBOOT,
SHTDN_REASON_MAJOR_OPERATINGSYSTEM |
SHTDN_REASON_MINOR_UPGRADE |
SHTDN_REASON_FLAG_PLANNED))
return FALSE;

return TRUE;

}


It restart the system immediately when this function called up. I want that there should be some kind of warning or any type of message to user "your system need to be reboot now" like that before rebooting.

Please suggest me some way how can I do this.


Thanks
AnswerRe: restart system by code Pin
ThatsAlok24-Sep-08 19:51
ThatsAlok24-Sep-08 19:51 
GeneralRe: restart system by code Pin
Madan Chauhan24-Sep-08 20:02
Madan Chauhan24-Sep-08 20:02 
GeneralRe: restart system by code Pin
ThatsAlok24-Sep-08 20:07
ThatsAlok24-Sep-08 20:07 
Questiongetting hard disk name Pin
VCProgrammer24-Sep-08 19:34
VCProgrammer24-Sep-08 19:34 
AnswerRe: getting hard disk name Pin
SandipG 24-Sep-08 20:21
SandipG 24-Sep-08 20:21 
AnswerRe: getting hard disk name Pin
Le@rner24-Sep-08 20:25
Le@rner24-Sep-08 20:25 
AnswerRe: getting hard disk name Pin
Madan Chauhan24-Sep-08 21:09
Madan Chauhan24-Sep-08 21:09 
QuestionChange Background colour of Group boxes Pin
Dhiraj kumar Saini24-Sep-08 18:54
Dhiraj kumar Saini24-Sep-08 18:54 
AnswerRe: Change Background colour of Group boxes Pin
Hamid_RT24-Sep-08 19:22
Hamid_RT24-Sep-08 19:22 
GeneralRe: Change Background colour of Group boxes Pin
_AnsHUMAN_ 24-Sep-08 20:57
_AnsHUMAN_ 24-Sep-08 20:57 
GeneralRe: Change Background colour of Group boxes Pin
Dhiraj kumar Saini24-Sep-08 21:03
Dhiraj kumar Saini24-Sep-08 21:03 
GeneralRe: Change Background colour of Group boxes Pin
_AnsHUMAN_ 24-Sep-08 21:38
_AnsHUMAN_ 24-Sep-08 21:38 
GeneralRe: Change Background colour of Group boxes Pin
Dhiraj kumar Saini24-Sep-08 23:25
Dhiraj kumar Saini24-Sep-08 23:25 
GeneralRe: Change Background colour of Group boxes Pin
_AnsHUMAN_ 24-Sep-08 23:40
_AnsHUMAN_ 24-Sep-08 23:40 
GeneralRe: Change Background colour of Group boxes Pin
Dhiraj kumar Saini24-Sep-08 23:57
Dhiraj kumar Saini24-Sep-08 23:57 
QuestionHow can find weekday name? Pin
Le@rner24-Sep-08 18:27
Le@rner24-Sep-08 18:27 
AnswerRe: How can find weekday name? Pin
Steve Echols24-Sep-08 18:44
Steve Echols24-Sep-08 18:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.