
mroschk
Members-
Posts
179 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by mroschk
-
but it works and i dont need to OR the bits. ipc.setbitsUB(0x5400, 1) is not setting bit 1 to 1 and ipc.setbitsUB(0x5400, 2) is not setting bit 2 to 1. Matthias
-
Hello, yes, i do it like you say. I add to the flag variable 1,2,4,8,16,32,64 if the doorflag is set an use writeUB to set the bits. Thanks Matthias
-
Oh je, my mistake, sorry.... As you can see, i forgot to remove the "ipc.writeUB" in the last line...sorry, it works now "" Thanks Matthias
-
Hello, i dont know why it is not working: function DoorState() local flag = 0 --if doorflag0 == 1 then flag = flag + 1 end --if doorflag1 == 1 then flag = flag + 2 end --if doorflag2 == 1 then flag = flag + 4 end --if doorflag3 == 1 then flag = flag + 8 end --if doorflag4 == 1 then flag = flag + 16 end --if doorflag5 == 1 then flag = flag + 32 end --if doorflag6 == 1 then flag = flag + 64 end if doorflag0 == 1 then ipc.setbitsUB(0x5400, 1) end if doorflag1 == 1 then ipc.setbitsUB(0x5400, 2) end if doorflag2 == 1 then ipc.setbitsUB(0x5400, 3) end if doorflag3 == 1 then ipc.setbitsUB(0x5400, 4) end if doorflag4 == 1 then ipc.setbitsUB(0x5400, 5) end if doorflag5 == 1 then ipc.setbitsUB(0x5400, 6) end if doorflag6 == 1 then ipc.setbitsUB(0x5400, 7) end --ipc.display("DoorState " ..flag, 3) ipc.writeUB(0x5400, flag) end The ipc.setbits is not working. The version with the "--" is working fine. I know it is doing the same, but it would be nice to know why the setbits is not working? Matthias
-
Hello, but i testet also ipc.setbitsUB(0x5302, 1) but it seams not to work here. I will test it again this night. Thanks for the Answer and for testing that Matthias
-
Hello, i have this little function in a LUA Script to check/set the DoorSTate. function DoorState() ipc.display("Doors", 3) ipc.setbitsUB(0x5302, 0) ipc.setbitsUB(0x5302, 1) end as you can see, i have testet if this script-function is called, and it is. But the Offset is not set after the function is called. Have you any idea why ? Thanks Matthias
-
Hello, i have still no solution found, why the "event.sim(ANY, and also the "event.sim(AIRCRAFTCHANGE is not fired ? When i have a little lua file in the Modules folder whits only this little script: function test() ipc.display("test") end event.sim(ANY, "test") why is the text not displayed when i load another aircraft ?( which means the function is not called at Aircraft change ) Matthias
-
Hello, oh, i am sorry about posting in the wrong section, maybe a admin can move the topic. Thanks for the answer, i will try... MR .... it works...thx
-
Hello, i have a little Lua Script which should set a offset when i start the sim . function LightsCLEAR() ipc.display("LightsCLEAR") ipc.setbitsUB(0x5301, 1) ipc.setbitsUB(0x5301, 2) ipc.setbitsUB(0x5301, 4) ipc.setbitsUB(0x5301, 8) ipc.setbitsUB(0x5301, 16) ipc.setbitsUB(0x5301, 32) ipc.setbitsUB(0x5301, 64) ipc.setbitsUB(0x5301, 128) end event.sim(ANY, "LightsCLEAR") but it is only running, when i change the Time in the sim, as example from Day to Night. Why is the script not running when i start the sim? Or how can i run a script, when the sim starts? thx MR
-
Hallöchen mal wieder, anscheinend bist du ja richtig fit mit der FSUIPC. Darf ich dich fragen, ob du irgendwie ein event einbaue könntest, welches man abonnieren kann um den Status abzufragen? Matthias
-
Key Focus Restore control (1125) in FSUIPC5
mroschk replied to Paul Henty's topic in FSUIPC Support Pete Dowson Modules
Hello, i tested your new dll ... worked perdect now !! Matthias -
Tested...works perfect now !!! Matthias
-
Hello, thanks for that info, but i must ask a (stupid) question if that dll is the one which runs in the sim or the one i must use in my Programm ? Sorry for the stupid question 🙂 Matthias
-
I am glad that also I can help you a little bit. For me the Problem stays, because it is a bit more complicated. The code works fine if you take the Mouse and press a Button on the App which gives the Focus to the P3D. BUt for me, and my litte programm, it works a bit different. The Programm is a little "Talker" (lets say) between my Program and the FMC from Prosim737. So, the talker runs always minimized. Now i can call a page in the FMC and press there a LSK, which then should open GSX. (like a Remote control for GSX, because in my Homecockpit i dont want to use a Mouse) Ok, after that this command to open GSX is transported via a HttpListener to my talker, which then should activate P3D and send STRG+F12. Now, after my first test i wonder very very because the code, which works in the little test app ( where i click with the Mouse on the button to open the GSX menu (( little app has the Focus ))) did not work when i use the FMC...wonder wonder ... 🙂 After that i put a testbutton on my talker app, which did exactly the same like the FMC calls or the little test app...and voila, it works ... more wonder wonder ??? Now, it seams the app which should get the Focus by ShowWindow(windowHandle, WindowState.ShowNormal); SetForegroundWindow(windowHandle); must have the Focus to give the Focus to another windows. The Problem here ( for me ) is, that the Talker will never have the Focus.... so it is difficult. Thinking about a solution, but that is a Poblem, which only exists in my spezial environment and i have to sort that out myself. I just explained that for you and maybe it hels for further questions by other users. Matthias
-
Yes for sure, i have it updated I have also tried the new code, but it is doing the same...P3D is just "blinking". Before i get your great dll, i send this key via sendkeys and had also the problem with the focus. I have tried all the dll imports , SetForegroundWindow, ShowWindow, GetWindowPlacement and so on, but othing works. FindWindow gives me all the time the MainWindowHandle, but anything else is not working with P3D, nothing will work. But now, view minutes ago, i found a solution that works for me: public enum WindowState { Hide = 0, ShowNormal = 1, ShowMinimized = 2, ShowMaximized = 3, ShowNoActivate = 4, Show = 5, Minimize = 6, ShowMinNoActive = 7, ShowNA = 8, Restore = 9, ShowDefault = 10 } [DllImport("user32.dll")] public static extern int ShowWindow(IntPtr hWnd, WindowState wFlags); [DllImport("user32.dll")] private static extern int SetForegroundWindow(IntPtr hWnd); private void button1_Click(object sender, EventArgs e) { FS_Focus(); FSUIPCConnection.SendKeyToFS(Keys.F12, SendModifierKeys.Control); } void FS_Focus() { Process[] SameProcesses = Process.GetProcessesByName("Prepar3D"); IntPtr windowHandle = SameProcesses[0].MainWindowHandle; if (windowHandle == IntPtr.Zero) { MessageBox.Show("Prepar3D is not running."); } ShowWindow(windowHandle, WindowState.ShowNormal); SetForegroundWindow(windowHandle); } Maybe you can improve your dll with that and it helps a bit . Matthias
-
Hello, thanks for the fast answer. I have used your Template for a short test to exclude the possibility my Programm did anything wrong. So i compiled a poor FSUIPC Test with 2 Buttons. One of them is using a Sleep, so that i can click on the FS Window. I uplad a little video and also the Video as a rar archive for the case it dosent load in the Explorer: http://starflight-virtual.de/Videos/20190116_131735.mp4 http://starflight-virtual.de/Videos/20190116_131735.rar In the video you see the FS Symbol in the Tskbar is only "blinking" after i press the Button without delay. When i press the Button with delay and activate the FS window, then the GSX Manu comes up. Thanks Matthias Ps: Button code private void button1_Click(object sender, EventArgs e) { FSUIPCConnection.SendKeyToFS(Keys.F12, SendModifierKeys.Control); } private void button2_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); FSUIPCConnection.SendKeyToFS(Keys.F12, SendModifierKeys.Control); }
-
Hello again, a very litle problem. I try to send FSUIPCConnection.SendKeyToFS(Keys.F12, SendModifierKeys.Control); to Prepar3D v4.4 to open the GSX Menu, but P3D becomes the Focus, but the Key is not send or something. When i put a Sleep before the FSUIPCConnect command and click on the Prepar3D window to activate it, then it works. Have you any ideas ? Matthias
-
Hello, ahh ok...thanks a lot for our help again .:.. Matthias
-
Hello, thats so fast 🙂 Hmmm...no, i need that FS becomes the Focus before the Key is send 🙂 But i remember there was a DLL import and setforegroundwindow function for that. Ahh, one thing ... if i call FSUIPCConnection.... is there maybe any funktion in your dll to ceck if FSUIPC is available ( FS running ) or did your dll check that ? Matthias
-
Hello, your DLL is AMAZING, that works like a charme !!! One thing...the FS MUST have the Focus when the Key is send right ? Thanks Matthias
-
Hello again, i have a new/another Problem. I have to send "TAB+1" to Prepar3D to open my Doors. I found you thread: but it dosent work for TAB+1 i tried it with controlParameter.Value = (int)Keys.Tab + (49); Also Prepar3D does not become the Focus and also i can not send STRG with controlParameter.Value = (int)Keys.RControlKey + (49); but with controlParameter.Value = 512 + 49; it works ??? I just wonder why it works with 512 and not with Keys.RControlKey ??? Can you please help here a bit ?7 Thanks Matthias
-
Question to read a Bit via LUA
mroschk replied to mroschk's topic in FSUIPC Support Pete Dowson Modules
Hello, i am sorry, but i dont understand the "mask". If 0x0001 is for bit 0 and 0x0002 is for bit 1, so must be 0x0001 for bit 0 0x0002 for bit 1 0x0004 for bit 2 0x0008 for bit 3 0x0016 for bit 4 0x0032 for bit 5 0x0064 for bit 6 0x0128 for bit 7 is correct or not? Because you hve written 0x8000 is bot bit 15, what i can not understand?? Matthias -
Hello Pete, in my little Programm i have to use the 64 it Managed Simconnect.dll for some reasons. But FSUIPCClient.dll, which i also need, is a 32 bit dll ... hmm...it is, as you know, not possible to use 32 bit dll's and 64bit dll's in the same Programm. So, i have downloaded the last SDK, it is 32 bit, hich is a big Problem. Is there a 64 bit version to import in my Programm? Thanks Matthias
-
Hello, yes, i found it, sorry. As i wrote it is the first time i use a nuget package. Thans for all, it works Maybe i will convert most of my project to simconnect and only use the write LVar funktion from your dll Matthias
-
One Question...what kind of DLL is that ? I tried it with the actual officiell Schiratti SDK and here it did not work. Can i have it as a DLL File , so that i can add it as Reference to my Project too ? thanks