Delphi skills ABC

zhaozj2021-02-11  203

A How to Shield System Function Key Sometimes we don't want the program to be interrupted by the user with ALT TAB, CTRL ALT DEL, CTRL ESC and other system function keys (such as automatic demos), then what to do? Prompt you, when running the screen saver, these function keys don't work - that is, as long as you run in your program, "deceive" Windows, make it self-righteous in the screen The protection status will become! Please see the following code: Var Temp: integer; begin systemparametersinfo (spi_screensaverrunning, 1, @temp, 0); end; of course, don't forget to restore settings at the end of the program, and wake up Windows "Wake". The code is as follows: Var Temp: Integer; Begin SystemParametersInfo (spi_screensaverrunning, 0, @temp, 0); End; B How to prompt most of Delphi to have a practical HINT property, that is, floating strips. But sometimes it is longer, can you display the floating prompt bar branch? In fact, Hint is a string, so Delphi will automatically explain the carriage return control when the string is displayed, so as long as the carriage return control is equal. According to this principle, we can make a unique vertical prompt. Please set a label in Form1, then look at the sample code: procedure tform1.form1.form; begin labject); begin label1.hint: = '' # 13 # 13 # 13 '提' # 13 'Show'; end; c How do I use Office97 in the menu? Is it feeling that the icon is very fresh in the menu? If you want your program, you can add it so much, then you will prepare BMP! Suppose you intend to add a printer icon (print "to the" file "menu bar (NAME N1)" Print "Add a printer icon (file name c: /inter.bmp), as long as the Form's oncreate This is written in the 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; where the first BitMap.Handle is used for unchecked, the second, specifies the bitmap displayed when selected (Checked), which is different. In addition, since the menu item is limited, if Bitmap is too large, only the upper left corner is displayed.

转载请注明原文地址:https://www.9cbs.com/read-3924.html

New Post(0)