-
Posts
128 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by rfresh
-
-
Hi Pete
I got my two Win7 PCs networked together via HomeGroup and using my wifi network. I can access files on each machine from the other machine to include copying files and creating folders. So, I think my two PCs are connected together.
I run WidePS on my #2 machine but it never connects/sees FSx running on my #1 machine.
Here is the WideClient.log file below.
I guess I don't have something set right eh?
Thanks...
********* WideClient Log [version 6.999n] Class=FS98MAIN *********
Date (dmy): 30/01/15, Time 19:30:42.289: Client name is JANIS-PC140 LUA: "C:\WideClient\Initial.LUA": not found156 Attempting to connect now156 Trying to locate server: Need details from Server Broadcast156 Failed to connect: waiting to try again2199 Attempting to connect now45006 Trying to locate server: Need details from Server Broadcast204564 ****** End of session performance summary ******204564 Total time connected = 0 seconds204564 Reception maximum: 0 frames/sec, 0 bytes/sec204564 Transmission maximum: 0 frames/sec, 0 bytes/sec204564 Max receive buffer = 0, Max send depth = 0, Send frames lost = 0204564 ********* Log file closed (Buffers: MaxUsed 0, Alloc 0 Freed 0 Refused 0) ********* -
Update: Here is the answer to my question on how to detect if FSX is in Full Screen mode or windowed mode.
It turns out it's not so easy to determine that. MS doesn't have a direct property for that so one has to use other mechanisms to achieve the same results.
Here is my solution in C# code that may help others who need to do the same thing.
I had to put this code in a timer, checking every 5 secs to see what mode fsx is in, then act accordingly for what I need to do.
I debugged this code using file writes since when fsx is in full window mode you can't have access to your app. I checked my debug writes to determine everything was working as expected to detect when fsx was in full screen mode. Then I sent the Alt-Enter command and fsx flipped back to windowed mode as I wanted.
I hope this helps someone else.
private void timer_Tick(object sender, EventArgs e){// first we use the GetProcessByName function to try and find fsx if it is runningSystem.Diagnostics.Process[] ieProcs = Process.GetProcessesByName("fsx");if (ieProcs.Length > 0){foreach (System.Diagnostics.Process p in ieProcs){// we have found fsx so it is running but we don't know yet what mode it is inhWnd = p.MainWindowHandle;// we will now attempt to get the fsx form titleconst int count = 512;var text = new StringBuilder(count);if (GetWindowText(hWnd, text, count) > 0){// we got it ! so this means fsx is in windowed mode// I can successfully pop up my app when fsx is in windowed mode, so that's all I need here at this point}else{// no title text so this means fsx is in full screen mode// do what ever you need to do here - in my case I send Alt-Enter to flip it back to windowed mode so I can pop up my app}}}} -
OK. I can find FSX if it is running and I can fetch it's border state, etc. I'll create a function call I can use in my C# code.
Thanks...
-
Hi Paul,
There is a facility in FSUIPC to restore focus to FS, specifically for the keypress control. Please see my last answer to your question in the main forum, i.e. thread
http://forum.simflight.com/topic/78544-help-with-sending-key-presses-with-control-1070-via-0x3110/
Pete
Hi Pete
Is there a way to detect which window mode FSX is in? Obviously I'm using Alt-Enter to toggle FSX in and out of full screen mode. But it would be handy to know first if FSX was already in window mode so then I don't have to send the Alt-Enter command.
Thanks...
-
-
OK, thanks Paul.
I'm certainly not a sharp C# developer by any means, but maybe the following code structure might help you in a small way. I use it to find running applications and I hardly use its full capabilities, but maybe there is something in that 'p' structure that will allow you to focus fsx. It's just code snippets from various things I've needed to do, nothing specific to what you need but maybe it will give you some idea's.
System.Diagnostics.Process[] ieProcs = Process.GetProcessesByName("fsx");if (ieProcs.Length > 0){foreach (System.Diagnostics.Process p in ieProcs){//this.Text = p.ProcessName;//hWnd = p.MainWindowHandle;// 0 hide// 1 show//this.ShowWindow(p.MainWindowHandle, 1);hWnd = p.MainWindowHandle;int style = GetWindowLong(hWnd, GWL_STYLE);SetWindowLong(hWnd, GWL_STYLE, (style | WS_CAPTION));SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);//hWnd.WindowState = FormWindowState.Maximized;//hWnd.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;// 0 hide// 1 show normal// 2 show minimized// 3 show maximized// 5 show// 6 minimize// 9 restore//p.Kill();}} -
Didn't do anything:
ps.RefreshData();sendControl.Value = 65553; // full window toggleFSUIPCConnection.Process("SendControl");ps.WriteChanges();ps.RefreshData(); -
Thanks...I'll try it.
What doc did you find that in Paul?
-
Hi Paul
I want to send Alt-Enter to FSX to toggle it in and out of full screen mode.
I can't find in the docs what the values are for the Alt key and the Enter key?
I will this structure below you gave to me in another thread to send these key strokes to FSX:
sendControl.Value = 65752; // parking brakes
FSUIPCConnection.Process("SendControl");Thanks...
-
Hi Paul
I used the following line to try and add a menu separator in FSX but all it did was create one dash character.
ui.AddSubMenuItem("null", "SCL", "-");
How do we create an FSX separator menu item?
I'd like to add this on a sub-menu item.
Thanks...
-
That fixed it...thanks Paul...
-
Will do...thanks Pete...
-
Hi Paul
My Visual Studio 2013 C# app runs fine inside the VS 2013 IDE.
When I compile the app and try to run its exe outside of VS 2013 I get the following error on start up:
************** Exception Text **************System.IO.FileNotFoundException: Could not load file or assembly 'FSUIPCClient, Version=3.0.5495.14, Culture=neutral, PublicKeyToken=7e7559b53e380b17' or one of its dependencies. The system cannot find the file specified.File name: 'FSUIPCClient, Version=3.0.5495.14, Culture=neutral, PublicKeyToken=7e7559b53e380b17'I checked the FSUIPC DLL path in the VS Solution Explorer and the path is set correctly in References.There must be something else I don't have configured correctly in my VS 2013 IDE for building my solution?Thanks... -
Hi Pete
My Visual Studio 2013 C# app runs fine inside the VS 2013 IDE.
When I compile the app and try to run its exe outside of VS 2013 I get the following error on start up:
************** Exception Text **************System.IO.FileNotFoundException: Could not load file or assembly 'FSUIPCClient, Version=3.0.5495.14, Culture=neutral, PublicKeyToken=7e7559b53e380b17' or one of its dependencies. The system cannot find the file specified.File name: 'FSUIPCClient, Version=3.0.5495.14, Culture=neutral, PublicKeyToken=7e7559b53e380b17'I checked the FSUIPC DLL path in the VS Solution Explorer and the path is set correctly in References.There must be something else I don't have configured correctly in my VS 2013 IDE for building my solution?Thanks... -
Got it...thanks Paul...
-
I meant more like when someone starts up my app, before I start making use FSUIPC, can I detect if they even have it installed? My situation may be a bit different than most because I'm using FSUIPC and Paul's .NET .DLL to communicate with FSX. The .DLL of course is always in my code but it uses FSUIPC to 'talk' to FSX. If a user has not installed FSUIPC, then my app can't talk to FSX. So, I was wondering the best way to check if they have FSUIPC at all.
-
Hi Pete
What's the best way for my windows app to check/detect if FSUIPC is installed on my customers PC?
Thanks...
-
-
And thanks Paul for the updated nested menu controls...I can follow the logic.
-
It worked!! This put 3456 pounds of fuel in the center tank, via the left side CDU!!
Thanks so much Paul and Pete for you help on this issue!
// Press MENU buttonsendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 551;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press FS ACTIONS> LSK5RsendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 544;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press <FUEL LSK1LsendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 534;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press digit 3sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 563;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press digit 4sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 564;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press digit 5sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 565;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press digit 6sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 566;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl");// Press LSK5L to send fuel load to tank 2sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 538;controlParameter.Value = MOUSE_FLAG_LEFTSINGLE;FSUIPCConnection.Process("SendControl"); -
Here is the event logging when I mouse click on the left CDU MENU button:
103304 *** EVENT: Cntrl= 70183 (0x00011227), Param= 536870912 (0x20000000) <70183>103382 *** EVENT: Cntrl= 70183 (0x00011227), Param= 131072 (0x00020000) <70183>One must be mouse down and the other mouse up?These are clicking on the FS ACTIONS LSK5R329786 *** EVENT: Cntrl= 70176 (0x00011220), Param= 536870912 (0x20000000) <70176>329958 *** EVENT: Cntrl= 70176 (0x00011220), Param= 131072 (0x00020000) <70176> -
Mabye thats the problem...I need to be using mouse clicks instead of key presses...I see if I can do that...thanks...
Update:
From the FSUIPC debugger I can see that
#define MOUSE_FLAG_LEFTSINGLE 0x20000000
0x20000000 is the left mouse click event being fired.
But how does one use that in this:
// Press MENU button
sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 551;FSUIPCConnection.Process("SendControl");This tells FSUIPC which button (Menu) to press but how to tell it by the mouse click?Perhaps in the definition of the offset?private Offset<int> sendControl = new Offset<int>("SendControl", 0x3110, true);Thanks... -
The code to toggle the parking brakes works fine on the PMDG 737NGX. I can set and release them OK.
Here is the events log from running my code as shown above:
968579 *** EVENT: Cntrl= 70183 (0x00011227), Param= 0 (0x00000000) <70183> MENU Button968579 *** EVENT: Cntrl= 70176 (0x00011220), Param= 0 (0x00000000) <70176> FS ACTIONS LSK968579 *** EVENT: Cntrl= 70166 (0x00011216), Param= 0 (0x00000000) <70166> FUEL LSK968579 *** EVENT: Cntrl= 70195 (0x00011233), Param= 0 (0x00000000) <70195> 3 digit968579 *** EVENT: Cntrl= 70196 (0x00011234), Param= 0 (0x00000000) <70196> 4 digit968579 *** EVENT: Cntrl= 70197 (0x00011235), Param= 0 (0x00000000) <70197> 5 digit968579 *** EVENT: Cntrl= 70198 (0x00011236), Param= 0 (0x00000000) <70198> 6 digit968595 *** EVENT: Cntrl= 65752 (0x000100d8), Param= 0 (0x00000000) PARKING_BRAKESI'm not sure what debug checkboxes I should check in FSUIPC to be more helpful?UPDATE: I'm missing the last key stroke, a LSK 5L to put the digits into tank 2. Let me try that.That didn't help any:// Press LSK5L to send fuel load to tank 2sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 538;FSUIPCConnection.Process("SendControl");Here I'm just pressing the MENU button on the left CDU...70183 is the correct number (69632+551). The CDU was on the LEGS page and did not change to the MENU page. The brakes of course toggled correctly.2119648 *** EVENT: Cntrl= 70183 (0x00011227), Param= 0 (0x00000000) <70183> MENU Button press only2119648 *** EVENT: Cntrl= 65752 (0x000100d8), Param= 0 (0x00000000) PARKING_BRAKES -
Pete and Paul - I just registered both of your products. Pete I purchased both your FSUIPC and WideFS. Paul, I donated for your .DLL.
I am primemail, inc.
FSUIPCConnection.Open() Calls
in FSUIPC Client DLL for .NET
Posted
Hi Paul
What's the recommended technique for calling FSUIPCConnection.Open()? I don't mean how to call it, I mean should we call it repeatedly out of a timer to make sure we are connected/keep our connection? Or is calling it once enough when our app starts up?
Thanks...