[Qt-interest] WinEvent

OS Prog osprog at gmail.com
Mon Jul 6 10:52:29 CEST 2009


Hi,

It is the same behaviour on XP too.

I just catch "winEvent ()" and on "DBT_DEVICEARRIVAL" looking for PID and
VID string in DEV_BROADCAST_DEVICEINTERFACE.dbcc_name...

What I'm missing?

Regards,
Nikolay


> Hi,
>
> I try to find the attached USB PID and VID.
>
> bool MainWindow::winEvent ( MSG * message, long * result )
>
> {
>
> PDEV_BROADCAST_DEVICEINTERFACE pdbd;
>
> if (WM_DEVICECHANGE == message->message)
>
> {
>
> switch(message->wParam)
>
> {
>
> case DBT_DEVICEARRIVAL:
>
> qDebug("DBT_DEVICEARRIVAL");
>
> qDebug("lParam:%08X", message->lParam);
>
> if(message->lParam)
>
> {
>
> pdbd = (PDEV_BROADCAST_DEVICEINTERFACE)message->lParam;
>
> qDebug("%s", qPrintable(QString::fromUtf16((ushort*)(pdbd->dbcc_name))));
>
> }
>
> break;
>
> <snip>
>
>
> When I attach an USB Flash drive, I get only '?"' for dbcc_name. I expect
> some string with PID and VID inside.
>
>
> What I'm doing wrong?
>
>
> It's Qt4.5 on Vista.
>
>
> Regards,
>
> Nikolay
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090706/693ba19d/attachment.html 


More information about the Qt-interest-old mailing list