如何调用关机对话框

调用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);
     }
 

posted on 2006-10-31 11:07  路吾  阅读(618)  评论(1编辑  收藏  举报

导航