Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi nonVCL Kapselung (https://www.delphipraxis.net/101492-nonvcl-kapselung.html)

Neutral General 14. Okt 2007 14:39

Re: nonVCL Kapselung
 
Nachdem man versucht ein zweites Fenster zu erstellen mit CreateWindowEx bekomme ich

Delphi-Quellcode:
---------------------------
Message
---------------------------
Invalid menu handle
---------------------------
OK  
---------------------------
Wobei ich dazu sagen muss, dass ich ne Globale Variable habe:

Delphi-Quellcode:
var
  IDs: Integer = -1;
und:

Delphi-Quellcode:
constructor TNVCLControl.Create(AParent: TNVCLControl);
begin
  inherited Create;
  inc(IDs);
  FID := IDs;
end;
Das heißt jedes Control bekommt ne andere ID weil sie jedesmal um 1 erhöht wird. Und da TNVCLForm = class(TNVCLControl) bekommt auch jede Form ihre einzigartige ID.

Gruß
Neutral General

Apollonius 14. Okt 2007 14:43

Re: nonVCL Kapselung
 
Aber warum übergibst du FID als hMenu? Bei Child-Controls verstehe ich das, das steht da sogar in der MSDN, aber für nicht-Child-Controls sollte das ein Menü-Handle sein und keine ID.

Neutral General 14. Okt 2007 14:54

Re: nonVCL Kapselung
 
Haha! Ja die Fenster selbst bekommen gar kein hMenu-Wert.. Bzw. Die bekommen alle 0!

Also das mit den zwei Fenstern klappt schonmal. Aber die WM_COMMAND Messages kommen noch falsch an.

Gruß
Neutral General


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:02 Uhr.
Seite 2 von 2     12   

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