Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi minimierte Anwendung beenden (https://www.delphipraxis.net/6644-minimierte-anwendung-beenden.html)

Sanchez 17. Jul 2003 14:19


minimierte Anwendung beenden
 
Hallo,

Ich möchte eine minimierte Anwendung, die mit Shellexecute in einem anderen Prog ausgeführt wurde auch von diesem Programm aus beenden.

Mit FindWindow, und SendMessage gehts nicht. (was euch vielleicht klar ist, mir war es noch nicht klar)

Wie soll ich das sonst machen?

grüße daniel

Luckie 17. Jul 2003 14:31

Re: minimierte Anwendung beenden
 
Also, kuck mal, ob du mit FindWindow ein gültiges Fensterhandle bekommst. Dann sehen wir mal weiter.

Sanchez 17. Jul 2003 14:46

Re: minimierte Anwendung beenden
 
Ein Fensterhandle bekomme ich.

So versuche ich das Prog zu beenden:

Delphi-Quellcode:
  SendMessage(proghandle,WM_CLOSE,0,0);
[EDIT]Übrigens, was bekomme ich eigentlich von ShellExecute zurück?
Ein Handle auf das Fenster, oder auf den Prozess ...[/EDIT]

Luckie 17. Jul 2003 14:53

Re: minimierte Anwendung beenden
 
Keins von beiden.
Zitat:

Zitat von PSDK
Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an int and compare it with the value 32 or one of the error codes below.

Versuch mal WM_DESTROY oder WM_QUIT und nimm mal Postmessage.

Sanchez 17. Jul 2003 15:00

Re: minimierte Anwendung beenden
 
Danke!!!

Mit PostMessage hats funktioniert. Sowohl mit WM_CLOSE als auch mit WM_QUIT.

grüße, daniel

:firejump:


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:48 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