Что нужно давать WSAAsyncSelect в качестве параметра handle, если тот запускается и используется в dll (init), и никакой формы (у которой мо
const WM_ASYNCSELECT = WM_USER+0;
type TNetConnectionsManager = class(TObject) protected FWndHandle : HWND; procedure WndProc( var MsgRec : TMessage ); ... end;
constructor TNetConnectionsManager.Create begin inherited Create; FWndHandle := AllocateHWnd(WndProc); ... end;
destructor TNetConnectionsManager.Destroy; begin ... if FWndHandle<>0 then DeallocateHWnd(FWndHandle); inherited Destroy; end;
procedure TNetConnectionsManeger.WndProc( var MsgRec : TMessage ); begin with MsgRec do if Msg = WM_ASYNCSELECT then WMAsyncSelect(MsgRec) else DefWindowProc( FWndHandle, Msg, wParam, lParam ); end;