Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.
By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.
simconnect.ReceiveMessage();
//registering
simconnect.MapClientEventToSimEvent(EVENT_ID.SIM_PAUSE, "PAUSE_ON");
simconnect.AddClientEventToNotificationGroup(GROUP_ID.GROUP0, EVENT_ID.SIM_PAUSE, false);
simconnect.SubscribeToSystemEvent(EVENT_ID.SIM_PAUSE, "PAUSE_ON");
//notification group priority
simconnect.SetNotificationGroupPriority(GROUP_ID.GROUP0, SimConnect.SIMCONNECT_GROUP_PRIORITY_HIGHEST);
//handler for event notification
simconnect.OnRecvEvent += new SimConnect.RecvEventEventHandler(ReceiveEvent);
//call back function
static void ReceiveEvent(SimConnect sender, SIMCONNECT_RECV_EVENT data)
{
switch ((GROUP_ID)data.uGroupID) {
case GROUP_ID.GROUP0:
switch ((EVENT_ID)data.uEventID)
{
case EVENT_ID.SIM_PAUSE:
CAxFlightCurrentData.simCtrl.simFreeze = true;
break;
default:
MessageBox.Show("Unknown Event Id...!");
break;
//MessageBox.Show("Unknown event id");
}
break;
default:
MessageBox.Show("Unknown group...!");
break;
}
}
now to pause sim i am using
simconnect.TransmitClientEvent(0, CAxSimconnectData.EVENT_ID.SIM_PAUSE, 1, CAxSimconnectData.GROUP_ID.GROUP0, SIMCONNECT_EVENT_FLAG.DEFAULT);
//The sim is paused when I do it but callback function ReceiveEvent() i not getting called
simconnect = new SimConnect("Managed Client Events", this.Handle, WM_USER_SIMCONNECT, null, 0);