Das deutsche QBasic- und FreeBASIC-Forum Foren-Übersicht Das deutsche QBasic- und FreeBASIC-Forum
Für euch erreichbar unter qb-forum.de, fb-forum.de und freebasic-forum.de!
 
FAQFAQ   SuchenSuchen   MitgliederlisteMitgliederliste   BenutzergruppenBenutzergruppen  RegistrierenRegistrieren
ProfilProfil   Einloggen, um private Nachrichten zu lesenEinloggen, um private Nachrichten zu lesen   LoginLogin
Zur Begleitseite des Forums / Chat / Impressum
Aktueller Forenpartner:

von einem bestimmten prozess erzeugte fenster finden

 
Neues Thema eröffnen   Neue Antwort erstellen    Das deutsche QBasic- und FreeBASIC-Forum Foren-Übersicht -> Windows-spezifische Fragen
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
Cherry



Anmeldungsdatum: 20.06.2007
Beiträge: 249

BeitragVerfasst am: 17.02.2008, 19:46    Titel: von einem bestimmten prozess erzeugte fenster finden Antworten mit Zitat

frage: wie kann das HWND eines Fensters bestimmen, von dem ich nur den Namen der Fensterklasse weiß und welcher Prozess es erzeugt hat (PID hab ich)?
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden E-Mail senden
raph ael



Anmeldungsdatum: 12.04.2006
Beiträge: 472

BeitragVerfasst am: 17.02.2008, 20:33    Titel: Antworten mit Zitat

EnumWindows hat Folgendes geschrieben:

Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

· lpEnumFunc
Points to an application-defined callback function. For more information, see the EnumWindowsProc callback function.

· lParam
Specifies a 32-bit, application-defined value to be passed to the callback function.


[url=http://msdn2.microsoft.com/en-us/library/ms633498(VS.85).aspx]EnumWindowProc[/url]
(PHPBB will das nicht als Link erkennen, manuell in die Adresszeile kopieren)

Müsste sich nach FB konventieren lassen. Wenn man untergeordnete Fenster will, verwendet man
GetWindow hat Folgendes geschrieben:

· hWnd
Identifies a window. The window handle retrieved is relative to this window, based on the value of the uCmd parameter.

· uCmd
Specifies the relationship between the specified window and the window whose handle is to be retrieved. This parameter can be one of the following values:
GW_CHILD
The retrieved handle identifies the child window at the top of the Z order, if the specified window is a parent window; otherwise, the retrieved handle is NULL. The function examines only child windows of the specified window. It does not examine descendant windows.
GW_HWNDFIRST
The retrieved handle identifies the window of the same type that is highest in the Z order. If the specified window is a topmost window, the handle identifies the topmost window that is highest in the Z order. If the specified window is a top-level window, the handle identifies the top-level window that is highest in the Z order. If the specified window is a child window, the handle identifies the sibling window that is highest in the Z order.
GW_HWNDLAST
The retrieved handle identifies the window of the same type that is lowest in the Z order. If the specified window is a topmost window, the handle identifies the topmost window that is lowest in the Z order. If the specified window is a top-level window, the handle identifies the top-level window that is lowest in the Z order. If the specified window is a child window, the handle identifies the sibling window that is lowest in the Z order.
GW_HWNDNEXT
The retrieved handle identifies the window below the specified window in the Z order. If the specified window is a topmost window, the handle identifies the topmost window below the specified window. If the specified window is a top-level window, the handle identifies the top-level window below the specified window. If the specified window is a child window, the handle identifies the sibling window below the specified window.
GW_HWNDPREV
The retrieved handle identifies the window above the specified window in the Z order. If the specified window is a topmost window, the handle identifies the topmost window above the specified window. If the specified window is a top-level window, the handle identifies the top-level window above the specified window. If the specified window is a child window, the handle identifies the sibling window above the specified window.
GW_OWNER
The retrieved handle identifies the specified window’s owner window, if any.


btw:
Die MSDN ist mal wieder wirklich langsam durchgeknallt
_________________
Zitat:
1000 Yottabytes sind absurd. 640 Yottabytes sollten genug für jeden sein.
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden E-Mail senden
Stormy



Anmeldungsdatum: 10.09.2004
Beiträge: 567
Wohnort: Sachsen - wo die schönen Frauen wachsen ;)

BeitragVerfasst am: 17.02.2008, 21:00    Titel: Antworten mit Zitat

Ich habe EnumWindows bereits in meiner Demo benutzt, um sämtliche Fenster-Handles zu ermitteln. Dort müsstest du dann bloß, wie raphael, schon sagte über GetWindow und GW_OWNER, die PID ermitteln und mit deiner vergleichen. Falls sie übereinstimmt, dass du das "verlorene Kind" gefunden. zwinkern
_________________
+++ QB-City +++ Die virtuelle Stadt für jeden Freelancer - Join the community!
Projekte: QB-City,MysticWorld (RPG), 2D-OpenGL-Tutorial
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden Website dieses Benutzers besuchen
Heiko



Anmeldungsdatum: 28.07.2008
Beiträge: 101

BeitragVerfasst am: 18.10.2008, 03:17    Titel: Antworten mit Zitat

könnte mir das jemand eventuell auch erklären?
also ich hab vor ein fenster, welches von mir selbst durch eine dll geöffnet wird.
nur weiß ich nicht, wie man das wieder schliessen kann.
hab schon mit getactivewindow und destroywindow herumgespielt, funktioniert aber irgendwie noch nicht ganz.

also habe beide funktionen aus der user32 verfügbar.

aber wie kann ich das geöffnete fenster dann bei bedarf auch schliessen?
bin in FB sozusagen totaler neuling, im großen ganzen auch nicht so schwer, aber bei dem code, den ich so probiere ist es echt mühseelig jedesmal mit dem taskmanager das fenster zu schliessen.
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Beiträge der letzten Zeit anzeigen:   
Neues Thema eröffnen   Neue Antwort erstellen    Das deutsche QBasic- und FreeBASIC-Forum Foren-Übersicht -> Windows-spezifische Fragen Alle Zeiten sind GMT + 1 Stunde
Seite 1 von 1

 
Gehe zu:  
Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.

 Impressum :: Datenschutz