Autor Beitrag
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 19.08.06 23:57 
Hallo!

Wenn ich an mein Programm oder an andere Forms eine Message versenden will, definiere ich mir eine Konstante z.B. WM_USER + 1337.. aber woher weiß ich das diese Message-Konstante noch frei ist und ich nicht auch noch irgendwelche Messages von wo anders erhalte durch die nur mist rauskommt in meiner Prozedur?


greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 20.08.06 00:46 
Rausfinden kannst du das nich, aber WM_USER + irgendwas ist immer frei. Wenn du keine Botschaftsbehandlung mit der message-Direktive verwendest, kannst du auch RegisterWindowMessage benutzen, um eine eindeutige Message-ID zu kriegen.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: So 20.08.06 02:11 
user profile iconMartok hat folgendes geschrieben:
... aber WM_USER + irgendwas ist immer frei.


Wenn du keinen anderen Programme installiert hast, die diese definiert haben. ^^ Oder läuft sowas nur Programmintern?!

MfG
freak

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 20.08.06 03:21 
Sogar noch interner: nur FensterIntern. Solange man nicht mit Absicht eine WM_USER+x an das behandelnde Fenster geschickt bekommt, ist man selbst der einzige, der das tut.

Dieser komplizierte Satz sollte jetzt heißen: Normalerweise kriegt man keine WM_USER von außen. An denen ist man immer selber schuld ;), außer natürleich sie werden für Fersteuerzwecke o.ä. verwendet.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: So 20.08.06 08:36 
Du kannst Dir auch über 'RegisterWindowMessage' eine Message ID von zuweisen lassen, dann musst Du den Messagehandle jedoch im WndProc implementieren.

Einfacher innerhalb einer Applikation ist jedoch, wie schon erwähnt, das WM_USER + x.

_________________
Na denn, dann. Bis dann, denn.
Born-to-Frag Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Mo 21.08.06 11:58 
Ok, danke an alle. Ich benutze jetzt WM_USER + xx :beer:


greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.