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

Andreas Pakulat apaku at gmx.de
Fri Jun 18 14:01:26 CEST 2010


On 18.06.10 11:43:45, Matthias Pospiech wrote:
> 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?

You can't. Non-GUI classes don't have window handle's. If you want a window
handle you'll need a gui class. (you don't necessarily need to show that
window though)

Andreas

-- 
You like to form new friendships and make new acquaintances.



More information about the Qt-interest-old mailing list