有一個(gè)未公開(kāi)的API來(lái)實(shí)現(xiàn)這個(gè)功能,,是在Shell32.dll中,但沒(méi)有名字,索引號(hào)為60,。
typedef int (CALLBACK *SHUTDOWNDLG) (int); void CDlgDlg::OnOK() { CString s; HINSTANCE hInst = LoadLibrary("shell32"); SHUTDOWNDLG SHShutDownDialog; if(hInst != 0) { SHShutDownDialog = (SHUTDOWNDLG)GetProcAddress(hInst, (LPSTR)60); (*SHShutDownDialog)(0); FreeLibrary(hInst); } } |
|