Jump to content
The simFlight Network Forums

Using FSUIPC log facility


Recommended Posts

Hallo Pete

Hope you had your holiday in January.

You helped me last to use the information generated by your FSUIPC log facility:

590140 *** EVENT: Cntrl= 66587 (0x0001041b), Param= 74070 (0x00012156) ROTOR_BRAKE

to activate a rotorswitch on the panel of the PMDG 747-400 in the following way:

{fswnd = FindWindow("FS98MAIN", NULL);

PostMessage(fswnd, WM_COMMAND, 66587, 74070);}

and it works perfectly, thank you.

However, when I turn the rotorswitch on the panel and use Microsoft Spy++ to spy on Window FS98MAIN,

the following are revealed:

<00375> 002403EC P WM_COMMAND wNotifyCode:0201 wID:1051 hwndCtl:00012156 [wParam]

Notice that the wParam:0201041B (revealed by Spy++) is not exactly the same as the wParam (0x0001041b) revealed

by your FSUIPC log facility.

Furthermore, when I push a button on the panel, the FSUIPC log reveals:

218219 *** EVENT: Cntrl= 71023 (0x0001156f), Param= 0 (0x00000000)

but when I spy on Window FS98MAIN, the wParam (or lParam) values are not revealed, only the mouse event:

<00431> 002403EC S WM_PARENTNOTIFY fwEvent:WM_LBUTTONDOWN xPos:603 yPos:591 [wParam]

<00432> 002403EC R WM_PARENTNOTIFY lResult:00000000

<00433> 002403EC S .WM_MOUSEACTIVATE hwndTopLevel:002403EC nHittest:HTCLIENT uMsg:WM_LBUTTONDOWN [wParam]

<00434> 002403EC R .WM_MOUSEACTIVATE fuActivate:MA_ACTIVATE [lResult]

<00435> 002403EC P message:0xB209 [user-defined:WM_USER+44553] wParam:00000020 lParam:00000000

How did FSUIPC get hold of the values?

I wish to test for the wParam (or lParam) values to play a voicefile when I push a button.

All the best,

Bertus

Link to comment
Share on other sites

Notice that the wParam:0201041B (revealed by Spy++) is not exactly the same as the wParam (0x0001041b) revealed by your FSUIPC log facility.

Only the lower 17 bits constitute the FS control number. X1041B is decimal 66587 which is listed as "ROTOR_BRAKE" in my FS controls list (packaged with FSUIPC.ZIP).

Furthermore, when I push a button on the panel, the FSUIPC log reveals:

218219 *** EVENT: Cntrl= 71023 (0x0001156f), Param= 0 (0x00000000)

Control 71023 is certainly outside the range of FS controls known to FS's own CONTROLS.DLL, which is why it is logged as "unknown". I don't know what panel you are using, but it may be an internal addition used only by specific code. There are also probably losts of WM_COMMANDs which are nothing to do with the assignable FS controls.

but when I spy on Window FS98MAIN, the wParam (or lParam) values are not revealed, only the mouse event:

FS controls are not always posted or sent as Windows messages. FSUIPC itself sends most of them directly to the SIM1.DLL module using the "SendEvent" call it supports. I expect many panels do the same. You cannot discover everything internal to a program via Spy because that is only able to see Windows messages.

How did FSUIPC get hold of the values?

By hooking the controls calls, a facility offered to modules and gauges for just such a purpose.

I wish to test for the wParam (or lParam) values to play a voicefile when I push a button.

Check the FS panels SDK.

Regards,

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.