// Get the handle of the container when the control Mfc // write activex control interface pointer if the container is taken LPOLECONTAINER lpContainer; HRESULT hr = m_pClientSite-> GetContainer (& lpContainer); // if taken window handle HWND m_hWndParent; IOleInPlaceSite * pOleInPlaceSite = NULL; if (NOERROR == m_pClientSite-> QueryInterface (IID_IOleInPlaceSite, (LPVOID *) & pOleInPlaceSite)) {pOleInPlaceSite-> GetWindow ((HWND *) & m_hWndParent); pOleInPlaceSite-> release ();} off the computer OSVERSIONINFO OsVersionInfo; // contains the operating system version data structure information OsVersionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); GetVersionEx (& OsVersionInfo); // Get OS version information if (OsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {// Windows98, call the ExitWindowsEx () function to restart the computer DWORD dwReserved; EXITWINDOWSEX (EWX_REBOOT, DWRESERVED); / / You can change the first parameter, implement some of the processing prior to logout user, //, turn off the power, etc. Operation // Restart the computer TypedEf Int (Callback * shutdowndlg) (int); / / Display the pointer of the shutdown dialog function Hinstance hinst = loadLibrary ("shell32.dll"); // Load Shell32.dllShutdowndlG shutdowndialog; point to the pointer IF that displays the shutdown dialog function in the shell32.dll library (hinst! = NULL) {// Get the address of the function and calls shutdowndialog = (shutdowndlg) getProcAddress (Hi NST, (LPSTR) 60); (* shutdowndialog) (0);