This is a patch for the winCE LCL interface to add support for
OnAsyncSocketMsg event just like in win32. Already tested and working
(note: if you get my mail from [EMAIL PROTECTED] it was sent before but
didn't went through)

-- 
Aleš Katona <[EMAIL PROTECTED]>
Index: wincecallback.inc
===================================================================
--- wincecallback.inc	(revision 11192)
+++ wincecallback.inc	(working copy)
@@ -1874,8 +1874,13 @@
         end;
       end;
     End;
+    WM_LCL_SOCK_ASYNC:
+    begin
+      if (Window = TWinCEWidgetSet(WidgetSet).AppHandle) and
+          Assigned(TWinCEWidgetSet(WidgetSet).FOnAsyncSocketMsg) then
+        exit(TWinCEWidgetSet(WidgetSet).FOnAsyncSocketMsg(WParam, LParam))
+    end;
 
-
 {$ifdef PassWin32MessagesToLCL}
   else
     // pass along user defined messages
Index: winceint.pp
===================================================================
--- winceint.pp	(revision 11192)
+++ winceint.pp	(working copy)
@@ -62,6 +62,8 @@
      IDC_HSPLIT, IDC_NODROP, IDC_DRAG, IDC_WAIT, IDC_UPARROW, IDC_SIZEWE,
      IDC_SIZENWSE, IDC_SIZENS, IDC_SIZENESW, IDC_SIZE, IDC_IBEAM, IDC_CROSS,
      IDC_ARROW, IDC_ARROW, IDC_ARROW);
+     
+  WM_LCL_SOCK_ASYNC = WM_USER;
 
 type
 
@@ -80,6 +82,8 @@
     UserData: PtrInt;
     OnEvent: TWaitHandleEvent;
   end;
+  
+  TSocketEvent = function(ASocket: THandle; Flags: dword): Integer of object;
 
   { WinCE interface-object class }
 
@@ -111,6 +115,9 @@
     FWaitHandles: array of HANDLE;
     FWaitHandlers: array of TWaitHandler;
     FWaitPipeHandlers: PPipeEventInfo;
+    
+    FOnAsyncSocketMsg: TSocketEvent;
+    
     procedure AllocAndCopy(const BitmapInfo: Windows.TBitmap; const BitmapHandle: HBITMAP;
       const SrcRect: TRect; var Data: PByte; var Size: Cardinal);
     procedure FillRawImageDescriptionColors(Desc: PRawImageDescription);
@@ -172,6 +179,7 @@
     property AppHandle: HWND read FAppHandle;
     property MessageFont: HFONT read FMessageFont;
     property ThemesActive: boolean read FThemesActive;//just for not removing all those refrences
+    property OnAsyncSocketMsg: TSocketEvent read FOnAsyncSocketMsg write FOnAsyncSocketMsg;
   end;
 
  {$I wincelistslh.inc}

Attachment: signature.asc
Description: Toto je digitálne podpísaná časť správy

Reply via email to