最小化不是关键,所谓的最小化,只是把程序放到4000X4000地方,你用WinSight跟一下就知道了。<br>其他嘛,照发消息就是了<br><br>看看这个例子:<br>{ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<br> :: QuickReport 3.0 for Delphi 3.0/4.0/5.0 ::<br> :: ::<br> :: Simple report for print the contents of a stringlist ::<br> :: ::<br> :: Copyright (c) 1995-1999 QuSoft AS ::<br> :: All Rights Reserved ::<br> :: ::<br> :: web: http://www.qusoft.com fax: +47 22 41 74 91 ::<br> ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }<br>unit history;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> QuickRpt, Qrctrls, ExtCtrls;<br><br>type<br> TfrmHistory = class(TForm)<br> QuickRep1: TQuickRep;<br> DetailBand1: TQRBand;<br> QRMemo1: TQRMemo;<br> PageHeaderBand1: TQRBand;<br> QRSysData1: TQRSysData;<br> procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;<br> var PrintReport: Boolean);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> frmHistory: TfrmHistory;<br>HD, HD2, hd3,e1, e2, e3:THandle;<br>implementation<br><br>uses Unit1;<br><br><br>{$R *.DFM}<br><br>procedure fsdb(P: Pointer); stdcall;<br>var N: THandle; i: integer;<br>begin<br> repeat<br> Application.ProcessMessages;<br> HD := findwindow(PChar('#32770'), PChar('发送传真向导'));<br> until HD <> 0;<br><br> N := findwindowEx(HD, 0, PChar('Button'), PChar('下一步(&N) >'));<br><br> PostMessage(N, BM_CLICK, 0, 0);<br> Application.ProcessMessages;<br> Application.ProcessMessages;<br> repeat<br> Application.ProcessMessages;<br> HD3 := findwindowEx(HD, 0, PChar('#32770'), PChar('发送传真向导'));<br> until HD3 <> 0;<br> repeat<br> Application.ProcessMessages;<br> HD2 := findwindowEx(HD, HD3, PChar('#32770'), PChar('发送传真向导'));<br> until HD2 <> 0;<br><br> MessageBeep(MB_OK);<br> repeat<br> Application.ProcessMessages;<br> E1 := FindWindowEx(HD2, 0, PChar('Edit'), nil);<br> until E1 <> 0;<br> repeat<br> Application.ProcessMessages;<br> E2 := FindWindowEx(HD2, E1, PChar('Edit'), nil);<br> until E2 <> 0;<br> repeat<br> Application.ProcessMessages;<br> E3 := FindWindowEx(HD2, E2, PChar('Edit'), nil);<br> until E3 <> 0;<br><br><br> SendMessage(E1, WM_SetText, 0, LongInt(Pchar(P1)));<br> SendMessage(E1,EM_GETMODIFY,0,0);<br> SendMessage(E3,WM_SetText, 0, LongInt(PChar(P2)));<br> SendMessage(E3,EM_GETMODIFY,0,0);<br><br> PostMessage(findwindowEx(HD, 0, PChar('Button'), PChar('下一步(&N) >')), BM_CLICK, 0, 0);<br> PostMessage(findwindowEx(HD, 0, PChar('Button'), PChar('下一步(&N) >')), BM_CLICK, 0, 0);<br><br> try<br> PostMessage(findwindowEx(HD, 0, PChar('Button'), PChar('完成')), BM_CLICK, 0, 0);<br> except<br> end;<br>end;<br><br><br>procedure TfrmHistory.QuickRep1BeforePrint(Sender: TCustomQuickRep;<br> var PrintReport: Boolean);<br>var<br> ThreadID: DWORD;<br> HThread: THandle;<br>begin<br> HD:=0;<br> HD2:=0;<br> HD3:=0;<br> E1:=0;<br> E2:=0;<br> E3:=0;<br> HThread := CreateThread(nil, 0, @fsdb, nil, 0, ThreadID);<br>end;<br>end.<br><br><br><br>其他涉及的几个语句:<br>procedure prc_MenuClick(m1,m2,m3: Integer);<br>begin<br>if m3 >= 0 then<br> PostMessage(PSH,WM_COMMAND,<br> GetMenuItemID(GetSubMenu(GetSubMenu(GetMenu(PSH),m1),m2),m3)<br> ,0)<br>else<br> PostMessage(PSH,<br> WM_COMMAND,<br> GetMenuItemID(GetSubMenu(GetMenu(PSH),m1),m2),0);<br>end;<br>其中的级别是对付子菜单的,我以前写过一个程序专门把PhotoShop 隐藏起来<br>调用功能的:)<br>