|
-
Sep 24th, 2013, 02:03 AM
#6
Re: [vbRichClient] How To...
 Originally Posted by DrUnicode
Another nifty thing you can do is to SubClass the Vb6 hidden window and process message WM_DEVICECHANGE and wParam DBT_DEVICEARRIVAL, DBT_DEVICEREMOVECOMPLETE to refresh the Drive List when you plug/unplug USB devices.
Subclassing ThunderMain doesn't seem to be necessary; regular Forms and MDIForms will do just fine. I believe even the cWidgetForm used in your attached project should also be able to receive the WM_DEVICECHANGE message. In fact, as long as there is a top-level window in an app (it doesn't have to be unowned), the system will send that message to that window.
BTW, in case someone needs to get a handle to ThunderMain, here's a simple class module that obtains ThunderMain's hWnd without using a callback function.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|