Felipe Monteiro de Carvalho schreef:
Hello,

It´s almost working. I am quite proud to have created a completely
independent implementation of AllocateHWnd =)

Ok, now my problem is that TMethod has 2 informations. A Code pointer,
and a Data pointer, and I can´t seam to find enougth space on
SetWindowLong for 2 extra informations.

GWL_USERDATA seams to work perfectly. Next I tryed both GWL_ID and
DWL_USER, but I always get nil when using GetWindowLong with them.
Maybe I could transform my form into a Dialog to use DWL_USER. What is
the definition of a dialog? How can I make a window that is a dialog?
Just set dialog Window flag?

Any other ideas about how to store 1 more pointer?

I would allocate a memory block from the heap, copy the LCLMethod into it and use SetWindowsLong or SetProp (like the windowinfo) to associate the allocated memory with the window.

Uncompiled code:

var
  MyMethod: ^TLCLWndMethod;
begin
  new(MyMethod);
  MyMethod^ := ;
  SetWindowLongPtr(Handle, GWL_USERDATA, ptrint(MyMethod));
end;

When you destroy the window get the MyMethod pointer and destroy it.

Vincent

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to