Autor Beitrag
Mike_C
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Mi 10.09.03 12:20 
Hi Leute!

Ich möchte für ein Programm einen Dialog zum Einstellen von bestimmten Optionen in eine DLL verpacken. Wenn dieser Dialog geschlossen wird, will ich ein Flag setzten und der Hauptanwendung mitteilen, dass das Flag gesetzt wurde, dass bestimmte Folgeaktionen vom Hauptprogramm ausgeführt werden können. Das Flag soll dem Hauptprogramm in meinem Fall sagen: "Pass auf, hier gibt's ne INI-Datei, die du lesen musst und aus der du dir Informationen holen musst um weiter zu machen."
Wie kann ich das realisieren?


:mrgreen:

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Mi 10.09.03 16:50 
via Send/Postmessage() an die Hauptanwendung.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Mi 10.09.03 17:55 
Noch ne Frage:
GetActiveWindow liefert mir ja das aktive Fenster als Handle zurück. Funktioniert das auch bei MDI-Applikationen?

und nocheine zu Sendmessage:
kann ich auch irgendwie nen string an die hauptanwendung schicken?

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Mi 10.09.03 18:15 
ob getactiveWindow() funzt weiss ich nicht, aber du kannst den Fenstern doch das Parent-Handle mitgeben, überschreibst einfach den Create() Konstruktor und erweiterst diesen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
const
 wm_sendMail = wm_user +1;
type
  TMDIClient = class(TForm)
  private
    { Private-Deklarationen }
    MasterWindow:Hwnd;
  public
    { Public-Deklarationen }
    constructor Create(AOwner:TComponent;AMasterWindow:Hwnd);reintroduce;
    procedure WMSendMail(var Msg:TMessage);Message wm_SendMail;
  end;


constructor TMDIClient.Create;
begin
  Inherited Create(Aowner);
  MasterWIndow:= AMasterWindow;
end;


procedure TMDIClient.WMPrintItem(var Msg: TMessage);
begin
  PostMessage(MasterWindow,wm_sendmail,0,0);
end;


und in deiner MainForm
ausblenden Delphi-Quelltext
1:
2:
3:
... 
TMDIClient.Create(self,Self.Handle);
...


Strings kannst du auch versenden, allerdings nicht direkt, sondern nur den Zeiger in lParam einer Message.

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Mi 10.09.03 20:41 
thx, ich werd's ma probieren...
:mrgreen:

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Do 11.09.03 14:12 
Gibt's eigentlich eine bestimmte stelle im programm, wo messages abgefangen werden?

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Do 11.09.03 19:27 
wie? abfangen?

erklär mal genauer.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Do 11.09.03 20:13 
naja ich muss ja an irgendeiner stelle vom programm mitbekommen, ob eine nachricht gesendet wurde oder nicht. das nennt man im allgemeinen "abfangen von nachrichten" - wenn ich mich nicht irre :)

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?