G_uQuer圜ancelAutoPlay = RegisterWindowMessage(TEXT("Quer圜ancelAutoPlay")) LRESULT WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) The following code fragment illustrates how to use this message to disable AutoRun. The message handler should return TRUE to cancel AutoRun and FALSE to enable it. Your application's window must be in the foreground to receive this message. First, register "Quer圜ancelAutoPlay" as a Windows message: uMessage = RegisterWindowMessage(TEXT("Quer圜ancelAutoPlay")) Your application must be running in the foreground window. The following code fragments illustrate how to set up and handle this message. This approach is used by system utilities such as the Open common dialog box to disable AutoRun. Your application can respond to this message to suppress AutoRun. With systems that have Shell version 4.70 and later, Windows sends a "Quer圜ancelAutoPlay" message to the foreground window. However, it is usually preferable to handle this operation programmatically rather than depending on the user. Users can manually suppress AutoRun by holding down the SHIFT key when they insert the CD-ROM. In either case, you will normally not want to launch another application while the original is in progress. During the operation of your application, the user may need to insert another disc that may contain an Autorun.inf file.Your application has a setup program that requires the user to insert another disc that may contain an Autorun.inf file. There are a variety of situations where AutoRun may need to be suppressed programmatically. AutoRun for Other Types of Storage Media.The system provides several ways to disable AutoRun. For example, AutoRun might interfere with the operation of a running application and need to be disabled for the duration. There are many situations where AutoRun may need to be temporarily or persistently disabled.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |