T
topza
Unregistered / Unconfirmed
GUEST, unregistred user!
程序运行是我是全屏运行(800X600),并且隐藏任务栏,我的程序有一个缩小按钮,<br>要求点缩小按钮后显示任务栏且程序显示在任务中,并可恢复程序<br>程序如下:<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure FormCreate(Sender: TObject);<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> wndHandle : THandle;<br> wndClass : array[0..50] of Char;<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>StrPCopy(@wndClass[0], 'Shell_TrayWnd');<br>wndHandle := FindWindow(@wndClass[0], nil);<br>ShowWindow(wndHandle, SW_HIDE);<br>form1.SetBounds (0,0,800,600);<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> ShowWindow(wndHandle, SW_show);<br> Sendmessage(handle,wm_syscommand,sc_minimize,0);<br>end;<br><br>end.<br>但有问题,请高手解决!