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 SubControl von Fenster erhalten (https://www.delphipraxis.net/5120-subcontrol-von-fenster-erhalten.html)

CalganX 24. Mai 2003 19:21


SubControl von Fenster erhalten
 
Hi,
ich habe von einem Control, das auf einem Fenster liegt die Beschriftung.
Nun versuchte ich mit
Delphi-Quellcode:
  temp := iniFile.ReadString('control', 'caption' ,'');
  hSubWnd := FindWindow(nil, PChar(temp));
das Handle des Controls zu erhalten. Leider klappt das nicht, da die Prozedur durch die folgende Überprüfung
Delphi-Quellcode:
  if hSubWnd = 0 then Exit;
beendet wird. Also findet er das Control anscheinend nicht.

Nun frage ich euch: was muss man da machen?

Chris

PS: Also, das Control existiert!

Luckie 24. Mai 2003 19:28

FindWindowEx.

CalganX 25. Mai 2003 09:02

Danke, Luckie! :bouncing4:
Funktioniert wunderbar!
Allerdings habe ich noch eine Frage: zwar gibt man sozusagen die Caption des Controls bzw. des Windows an, aber was wenn diese Caption nicht existiert (also nicht gesetzt ist)? Wie kann man dann das Handle über FindWindow erhalten???

Chris

Luckie 25. Mai 2003 10:49

Such dir mit WinSight oder mit meinem Tool "WindowInfo" das Fenster und ermittele die ID des Steuerelementes. Dann kommst du an das Handle üder GetDlgItem ran.


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