[Qt-interest] How to use Windows Message System in Qt/Win Application?

Matthias Pospiech matthias.pospiech at gmx.de
Fri Jun 11 12:52:03 CEST 2010


Carsten Breuer schrieb:
> The code you have posted is not enaugh.
> Is this Stemmer Imaging / Dalsa stuff?
>   
No it is from uEye Camera.

> You have to find out which message ID
> is send. There should be a line like
> IDS_FOOBAR   WM_USER+xxx
>
>   
The list ist this one:
// 
----------------------------------------------------------------------------
// Window message defines
// 
----------------------------------------------------------------------------
#define IS_UEYE_MESSAGE                     (WM_USER + 0x0100)
  #define IS_FRAME                          0x0000
  #define IS_SEQUENCE                       0x0001
...

However I do not know if the 'IS_FRAME' is really a message id or if it 
only a constant used by the dll
> With this message ID you can install
> a event filter that can catch the message
> for you, as Robert mentioned it.
>   
Ok, but still I do not know what to do with the Message ID and thus what 
code to write.

> AFAIR, MFC packs custom messages in some
> ugly defines in the header file of the class.
> So look also to the header where
> CIdsSimpleLiveDlg is defined.
>   
You very likely mean this one here:

BEGIN_MESSAGE_MAP(CIdsSimpleLiveDlg, CDialog)
    //{{AFX_MSG_MAP(CIdsSimpleLiveDlg)
    ON_MESSAGE(IS_UEYE_MESSAGE, OnUEyeMessage)

But that indicates that the whole message stuff is handled by the dll of 
the camera.
As I posted in the first post, the message handling is enabled with

is_EnableMessage(m_hCam, IS_FRAME, GetSafeHwnd());

which I can not do since I do not have 'GetSafeHwnd()'
and is retrieved in the function

LRESULT CIdsSimpleLiveDlg::OnUEyeMessage( WPARAM wParam, LPARAM lParam )
{
...
}

Still I do not see how to integrate this into a Qt App.

Matthias













More information about the Qt-interest-old mailing list