Autor Beitrag
theo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Mi 23.03.11 18:32 
Hallo,

Kann ein Service (mit Delphi erstellt) Windowsmessages empfangen? Bzw. was kann / muss ich machen damit das geht


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Mi 23.03.2011 um 17:41
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 23.03.11 18:38 
Der sendende Prozess wird Adminrechte brauchen.

Ob die unterschiedlichen Desktops zusätzlich Probleme machen, weiß ich nicht genau, aber ich vermute das Problem sind nur die fehlenden Adminrechte, wenn es nicht geht.
theo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Mi 23.03.11 20:46 
Ich denke die Rechte sind nicht das Problem.
Ich habe einen Service, der im System-Kontex läuft. Dieser Service lädt eine DLL und startet einen Thread in der DLL.
Ich will aus dem Thread Messages an den Service schicken (als Teil einer IPC). Die IPC zwischen Service und GUI läuft über named Pipes und funktioniert. Nur kann ich nicht mit named pipes zwischen dem Service und einem DLL-Thread komunizieren.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 23.03.11 20:52 
Aber im Dienst selbst funktioniert das Senden an dein neue erzeugtes Fensterhandle und die entsprechende WndProc?

Kannst du vielleicht ein kleines Testprojekt daraus machen und anhängen? Ich habe leider nicht die Zeit selbst eines neu zu bauen.
theo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Mi 23.03.11 21:07 
AHA.

jetzt kommen wir zu dem Punkt, der mir nicht klar ist.

ich muss mir im Dienst ein eigenes Fensterhandle erzeugen. ist das richtig?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 23.03.11 21:35 
Naja, wohin willst du denn sonst die Messages schicken und wo willst du sie empfangen?

Als Beispiel schau dir einfach den Quelltext von TTimer an, der ist sehr klein und überschaubar und deshalb ein sehr gutes Beispiel.
theo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

Win 2000, XP, Vista; Win 7
Delphi 6, 7, 2010, MSSQL, Firebird, DevExpress
BeitragVerfasst: Mi 23.03.11 21:41 
Mach ich danke