Control third party program

zhaozj2021-02-08  205

Any control dedicated device in the case of communication control words that do not know the dedicated device

Fortunately, dedicated equipment provides the program of the control device, and implements its own program by controlling this procedure.

Control the purpose of dedicated equipment, the following programs pass through the RicheDit (the command line window of the device control program)

Write the control command of the device control program, similar to analog terminal, complete your own program control for dedicated devices.

function EnumchildWindowsProc (AHWnd: HWnd; LPARAM: lParam): boolean; stdcall; var WndCaption: array [0..254] of char; WndClassName: array [0..254] of char; begin GetWindowText (AHWnd, @WndCaption, 254 ); GetClassName (AhWnd, @wndclassname, 254); if strpas (wndclassname) = 'trichedit' Then SendMessage (AhWnd, WM_CHAR, 43, 0); sending characters to the command line window Result: = true;

procedure TForm1.Button1Click (Sender: TObject); var Formhandle: Hwnd; begin FormHandle: = Findwindow ( 'TForm2', 'Form2'); the device control program command line parent window EnumchildWindows (FormHandle, @ EnumchildWindowsProc, 0);

END;

转载请注明原文地址:https://www.9cbs.com/read-2600.html

New Post(0)