oto moj kod do ladowania form
//unit
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
Edit1: TEdit;
Label1: TLabel;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
shandle : hwnd;
implementation
uses keyb_ascii;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin
memo1.lines.loadfromfile('C:\windows\pargan_hwnd.inf');
shandle := getdc(strtoint(memo1.lines[3]));
//Windows.SetFocus(FindWindowEx(FindWindow(nil,'Edytor Kodu'),shandle,nil,nil));
for i:=0 to length(edit1.text) do
{showmessage(inttostr(get_char_number(edit1.text[i])));
showmessage('PIK: '+get_number_char(get_char_number(edit1.text[i])));
}
keybd_event(get_number_of_char(edit1.text[i]),0,0,0);
//keybd_event(get_char_number(edit1.text[i]),0,0,0);
end;
procedure TForm1.FormCreate(Sender: TObject);
//var
//uchwyt:hwnd;
begin
initialize_ascii_table;
{uchwyt:= FindWindow('Pargan 3D',nil);
SetWindowText(uchwyt, 'ziombero in da hause'); }
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
Form1.Free;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
showmessage('Przykładowa wtyczka wstawiająca tekst do programu Pargan 3D');
end;
end.
//project
library plugin;
uses
SysUtils,
Classes,
forms,
Unit1 in 'Unit1.pas' {Form1},
keyb_ascii in '..\keyb_ascii\keyb_ascii.pas';
{$R *.RES}
procedure ShowForm;
var
Form1 : TForm1;
begin
Form1 := TForm1.Create(Application); // stworz formularz
Form1.Show; // wyswietl formularz
*Form1.Free; * zwolnij zmienna
end;
exports
ShowForm index 1;
begin
end.
///koniec
teraz jak ja wywoalc
//wlasny prog
var
ShowForm : procedure;
dll : thandle;
//ladowanie
dll := LoadLibrary('plugin.dll');
//wywoalnie
@ShowForm := GetProcAddress(DLL, 'ShowForm');
moze to jakos pomoze :>