📄 drawstateunit.pas
字号:
unit DrawStateUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormPaint(Sender: TObject);
var
Text: PChar; // holds a string of text
begin
{initialize the text string}
Text := 'A DISABLED ICON';
{draw the text to the screen in a disabled state}
DrawState(Canvas.Handle, 0, nil, Integer(Text), 0, 20, 20, 0, 0,
DST_TEXT or DSS_DISABLED);
{draw the application's icon in a disabled state}
DrawState(Canvas.Handle, 0, nil, Application.Icon.Handle, 0, 50, 50, 0, 0,
DST_ICON or DSS_DISABLED);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -