How does a shield system function keys? Sometimes we don't want Program What should I do if the user is interrupted by system function keys such as ALT + TAB, CTRL + ALT + DEL, CTRL + ESC (for example, automatic demo program? It prompts you that these function keys do not work when you are running the Screen Saver-that is, as long as you "cheat" windows during your program running, make it think it is in the screen protection status! Please refer to the following section Code : VaR Temp: integer; Begin Systemparametersinfo (spi_screensaverrunning, 1, @ temp, 0 ); End; Of course, do not forget to reset the settings at the end of the program to "wake up" windows ". The Code is as follows: VaR Temp: integer; Begin Systemparametersinfo (spi_screensaverrunning, 0, @ temp, 0 ); End; How to Branch B prompt Most of the controls in Delphi have a practical hint attribute, that is, floating bar prompts. But sometimes the prompt is long. Can I display the floating prompt branch? In fact, hint is a string. Therefore, when Delphi displays the string, it automatically interprets the carriage return control character. Therefore, you only need to add the carriage return control character. Based on this principle, we can also make a unique vertical tip. First, deploy a label in form1, and then look at the sample code: Procedure tform1.formcreate (Sender: tobject ); Begin label1.hint: = 'vertical '+ #13 +' straight '+ #13 +' '+ #13 +' ′; End; C. How to display images in the menu Have you used office97? Do you think the icons displayed in the menu are fresh? If you want your program to be so icing on the cake, please prepare BMP! Assume that you want to add a printer icon (File Name: C:/inter.bmp) for "print" under "file" (Name: N1 ), write the following code in the form oncreate event: VaR BMP: tpicture; Begin BMP: = tpicture. Create; BMP. loadfromfile ('C:/printer.bmp ′); Setmenuitembitmaps (n1.handle, 8, mf_byposition, BMP. bitmap. Handle, BMP. bitmap. Handle ); End; Here, the first bitmap. Handle is used for unchecked menu items, and the second specifies the bitmap displayed when the selected (checked) items are the same. In addition, because the menu item height is limited, if the bitmap is too large, only the upper left corner is displayed. |