How capture this event in fivewin.
i wanna know when is pluged a pen drive or other hardware disk
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
someone can help me ?
LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
switch (uiMsg)
{
case WM_DEVICECHANGE:
{
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR) lParam;
switch (wParam)
{
case DBT_DEVICEARRIVAL:
MessageBox(hWnd, "A device has been inserted.", "USB Notice", MB_OK);
break;
case DBT_DEVICEREMOVECOMPLETE:
MessageBox(hWnd, "A device has been removed.", "USB Notice", MB_OK);
break;
}
}
break;
default:
return DefWindowProc(hWnd, uiMsg, wParam, lParam);
break;
}
return 0;
}
function Main()
local oWnd := TMyWindow():New()
oWnd:Activate()
return nil
CLASS TMyWindow FROM TWindow
CLASSDATA lRegistered
METHOD HandleEvent( nMsg, nWParam, nLParam )
ENDCLASS
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TMyWindow
if nMsg == WM_DEVICECHANGE
MsgBeep() // ok, we are receiving WM_DEVICECHANGE messages
endif
return Super:HandleEvent( nMsg, nWParam, nLParam )
Baxajaun wrote:Dear Anser,
please, could you post a small and whole sample ?
Thanks in advance !
Best regards,
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 28 guests