PDA

View Full Version : How to pass window handle to third party API and process window messages.



vikash_pandey82
10th April 2012, 06:10
Hi,

I am programming with third party C++ api which takes a window handle and
reproduce window messages. When I pass my QWidget window handle
and trace event through winEvent it filtering all events of mouse and keybords
also.

I want only those window messages which are produced by that API.
I have Sample code in VC++ Like:

enum { WMUS_FP_NOTIFY = WM_USER+1 };

BEGIN_MSG_MAP(XXXXX)
MESSAGE_HANDLER(WMUS_FP_NOTIFY, OnFpNotify)
END_MSG_MAP()

LRESULT OnFpNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

_com_test_error(DPFPCreateAcquisition(ePriority, GUID_NULL,
DP_SAMPLE_TYPE_IMAGE, m_hWnd, WMUS_FP_NOTIFY,
&m_hOperationEnroll)
);


Can you please help me out?

Thanks in advance.

Spitfire
10th April 2012, 16:18
Take a look here (http://msdn.microsoft.com/en-us/library/ms644958%28v=vs.85%29.aspx).

Basically in your winEvent() just compare MSG.message value to WMUS_FP_NOTIFY and handle only those messages.

Take a look here (http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#winEvent) if you don't know what to do with messages you don't want to handle.