Jump to content
The simFlight Network Forums

Kerunix Flan

new Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Kerunix Flan

  1. Why are you linking dynamically to FindWindowEx? Why not use it directly? After all it is a standard Windows library API. It is hardly likely to be missing.

     

    Does the top level window class "UIPCMAIN" exist at the time? Did you check? You can use something like Spyxx to check.

     

    Is your string in ASCII (you are explicitly selecting the "A" version of the Windows API)? If you've compiled for Wide Character use) as most modern compilers default to, I think, then the name you give will not match. If you'd used the direct call instead of dynamic linking things would have sorted themselves automatically.

     

    The source for the way to interface to FSUIPC is provided in the SDK. Did you look? I think it is provided in several languages. I'm only familiar with C, the others were provided by other users.

     

    Pete

     

    Heh, we posted at the same time :)

     

    I'm using the C code as reference but i was very confused by the "old" codebase and the fact that the website say FS2004.

    Well, look like the sample code is still supposed to works with P3Dv2 and i'll assume future problems should be a PEBCAK :)

     

    Thank you !

  2. Problem solved.

     

    So : 

    - doesn't work with unicode enabled

    - an empty string and NULL isn't the same thing (really?  :???: )

     

    new code : 

    OpenConsole()
    
    Prototype.l FindWindowExA(hWnd1.l, hWnd2.l, lpsz1.s, lpsz2.b)
    
    If OpenLibrary(1,"User32.dll")
      Global FindWindowEx.FindWindowExA=GetFunction(1,"FindWindowExA")
    EndIf
    
    
    m_hWnd = FindWindowEx(0, 0, "UIPCMAIN", 0)
    
    If (m_hWnd = 0)
      Print("noooo!")
    Else
      Print("yes!")
    EndIf
      
    Delay(5000)
    
  3. Friendly greetings !

     

    I have the very latest version of FSUIPC installed and registered.

    I downloaded the SDK, this one : http://fsuipc.simflight.com/beta/FSUIPC_SDK.zip

    I'm using FSInterrogate2std and it works, FSUIPC is detected and i can read data.

     

    So far so good  :mrgreen:

     

    I'm using purebasic (just for fun, because i can), i expected to have some problem, but not this problem :

     

    Here is the code, even if you don't know purebasic you'll probably understand it : 

    OpenConsole()
    
    Prototype.l FindWindowExA(hWnd1.l, hWnd2.l, lpsz1.s, lpsz2.s)
    
    If OpenLibrary(1,"user32.dll")
      Global FindWindowEx.FindWindowExA=GetFunction(1,"FindWindowExA")
      Print("user32")
    EndIf
    
    
    m_hWnd = FindWindowEx(0, 0, "UIPCMAIN", "")
    If (m_hWnd = 0)
      Print("noooo!")
    Else
      Print("yes!")
    EndIf
      
    Delay(5000)
    

    Easy, huh ?

     

    Well, the problem is that it produce the output "user32noooo!" ...

    I tried in unicode and non-unicode, with FindWindowExA and FindWindowExW, with administrator privilege and without.

     

    Ho, and i'm not using FSWide (but i tried to detect it too, same problem)

     

    So, the problem seems to be on my side, or perhaps a problem with purebasic.

    But, just to be sure : This is the correct way to detect FSUIPC, isn't ?

     

    That may sound like a dumb question but :

    the "FSUIPC SDK" is under FS2004 table and it say "FSUIPC Software Development Kit for versions 3.999/4.80" (and i have 4.9x)

    So, i wanted to be sure.

     

    Or : is there another SDK hidden somewhere for version > 4.8 ?

    Thank you

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.