Implement screen dark operation with VB
http://www.tongyi.net Author: Yan Yihuai Source: China Computer Education Views: 1452
Users who have used Windows 9x should know that when shutting down the Windows system, the entire screen will be dark, then how do you achieve this in your application? We can implement it by calling a set of API functions. If you are interested, come with me! This set of functions is: getDC: Used to get the screen number; releasedc: release the specified device; createPatternbrush: Create a graphic brush; Patblt: Plug the specified device using the created graphics; deleteObject: Create the created object (create with CreatePatternbrush Brush object echo); createBitmap: Create a BMP object; selectObject: Select the current operation object; InvalIdateERECT: The operation is invalid, that is, the state of restoring the dimples. Basic ideas first create a bitmap object, then use this bitmap object to create a pattern brush, select the specified device to fill the current device, remove the current device, delete the created brush object, make the current device . Call the InvaliDateRect function to restore the specified device to a state before darkening. Step 1. Create a FORM1 form, set 2 Command buttons, set the CAPTION attribute of Command1 and Command2 to: "Darken" and Recovery.