AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Windows API design

Ein Thema von frankly · begonnen am 5. Mai 2003 · letzter Beitrag vom 7. Mai 2003
Antwort Antwort
Seite 3 von 4     123 4      
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#21
  Alt 6. Mai 2003, 11:32
Zitat von Luckie:
But me and all the others will try to help as best as possible. Maybe we can help you if you provide some code or something we can work with to help you.
Oh...you guyz are just sooooooooo good
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?
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
I need to finish this...I have to..
  Mit Zitat antworten Zitat
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#22
  Alt 6. Mai 2003, 11:35
What does the "application" means?
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?

Zitat:
And don't worry we'll make it.
Thanz for comforting me...the thing that I need most now is your name...and your help of coz
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#23
  Alt 6. Mai 2003, 11:36
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:
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;
Second program, the receiver:
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;
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#24
  Alt 6. Mai 2003, 11:40
Zitat von frankly:
What does the "application" means?
That's your program.
Zitat:
I have all the 6 programs comunicate with each othe already, I mean they can work very fine already.
But you want one of them to communicate with you Delphi programm, don't you?
Zitat:
So I still have to use pipes or WM_COPYDATA?
If I don't misunderstand you - yes.

And if you want your c-program to communicate (receive and send data) you will have to modify your c-program.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#25
  Alt 6. Mai 2003, 11:46
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?

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? 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?
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#26
  Alt 6. Mai 2003, 11:53
Zitat von frankly:
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?
That's exactly what I want to express by saying "communication".

Zitat:
Or you're saying I just have to do the pipes in order to do this?
That what I think.
Zitat:
And the GUI program (windows API) is simply creating the child windows and then execute the C programs. So it is not that easy?
I ain't sure how all your programs work, what they do, what kind of output tey have and what kind of input they need and how the should receive the input and what they do with the input. That's your job. All I can do is to tell you how applications can communicate. But I see your problem. Your programs weren't designed for this purpose. And that's the point, that makes it so difficult.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#27
  Alt 6. Mai 2003, 11:58
Zitat:
I ain't sure how all your programs work, what they do, what kind of output tey have and what kind of input they need and how the should receive the input and what they do with the input. That's your job.
Yes I know, you're helping me here is very generous I understand...I am very happy that you're helping really..thank you sooooooo much!!

Zitat:
I ain't sure how all your programs work, what they do, what kind of output tey have and what kind of input they need and how the should receive the input. That's your job. All I can do is to tell you how application can communicate. But I see your problem. Your programs weren't designed for this purpose. And that's the point, that makes it so difficult.
Yes...I appreciate very much for your understanding...actually I wrote a program to be run on UNIX system

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?

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? They will just display outputs to the screen.

[edit]
Oh I'm terribly sorry, I didn't see your message before
Zitat:
Please don't send me any code. I wont have the time to do your work. Just post the relavent code.
OK, I'll keep reading the pipes from MSDN...and your source codes in teh message (bcoz I just happened to miss the while message...don't know why)hope you will be back soon...need help very very desparately...
  Mit Zitat antworten Zitat
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#28
  Alt 6. Mai 2003, 12:08
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?
Thanz!!
  Mit Zitat antworten Zitat
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#29
  Alt 6. Mai 2003, 12:54
Oh I'm terribly sorry, I didn't see your message before
Zitat:
Please don't send me any code. I wont have the time to do your work. Just post the relavent code.
OK, I'll keep reading the pipes from MSDN...and your source codes in teh message (bcoz I just happened to miss the while message...don't know why)hope you will be back soon...need help very very desparately...

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
[edit]
Oh yes, that is not a C function...
  Mit Zitat antworten Zitat
frankly

Registriert seit: 5. Mai 2003
22 Beiträge
 
#30
  Alt 6. Mai 2003, 13:09
Oh unbelievable!! I jsut found this link while searching for refernce of WM_COPYDATA
what do you think?
http://www.codeproject.com/dialog/quickwin.asp


[edit by Admin]link fixed.[/edit]
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 3 von 4     123 4      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz