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 HILFE! WinProc als Objekt methot zu benutzen?wenn überhaupt (https://www.delphipraxis.net/35842-hilfe-winproc-als-objekt-methot-zu-benutzen-wenn-ueberhaupt.html)

sniper_w 12. Dez 2004 14:44


HILFE! WinProc als Objekt methot zu benutzen?wenn überhaupt
 
so was hab ich bid jetzt benuzt :
Code:
type

     TMain = Class
     //private
     FHandle: HWND;
     FWidth, FHeight, FTop, FLeft: integer;
     FCur: TCursorType;//HCURSOR;
     FColor: Cardinal;
     FCaption: string;
     FBrush_BK : HBRUSH;
     FDeviceContext: HDC;
     FParent: TMain;
     FOnClick: TEvent;
     protected
      procedure SetParent( val:TMain );
      procedure SetCaption( val:string);
      procedure SetCur( val: TCursorType);
      procedure SetLeft( Val: Integer);
      procedure SetTop( Val: Integer);
      procedure SetWidth( Val: Integer);
      procedure SetHeight( Val : Integer);
      procedure UpdateSize();
      procedure SetColor( val: Cardinal);
      procedure Click();
     public
      destructor Destroy();override;
      constructor Create(Parent_:TMain=nil; Style_: Integer=0);
      function HasFocus(): Boolean;
      property Top: integer read FTop write SetTop;
      property Left: integer read FLeft write SetLeft;
      property Width: integer read FWidth write SetWidth;
      property Height: integer read FHeight write SetHeight;
      property Handle: HWND read FHandle;
      property Cursor : TCursorType read FCur write SetCur;
      property Color: Cardinal read FColor write SetColor;
      property Caption: string read FCaption write SetCaption;
      property DeviceContext: HDC read FDeviceContext;
      property Parent: TMain read FParent write SetParent;
     end;
es ist ein "MainFram" für non VLC. Bis jetzt müsste ich die Fensterprocedure immer auserhalb des Objektes zu definieren.
also :
Code:
function MainProc(Handle_: HWND; uMsg: UINT; wp: WPARAM; lp: LPARAM): longint; stdcall;
und dann noch:
Code:
 var wc : TWndClassEx;
*****
  wc.lpfnWndProc := @MainProc;
*****

 RegisterClassEx(wc);
Wenn ich die MainProc als TMain method definiere dann kann ich sie niergendwie als Fensterprocedure zuweisen??
Meine Frage : Geht das überhaupt und wenn ja, WIE ?
danke.


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