Previous Topic: User-defined Functions


Example: Using DLLs from Script Function

This script demonstrates how to use functions in asset management scripts.

Rem
Rem This example sets the wallpaper on a Windows NT or Windows 95/98, 
Rem using a system DLL call.
Rem
#if Win32
  '32-Bit declaration of the function
 Function SystemParametersInfo Lib "USER32.DLL" Alias "SystemParametersInfoA" ( uiAction as Word,uiParam as Word,pvParam as String, fWinIni as Word) as Boolean
#EndIf

'Define Flags
Dim SPI_SETDESKWALLPAPER as integer
Dim SPIF_UPDATEINIFILE as integer
Dim SPIF_SENDWININICHANGE as integer
'Set system flags
SPI_SETDESKWALLPAPER = 20
SPIF_UPDATEINIFILE = 0x0001
SPIF_SENDWININICHANGE = 0x0002

'Call the system function
SystemParametersInfo(SPI_SETDESKWALLPAPER,0,"c:\winnt\winnt.bmp", SPIF_UPDATEINIFILE OR SPIF_SENDWININICHANGE)