summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/FaceApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FaceTrackNoIR/FaceApp.cpp')
-rw-r--r--FaceTrackNoIR/FaceApp.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/FaceTrackNoIR/FaceApp.cpp b/FaceTrackNoIR/FaceApp.cpp
new file mode 100644
index 00000000..b993c5cf
--- /dev/null
+++ b/FaceTrackNoIR/FaceApp.cpp
@@ -0,0 +1,33 @@
+#include "FaceApp.h"
+#include "windows.h"
+#include "FTTypes.h"
+#include <QDebug>
+
+//
+// Override the Application MessageFilter, to receive messages from the game(s)
+//
+bool FaceApp::winEventFilter( MSG * msg, long * result )
+{
+ int msgType = msg->message; // test line
+
+ if (msgType == msgID_FTClient) {
+ qDebug() << "FaceApp::winEventFilter says: game tickles me =" << msgType << "hwnd =" << msg->hwnd;
+ if (mainWindow != NULL) {
+ mainWindow->getGameProgramName();
+ }
+ }
+
+ return( false );
+}
+
+//
+// Setup the EventFilter
+//
+void FaceApp::SetupEventFilter( FaceTrackNoIR *window ) {
+
+ mainWindow = window;
+ msgID_FTClient = RegisterWindowMessageA ( FT_PROGRAMID );
+
+ qDebug() << "FaceApp::SetupEventFilter says: Message ID =" << msgID_FTClient;
+
+} \ No newline at end of file