diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2013-01-27 11:53:54 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2013-01-27 11:53:54 +0000 |
commit | f7f30fa3b0935baa4fdd833a697c9c46a8f09dfd (patch) | |
tree | 4ae93d0839391e8ee63601d50b9faf8849dddec1 /FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp | |
parent | 7a8e5bdaae7e8824533657a2ead89179dc17c5a2 (diff) |
Send message to main-window, to display connected-game-name.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@238 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp')
-rw-r--r-- | FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp index ed8a79ab..7ca38e64 100644 --- a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp +++ b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.cpp @@ -59,6 +59,7 @@ FTNoIR_Protocol::FTNoIR_Protocol() ProgramName = "Microsoft FSX";
blnSimConnectActive = false;
hSimConnect = 0;
+ hMainWindow = 0;
}
/** destructor **/
@@ -97,6 +98,7 @@ void FTNoIR_Protocol::loadSettings() { // Update Headpose in Game.
//
void FTNoIR_Protocol::sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose ) {
+PDWORD_PTR MsgResult = 0;
virtSCRotX = -1.0f * headpose->pitch; // degrees
@@ -126,6 +128,9 @@ void FTNoIR_Protocol::sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData ////hr = SimConnect_SetInputGroupState(hSimConnect, INPUT0, SIMCONNECT_STATE_ON);
blnSimConnectActive = true;
+ if (hMainWindow != NULL) {
+ SendMessageTimeout( (HWND) hMainWindow, RegisterWindowMessageA(FT_PROGRAMID), 0, 0, 0, 2000, MsgResult);
+ }
}
}
else {
@@ -169,6 +174,7 @@ bool FTNoIR_Protocol::checkServerInstallationOK( HANDLE handle ) HANDLE hctx;
ULONG_PTR ulCookie;
+ hMainWindow = handle;
qDebug() << "SCCheckClientDLL says: Starting Function";
@@ -368,7 +374,7 @@ void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData //
void FTNoIR_Protocol::getNameFromGame( char *dest )
{
- sprintf_s(dest, 99, "FSX");
+ sprintf_s(dest, 99, "Microsoft FSX");
return;
}
|