调用Windows的关机对话框可用shell32.dll中一个索引号为60的API函数调用可实现。
具体代码如下:
 typedef int (CALLBACK *SHUTDOWNDLG) (int);  
     CString s;
    
     HINSTANCE hInst = LoadLibrary("shell32");
     SHUTDOWNDLG SHShutDownDialog;
    
     if(hInst != 0)
     {
     SHShutDownDialog = (SHUTDOWNDLG)GetProcAddress(hInst, (LPSTR)60);
     (*SHShutDownDialog)(0);
     FreeLibrary(hInst);
     }
 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-07-07
  • 2021-05-20
  • 2022-12-23
  • 2021-06-15
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2021-12-26
  • 2021-09-23
  • 2021-08-09
  • 2021-11-30
  • 2022-03-06
相关资源
相似解决方案