1st February 2007
There is a beta version of functions for use under Vista available here.
Microsoft made significant changes to the audio system for Vista, instead of
being able to change volume based on the type of file being
played, eg: wave, midi, etc, now you can only change volume on devices.
Microsoft removed the API calls that previous versions of Buddy
API called, so they will not work on Vista.
baGetVolumeVista string Type
baSetVolumeVista string Type, integer Volume
These correspond to the version currently in Buddy API. However, for Vista there are four types - "master", "master mute", "record" and "record mute". These will change the master volume on the current default audio output device.
Vista has a new User Account Control feature which provides security for Limited users. baIsLimited checks if the program is being run as a Limited user. If UAC is disabled, then this function will return false. If your program is run as a standard user with UAC enabled, then it will return true. If your program is run as an Admnistrator and UAC is enabled, the user will be presented with a 'Allow this program to run' dialog. If the user allows the program to run, then this function will return false.
If a program is run by a Limited user, then any attempts to write to either the Windows or Program Files will result in the files being saved in the <user>\AppData\Local\VirtualStore folder instead. Attempting to write to the LOCAL_MACHINE branch of the registry will result in the data being written to the CLASSES_ROOT\VirtualStore branch instead. This process is called virtualization. baIsVirtualized returns true if the current program's file access will be virtualized.
To find the VirtualStore folder, use :
baSysFolder( "28" ) & "VirtualStore"
The VirtualStore folder name is never localised.
Running your program as Administrator. If you need to run your program as Administrator, there are several ways to do that. One is to include the words 'install' or 'setup' in the file's name. Windows will automatically run it as Administrator.
Second, you can add the program into the registry at: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\<path_to_executable
baWriteregString ( "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers","c:\My Program\program.exe", "RUNASADMIN",
Third, you can write a launcher program to launch your program that needs admin access. In this case, use baShell to run your program, using "runas" as the Operation.
baShell( "runas", "c:\my program\program.exe", "", "", "" )
Fourthly, you can include a special manifest file to the projector. This is a bit complicated, but here is how to do it. You need to have a copy of mt.exe which comes with the free Platform SDK available from msdn.microsoft.com/platformsdk. I have also included in the download that also contains the next bit you need - a manifest file to embed. Download the zip file and extract it into a folder like c:\mt - keep the name of the folder small and without spaces because you are going to have to type the file name in a DOS window. Now, open up your Director folder and make a backup copy of the Projec32.skl - this is important! Now copy the Projec32.skl file into the c:\mt folder. Then open a DOS window, (Start->Run, type cmd) and enter this command.
c:\mt\mt.exe -manifest c:\mt\app.manifest -outputresource:c:\mt\Projec32.skl;1
This will embed the manifest file into the .skl file, which Director will then place in to the projector. Copy the Projec32.skl file back to the Director folder and then make your projector.
Note that if you run the program as Administrator and UAC is enabled, then Windows will ask the user for permission to allow the program to run.