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> GroupBox1: TGroupBox;<br> Button3: TButton;<br> Button4: TButton;<br> GroupBox2: TGroupBox;<br> Button1: TButton;<br> Memo1: TMemo;<br> Edit1: TEdit;<br> Label1: TLabel;<br> GroupBox3: TGroupBox;<br> Button2: TButton;<br> Edit2: TEdit;<br> Label2: TLabel;<br> Label3: TLabel;<br> Edit3: TEdit;<br> Memo2: TMemo;<br> procedure Button1Click(Sender: TObject);<br> procedure Button2Click(Sender: TObject);<br> procedure Button3Click(Sender: TObject);<br> procedure Button4Click(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 s: array [0..4095] of char;<br> i: integer;<br> iItemCount: integer;<br>begin<br> try<br> StrToInt(trim(Edit1.text));<br> except<br> MessageDlg('请输入一个$开头的16进制整数ComboBox代号!',mtError, [mbOK], 0);<br> Exit;<br> end;<br> //Get comboBox items count<br> iItemCount:= sendMessage(StrToInt(trim(Edit1.text)),CB_GETCOUNT,0,0);<br><br> //Add it to memo1.<br> memo1.Lines.clear;<br> for i := 0 to iItemCount - 1 do<br> begin<br> sendMessage(StrToInt(trim(Edit1.text)),CB_GETLBTEXT,i,LongInt(@s));<br> memo1.Lines.Add(s);<br> end;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>var s: array [0..4095] of char;<br> i: integer;<br>begin<br> try<br> StrToInt(trim(Edit2.text));<br> except<br> MessageDlg('请输入一个$开头的16进制整数ComboBox代号!',mtError, [mbOK], 0);<br> Exit;<br> end;<br> <br> //Insert a string into combobox item.<br> StrPCopy(s,Edit3.text);<br> sendMessage(StrToInt(trim(edit2.text)),CB_INSERTSTRING,1,LongInt(@s));<br>end;<br><br>procedure TForm1.Button3Click(Sender: TObject);<br>begin<br> //借用其它程序的combobox<br> windows.SetParent($00100196,Self.Handle);<br> //SetVisible。。。<br> ShowWindow($00100196,SW_SHOWNORMAL);<br>end;<br><br>procedure TForm1.Button4Click(Sender: TObject);<br>begin<br> //还给其它程序的combobox<br> windows.SetParent($00100196,$0001000c);<br>end;<br><br>end.<br>-------------------------------------dfm-----------------------------<br>object GroupBox1: TGroupBox<br> Left = 376<br> Top = 16<br> Width = 225<br> Height = 121<br> Caption = #20599#21035#20154#31243#24207#30340#25511#20214#29992<br> TabOrder = 0<br> object Button3: TButton<br> Left = 16<br> Top = 32<br> Width = 145<br> Height = 25<br> Caption = #20511#29992#20854#23427#31243#24207'ComboBox'<br> TabOrder = 0<br> OnClick = Button3Click<br> end<br> object Button4: TButton<br> Left = 18<br> Top = 74<br> Width = 123<br> Height = 25<br> Caption = #36824#20854#23427#31243#24207'ComboBox'<br> TabOrder = 1<br> OnClick = Button4Click<br> end<br>end<br>object GroupBox2: TGroupBox<br> Left = 24<br> Top = 8<br> Width = 337<br> Height = 329<br> Caption = #24471#21040#20854#23427#31243#24207' ComboBox '#20869#23481<br> TabOrder = 1<br> object Label1: TLabel<br> Left = 16<br> Top = 24<br> Width = 90<br> Height = 12<br> Caption = 'ComboBox'#31383#21475'ID:'<br> end<br> object Button1: TButton<br> Left = 232<br> Top = 16<br> Width = 75<br> Height = 25<br> Caption = #21015#20986#20869#23481<br> TabOrder = 0<br> OnClick = Button1Click<br> end<br> object Memo1: TMemo<br> Left = 16<br> Top = 48<br> Width = 289<br> Height = 273<br> TabOrder = 1<br> end<br> object Edit1: TEdit<br> Left = 112<br> Top = 16<br> Width = 97<br> Height = 20<br> TabOrder = 2<br> end<br>end<br>object GroupBox3: TGroupBox<br> Left = 24<br> Top = 344<br> Width = 337<br> Height = 105<br> Caption = #32473#20854#23427#31243#24207'ComboBox '#25554#20837#20854#23427#20869#23481<br> TabOrder = 2<br> object Label2: TLabel<br> Left = 96<br> Top = 21<br> Width = 90<br> Height = 12<br> Caption = 'ComboBox'#31383#21475'ID:'<br> end<br> object Label3: TLabel<br> Left = 96<br> Top = 61<br> Width = 36<br> Height = 12<br> Caption = #20869#23481#65306<br> end<br> object Button2: TButton<br> Left = 8<br> Top = 16<br> Width = 75<br> Height = 25<br> Caption = #25554#20837<br> TabOrder = 0<br> OnClick = Button2Click<br> end<br> object Edit2: TEdit<br> Left = 198<br> Top = 53<br> Width = 121<br> Height = 20<br> TabOrder = 1<br> end<br> object Edit3: TEdit<br> Left = 200<br> Top = 13<br> Width = 113<br> Height = 20<br> TabOrder = 2<br> end<br>end<br>object Memo2: TMemo<br> Left = 376<br> Top = 152<br> Width = 233<br> Height = 297<br> Lines.Strings = (<br> ' '#27880#24847#65306<br> ' '#35201#37197#21512'WS32.exe '#20351#29992#12290<br> ' '#25214#21040#25511#20214#31383#21475'ID'#26159#20851#38190#65292#26597#25214#26041#27861#20026#65306<br> ''<br> ' '#29616#20851#38381'WS32.exe'#20197#22806#25152#26377#31243#24207#12290<br> ' 1'#12289#36873#20013'WS32.exe/Options/Controls '<br> ' 2'#12289#36873#20013'Messages/Process/New Process'<br> ''<br> ' '#25171#24320'"'#20854#23427#31243#24207'".'#38543#20415#19979#25289#19968#20010'ComboBox'<br> #65292#30475<br> 'WS32.exe '#21738#37324#38378#21160#65292#38378#21160#30340#37027#20010#26641#26525#30340'ID'<br> #23601#26159#26412'ComboBox'#30340'ID'#12290)<br> TabOrder = 3<br>end<br>