May 16, 200521 yr I just saw a gauge that had an ini file that allowed the gauge to be seen in all views. It was a short file that had:[OPTIONS]PanelVisibleInAllViews=1Can I just make an ini file like this for any other gauge I want to be seen in any view, or does the reference to the ini file have to be in the gauge itself? If it does have to be referenced in the gauge file, is there any way to add this capability to an existing gauge? Thanks, regards, Bob.
May 16, 200521 yr Bob,This is the kind of thing that has to be built into the gauge when it is compiled. You will not be able to modify an existing gauge to include this feature.It certainly wouldn't be difficult to produce a generic sort of gauge that could be added to an existing panel to force a particular window to be always visible.Doug
May 16, 200521 yr Hi Doug. That's what I was afraid of. I am no gauge programmer. Is there a possibility that you, or someone else, could design one for me? I want to be able to have Bill Morad's excellent ATC gauge visible in all views. Thanks, regards, Bob.
May 16, 200521 yr Bob,I think this will do the trick. I cheated a little. This gauge doesn't use an .ini file. To specify the window you want to force, list its Ident number as an extra parameter on the panel.cfg entry for this gauge. For example:gauge47=dsd_window_control!window_control, 5,5,20,20,10030This entry will force the window whose Ident is 10030 to be visible at all times.This gauge goes on the main panel. It is RGB(0,0,0) so it will not be visible - you can place it anywhere.If you have any trouble, just holler.Doug
May 20, 200521 yr To confirm, I coded my gauge (referenced above) with WINAPI calls to handle ini file I/O using regular Windows system calls. Just remember that a gauge is like any other DLL in Windows, and that you have access to the full Windows APIs (WIN32, DirectX, etc..), even if specific structures are required by FS for the handshake. Your DLL just works within the set callbacks FS9 requires, but aside from that, anything goes. INI file handling is very easily accomplished using the GetProfileString(), GetPrivateProfileString() and SetProfileString(), SetPrivateProfileString(). Of course, not all calls can be made anywhere in the gauge callbacks (you can, but it may not be wise). Due to the near total lack of documentation from MS from a dev point of view, most of it is trial and error.Read up on INI files here:http://msdn.microsoft.com/library/default....ofilestring.aspThe difficulty is to figure out what folder the INI file is in. You can get that either through the Windows registry looking for the FS9 registration keys that will tell you where FS is installed, through the process information (fs9.exe) startup path, or via FSUIPC.Hope this helps,Etienne
May 21, 200521 yr See also http://forums.avsim.net/dcboard.php?az=sho...ing_type=searchorhttp://forums.avsim.net/dcboard.php?az=sho...ing_type=searchor you get the FSx.exe path simply with GetModuleFileName(NULL,...). Or use GetPrivateProfile... with relative pathnames GetPrivateProfileString("..gaugesmygauge.cfg",...) etc.Arne Bartels
Create an account or sign in to comment