[Qt-interest] How to get window handle from QWidget

Matthias Pospiech matthias.pospiech at gmx.de
Fri Jun 18 11:43:45 CEST 2010


J-P Nurmi schrieb:
> ..
>> Now I want to use this library in Qt. I now would like to know how to
>> get the window handle (which I assume ever window
>> in a windows application has) so that I can work with the RenderBitmap
>> function.
>>     
>
> See QWidget::winId().
>   
Ok, this works for QWidgets. I have a different dll which has no gui 
stuff, but still sends messages.
In this case I am working with a mechanical device which is controlled 
using a dll.
This dll requires on initialization a handle - however I do not use a 
QWidget at all. All I do is use QQobject derived class.

The function call is the following:

InitController(
            d->controllerMode, //!< Type of Controller
            d->axis,
            d->port,
            d->baudrate,
            d->winHandle,
            WMU_ASYNCMSG,
            d->mode);

So how can I submit a handle for a non GUI class?

Matthias



More information about the Qt-interest-old mailing list