![]() |
Zitat:
Codings? The 6 programs are very long and as I am just executing them in the windows API program I'll simply supply the windows API main program, is that ok? :shock: Bcoz those 6 programs are real real long and if you want them of coz it is ok, anything you say actually, I can send them to you :shock: I need to finish this...I have to.. :( |
What does the "application" means? :shock:
But hey I don't quite understand...I have all the 6 programs comunicate with each othe already, I mean they can work very fine already. So I still have to use pipes or WM_COPYDATA? What are the communications for? :shock: Zitat:
|
Please don't send me any code. I wont have the time to do your work. Just post the relavent code. But I found some code for WM_COPYDATA. But again you will have to modify your c-programs:
First program, the sender:
Delphi-Quellcode:
Second program, the receiver:
function FindWindowByTitle(WindowTitle : string) : Hwnd;
var NextHandle : Hwnd; NextTitle : array[0..260] of char; begin NextHandle := GetWindow(Application.Handle,GW_HWNDFIRST); while (NextHandle > 0) do begin GetWindowText(NextHandle,NextTitle,255); if (pos(WindowTitle,StrPas(NextTitle)) <> 0) then begin result := NextHandle; exit; end else NextHandle := GetWindow(NextHandle,GW_HWNDNEXT); end; result := 0; end; procedure TForm1.Button1Click(Sender: TObject); var struct: CopyDataStruct; begin struct.cbData := Length(Edit1.Text); struct.lpData := PChar(Edit1.Text + #0); SendMessage(FindWindowByTitle('Form2'), WM_COPYDATA, handle, Integer(@struct)); end;
Delphi-Quellcode:
type
TForm1 = class(TForm) Label1: TLabel; procedure GetData(var msg: TMessage); message WM_COPYDATA; ... procedure TForm1.GetData(var msg: TMessage); var struct: PCopyDataStruct; begin struct := Ptr(msg.LParam); Form1.Label1.Caption := PChar(struct^.lpData); end; |
Zitat:
Zitat:
Zitat:
And if you want your c-program to communicate (receive and send data) you will have to modify your c-program. |
Oh actually I just want one of the 6 programs to get input and output from the screen. So...this is what you mean? the communication? :shock:
Oh but...can't this C program just output something to the screen and then get it back, and having all these done inside the C program itself? Or you're saying I just have to do the pipes in order to do this? :shock: Bcoz I thought the inputs and outputs can all be done inside the C program. And the GUI program (windows API) is simply creating the child windows and then execute the C programs. So it is not that easy? :shock: |
Zitat:
Zitat:
Zitat:
|
Zitat:
Zitat:
And then I thought it'll be better to make a windows GUI...so yes...it's vesy messy...so do you think it'll help you to learn better if you can see the windows API codings? Or you have to see also the C programs? :shock: And what changes are needed for that C program? You mentioned it has to be changed in order to communicate right? And yes, the other 5 C programs, they don't have to be changed right? :shock: They will just display outputs to the screen. [edit] Oh I'm terribly sorry, I didn't see your message before Zitat:
|
Oh I think I get a better idea of what you mean now
I have 6 C programs and I have a windows API program the pipes are for the 6 C programs to communicate with the API program, bcoz the C programs have to pass parameters to the API program, am I right? Oh...that would be real nasty then...I thought I'll only have to write a little program. And now I think it's another big program... So these 6 C programs, I have to make them to be "application window" when I create a project right? Bcoz I was making "console window" before for the UNIX running [edit] Oh sorry, one more thing, do I have to use named pipes or anonymous pipes? :shock: Thanz!! :D |
Oh I'm terribly sorry, I didn't see your message before :oops:
Zitat:
So where did you get the codes? Can you send me the link? I want to got there to have a look too. Bcoz I don't know what is the function pos(), I searched through MSDN but couldn't find much details on that. Thanz :P [edit] Oh yes, that is not a C function... :shock: |
Oh unbelievable!! I jsut found this link while searching for refernce of WM_COPYDATA
what do you think? :D ![]() [edit by Admin]link fixed.[/edit] |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:17 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz