Win32 API programming-call to close the computer dialog box

Source: Internet
Author: User

This function is called through an API function with an index of 60 in shell32.dll, and is implemented in the "close windows" dialog window. The specific method is to add the bn_clicked message processing function through the idc_shutdowncomputer button:
Void ccontroldlg: onshutdowncomputer ()
{
Hinstance hinst = loadlibrary ("shell32.dll"); // load shell32.dll
Shutdowndlg shutdowndialog; // pointer to the function in the shutdown dialog box displayed in the shell32 Database
If (hinst! = NULL)
{
// Obtain and call the function address
Shutdowndialog = (shutdowndlg) getprocaddress (hinst, (lpstr) 60 );//
(* Shutdowndialog) (0 );
}
}
The shutdowndlg in the function is defined as follows:
Typedef int (callback * shutdowndlg) (INT); // display the pointer of the function in the shutdown dialog box.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.