怎么不一样,都是定义常量的方法;API函数中传参中有的是一些固定的值,而定义为SPIF_UPDATEINIFILE 是为了更加的清晰和规范!调用API过程和常量的定义函数:Declare Function SystemParametersInfo Lib "user32"Alias "SystemParametersInfoA" (ByVal uAction As Long,ByVal uParam As Long, ByVal lpvParam As Any, ByValfuWinIni As Long) As LongfuWinIni 的值:SPIF_UPDATEINIFILE(值为1)Or SPIF_SENDWININICHANGE(值为2)SPIF_UPDATEINIFILE 和 SPIF_SENDWININICHANGE 这两个值在VB中还是需要定义的!API中变量和VB中式不冲突的!Const SPIF_UPDATEINIFILE =&H1Const SPIF_SENDWININICHANGE=&H2调用:SystemParametersInfo SPI_SETSCREENSAVEACTIVE,True,0&, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)