S
suduanhao
Unregistered / Unconfirmed
GUEST, unregistred user!
直接调用windows拨号和传真,并传电话号码<br>我试过shellexcute,没成功<br>
<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls, ShellApi;<br><br>type<br> TForm1 = class(TForm)<br> Edit1: TEdit;<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> windir:String;<br> hdl: HWND;<br> TempDir: array[0..255] of Char;<br>begin<br> GetWindowsDirectory(@TempDir,255);<br> windir := StrPas(TempDir);<br> hdl:= FindWindow('DialerClass',nil);<br> if hdl=0 then<br> ShellExecute(handle, 'open', pchar(windir+'/DIALER.EXE'), Nil, Nil, SW_SHOWNORMAL);<br> ShowWindow(hdl,SW_SHOWNORMAL); //使窗口正常化<br> SetForegroundWindow(hdl); //使窗口跳到最前<br> hdl:= FindWindowEx(hdl,0,'ComboBox',nil);<br> hdl:= FindWindowEx(hdl,0,'Edit',nil);<br> SendMessage(hdl, EM_SETSEL, 0, -1);<br> SendMessage(hdl, WM_CLEAR, 0, 0);<br> //SetWindowTextW(hdl, '44554');<br> Edit1.SelectAll;<br> Edit1.CopyToClipboard;<br> SendMessage(hdl,WM_PASTE,0,0);<br> PostMessage(hdl,WM_KEYDOWN,VK_RETURN,0);<br>end;<br><br>end.