///////////////////////////////////////////////////////////////////////////////
// 函数:void ShutDown()
//
// 功能:WINDOWS关机界面调用
//
// 参数:无
///////////////////////////////////////////////////////////////////////////////
void ShutDown()
{
//以下是关机界面代码
typedef int (CALLBACK *SHUTDOWNDLG)(int); //显示关机对话框函数的指针
HINSTANCE hInst = LoadLibrary("shell32.dll"); //装入shell32.dll
SHUTDOWNDLG ShutDownDialog; //指向shell32.dll库中显示关机对话框函数的指针
if(hInst != NULL)
{
//获得函数的地址并调用之
ShutDownDialog = (SHUTDOWNDLG)GetProcAddress(hInst,(LPSTR)60);
(*ShutDownDialog)(0);
}
}
本函数实例文章推荐vc小应用.rar