用Delphi來實現隱藏電腦任務欄和桌面圖標,可通過本代碼了解一下Delphi編程與Windows之間的關聯。程序實現的具體功能為:隱藏/顯示任務欄、隱藏/顯示桌面圖標、隱藏/顯示開始菜單。代碼編譯後,會生成一個控制窗體,在窗體上點擊對應的按鈕,即可實現對應功能。
程序運行界面如下圖所示:
以下是實現的源代碼:
01
unit
MainUnit;
02
interface
03
uses
04
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
05
StdCtrls, ExtCtrls;
06
07
type
08
TMainForm =
class
(TForm)
09
RadioGroup1: TRadioGroup;
10
RadioGroup2: TRadioGroup;
11
RadioGroup3: TRadioGroup;
12
RadioGroup4: TRadioGroup;
13
procedure
RadioGroup1Click(Sender: TObject);
14
RadioGroup2Click(Sender: TObject);
15
RadioGroup3Click(Sender: TObject);
16
RadioGroup4Click(Sender: TObject);
17
private
18
{ Private declarations }
19
public
20
{ Public declarations }
21
end
;
22
23
var
24
MainForm: TMainForm;
25
implementation
26
{$R *.DFM}
27
TMainForm
.
28
29
hTask: THandle;
30
begin
31
hTask:= FindWindow(
'Shell_TrayWnd'
,
nil
);
32
if
RadioGroup1
ItemIndex=
0
then
33
ShowWindow(hTask, SW_HIDE)
34
else
35
ShowWindow(hTask, SW_SHOW);
36
37
38
39
hDesktop: THandle;
40
41
hDesktop:= FindWindow(
'ProgMan'
42
RadioGroup2
43
ShowWindow(hDesktop, SW_HIDE)
44
45
ShowWindow(hDesktop, SW_SHOW);
46
47
48
49
hTask, hButton: THandle;
50
51
'Shell_Traywnd'
52
hButton:= FindWindowEx(hTask,
'Button'
53
RadioGroup3
54
ShowWindow(hButton, SW_HIDE)
55
56
ShowWindow(hButton, SW_SHOW);
57
58
59
60
hTask, hTIcon: THandle;
61
62
63
hTIcon:= FindWindowEx(hTask,
'ReBarWindow32'
64
RadioGroup4
65
ShowWindow(hTIcon, SW_HIDE)
66
67
ShowWindow(hTIcon, SW_SHOW);
68
69
一篇 不錯的Delphi游戲編寫教程,實現數字拼圖游戲,包
不管什麼曲線命令, 到來路徑中都會變成 Bezier 線
本例效果圖: 代碼文件:unit Unit1;inter
Delphi自制的郵件發送客戶端雛形,實現基本的郵件發送功
//聲明: CreatePatternBrush( Bi