Autor Beitrag
xck3001
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 32


D5 Pers, D7 Ent
BeitragVerfasst: Mi 27.12.06 00:55 
Hallo,

ich versuche einer anderen Anwendung (Zoomplayer) Befehle über SendMessage zu übergeben.

Das versuche ich so:
ausblenden Delphi-Quelltext
1:
PostMessage(FindWindow('TApplication',PChar('Zoom Player')),32817,000,0);					


Das FindWindow() liefert einen gültigen Handle zurück, daran sollte es also nicht liegen.
Im Zoomplayer kommt aber anscheinend nichts an, denn er reagiert nicht.
Das hat aber schon einmal funktioniert! Der Fehler muss also in meinem Programm liegen.

Weiß jemand woran es liegen kann dass die Messages nicht ankommen?

Vielen Dank!

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt
Reinhard Kern
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 591
Erhaltene Danke: 14



BeitragVerfasst: Mi 27.12.06 02:56 
user profile iconxck3001 hat folgendes geschrieben:
Hallo,

ich versuche einer anderen Anwendung (Zoomplayer) Befehle über SendMessage zu übergeben.

Das versuche ich so:
ausblenden Delphi-Quelltext
1:
PostMessage(FindWindow('TApplication',PChar('Zoom Player')),32817,000,0);					


Das FindWindow() liefert einen gültigen Handle zurück, daran sollte es also nicht liegen.
Im Zoomplayer kommt aber anscheinend nichts an, denn er reagiert nicht.
Das hat aber schon einmal funktioniert! Der Fehler muss also in meinem Programm liegen.

Weiß jemand woran es liegen kann dass die Messages nicht ankommen?

Vielen Dank!

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt


Hallo, unzulässige Msg-Nummer. Zitat SDK:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Range                    Meaning
0 through WM_USER - 1      Messages reserved for use by Windows.
WM_USER through 0x7FFF     Integer messages for use by private window classes.
0x8000 through 0xBFFF      Messages reserved for future use by Windows.
0xC000 through 0xFFFF      String messages for use by applications.
Greater than 0xFFFF        Reserved by Windows for future use.


Du solltest also WM_MYSPECIALMSG = WM_USER + x benutzen.

Gruss Reinhard
xck3001 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 32


D5 Pers, D7 Ent
BeitragVerfasst: Mi 27.12.06 10:56 
Danke, das ist vermutlich der Auslöser.
Ich benutze 32817 nur deshalb, weil in der Zoomplayer Doku steht:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
// Zoom Player further supports a method of emulating keystrokes through Windows messages.
// This interface is useful for remote control devices.
// There are two types of message control.  The first tell Zoom Player to execute a specific
// function (see "skins/brownish.skn" file for a list of function numbers) and the second
// tells Zoom Player to simulate a key press.
// The Zoom Player Windows messange number is "32817".


War das jetzt eine falsche Annahme dass ich 32817 verwenden muss?
xck3001 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 32


D5 Pers, D7 Ent
BeitragVerfasst: Mi 27.12.06 21:22 
Habs gelöst :)
32817 war korrekt, allerdings hat mein FindWindow() das falsche Fenster ausgespuckt. Wusste nicht dass dann nicht "Zoom Player", sondern "ZPMobile" angesprochen werden muss :)
Komisch finde ich aber, das in dem Zusammenhang nicht HWND_BROADCAST funktioniert hatte.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 27.12.06 21:37 
Broadcast sendet nur an alle Top-Level-Fenster, und das ist ja keins...
Reinhard Kern
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 591
Erhaltene Danke: 14



BeitragVerfasst: Do 28.12.06 03:56 
user profile iconxck3001 hat folgendes geschrieben:
Danke, das ist vermutlich der Auslöser.
Ich benutze 32817 nur deshalb, weil in der Zoomplayer Doku steht:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
// Zoom Player further supports a method of emulating keystrokes through Windows messages.
// This interface is useful for remote control devices.
// There are two types of message control.  The first tell Zoom Player to execute a specific
// function (see "skins/brownish.skn" file for a list of function numbers) and the second
// tells Zoom Player to simulate a key press.
// The Zoom Player Windows messange number is "32817".


War das jetzt eine falsche Annahme dass ich 32817 verwenden muss?


Hallo,

wenn Zoomplayer das so erwartet, musst du eben - was nichts daran ändert, dass die Verwendung nicht korrekt ist, aber das hat der ZP-Programmierer zu verantworten. Probleme treten wahrscheinlich erst mit irgendeiner zukünftigen Version von Windows auf. Von einer "sicheren" Software sollte man eigentlich erwarten , dass sie Msg-Nummern aussortiert, die laut Spezifikation nicht verwendet werden dürfen. M.a.W. Zoomplayer UND Windows sind fehlerhaft, du bist in diesem Fall der einzig Unschuldige.

Gruss Reinhard