Index: lcl/include/intfbaselcl.inc
===================================================================
--- lcl/include/intfbaselcl.inc	(revision 10679)
+++ lcl/include/intfbaselcl.inc	(working copy)
@@ -44,6 +44,11 @@
   Result := nil;
 end;
 
+function TWidgetSet.AllocateHWnd(Method: TLCLWndMethod): HWND;
+begin
+  Result := 0;
+end;
+
 procedure TWidgetSet.AttachMenuToWindow(AMenuObject: TComponent);
 begin
 end;
@@ -134,6 +139,11 @@
   DeleteObject(Clip);
 end;
 
+procedure TWidgetSet.DeallocateHWnd(Wnd: HWND);
+begin
+
+end;
+
 procedure TWidgetSet.DrawArrow(Arrow: TComponent; Canvas: TPersistent);
 begin
 end;
Index: lcl/include/lclintf.inc
===================================================================
--- lcl/include/lclintf.inc	(revision 10679)
+++ lcl/include/lclintf.inc	(working copy)
@@ -51,6 +51,11 @@
   Result:=WidgetSet.AddProcessEventHandler(AHandle, AEventHandler, AData);
 end;
 
+function AllocateHWnd(Method: TLCLWndMethod): HWND;
+begin
+  Result := WidgetSet.AllocateHWnd(Method);
+end;
+
 procedure AttachMenuToWindow(AMenuObject: TComponent);
 begin
   WidgetSet.AttachMenuToWindow(AMenuObject);
@@ -130,6 +135,11 @@
   Result := WidgetSet.DCClipRegionValid(DC);
 end;
 
+procedure DeallocateHWnd(Wnd: HWND);
+begin
+  WidgetSet.DeallocateHWnd(Wnd);
+end;
+
 procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent);
 begin
   WidgetSet.DrawArrow(Arrow, Canvas);
Index: lcl/include/lclintfh.inc
===================================================================
--- lcl/include/lclintfh.inc	(revision 10679)
+++ lcl/include/lclintfh.inc	(working copy)
@@ -40,6 +40,7 @@
 function AddEventHandler(AHandle: THandle; AFlags: dword; AEventHandler: TWaitHandleEvent; AData: PtrInt): PEventHandler; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 function AddProcessEventHandler(AHandle: THandle; AEventHandler: TChildExitEvent; AData: PtrInt): PProcessEventHandler; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 function AddPipeEventHandler(AHandle: THandle; AEventHandler: TPipeEvent; AData: PtrInt): PPipeEventHandler; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
+function AllocateHWnd(Method: TLCLWndMethod): HWND; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 procedure AttachMenuToWindow(AMenuObject: TComponent); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 
 procedure CallDefaultWndHandler(Sender: TObject; var Message); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
@@ -61,6 +62,7 @@
 function CreateStandardCursor(ACursor: SmallInt): hCursor; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 
 function DCClipRegionValid(DC: HDC): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
+procedure DeallocateHWnd(Wnd: HWND); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
 
 function ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;  {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
Index: lcl/interfacebase.pp
===================================================================
--- lcl/interfacebase.pp	(revision 10679)
+++ lcl/interfacebase.pp	(working copy)
@@ -50,6 +50,8 @@
   TChildExitEvent = procedure(AData: PtrInt; AReason: TChildExitReason; AInfo: dword) of object;
   TPipeEvent = procedure(AData: PtrInt; AReasons: TPipeReasons) of object;
 
+  TLCLWndMethod = procedure(var TheMessage: TLMessage) of Object;
+
   { TWidgetSet }
 
   TWidgetSet = class(TObject)
Index: lcl/interfaces/win32/win32lclintf.inc
===================================================================
--- lcl/interfaces/win32/win32lclintf.inc	(revision 10679)
+++ lcl/interfaces/win32/win32lclintf.inc	(working copy)
@@ -170,6 +170,44 @@
   end;
 end;
 
+procedure CallbackAllocateHWnd(Ahwnd: HWND; uMsg: UINT; wParam: WParam; lParam: LParam);
+var
+  Msg: TLMessage;
+  Method: TLCLWndMethod;
+  PMethod: ^TLCLWndMethod;
+begin
+  FillChar(Msg, SizeOf(Msg), #0);
+  
+  Msg.msg := uMsg;
+  Msg.wParam := wParam;
+  Msg.lParam := lParam;
+
+  PMethod := Pointer(Windows.GetWindowLong(Ahwnd, DWL_USER));
+  
+  if Assigned(PMethod) then
+  begin
+    Method := PMethod^;
+  
+    Method(Msg);
+  end;
+end;
+
+function TWin32WidgetSet.AllocateHWnd(Method: TLCLWndMethod): HWND;
+begin
+  Result := Windows.CreateWindowEx(WS_EX_TOOLWINDOW, @ClsName[0],
+   '', WS_POPUP, 0, 0, 0, 0, 0, 0, System.HINSTANCE, nil);
+
+  Windows.SetWindowLong(Result, DWL_USER, PtrInt(Method));
+
+  if Assigned(Method) then Windows.SetWindowLong(Result, GWL_WNDPROC, PtrInt(@CallbackAllocateHWnd))
+  else Windows.SetWindowLong(Result, GWL_WNDPROC, PtrInt(@Windows.DefWindowProc));
+end;
+
+procedure TWin32WidgetSet.DeallocateHWnd(Wnd: HWND);
+begin
+  if Wnd <> 0 then Windows.DestroyWindow(Wnd);
+end;
+
 {------------------------------------------------------------------------------
   Procedure:
   Params:
Index: lcl/interfaces/win32/win32lclintfh.inc
===================================================================
--- lcl/interfaces/win32/win32lclintfh.inc	(revision 10679)
+++ lcl/interfaces/win32/win32lclintfh.inc	(working copy)
@@ -35,9 +35,11 @@
   AEventHandler: TPipeEvent; AData: PtrInt): PPipeEventHandler; override;
 function AddProcessEventHandler(AHandle: THandle;
   AEventHandler: TChildExitEvent; AData: PtrInt): PProcessEventHandler; override;
+function AllocateHWnd(Method: TLCLWndMethod): HWND; override;
 
 function CreateStandardCursor(ACursor: SmallInt): hCursor; override;
 
+procedure DeallocateHWnd(Wnd: HWND); override;
 procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
 
 function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String; override;
