From 44728d99f68491dc61b54b6941ecfc17ceda3466 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Fri, 12 Oct 2001 00:40:47 +0000 Subject: [PATCH] add mousevanish ctrl --- panda/src/wgldisplay/wglGraphicsWindow.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/panda/src/wgldisplay/wglGraphicsWindow.cxx b/panda/src/wgldisplay/wglGraphicsWindow.cxx index 1cc6a07586..62a52ca170 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.cxx +++ b/panda/src/wgldisplay/wglGraphicsWindow.cxx @@ -3321,23 +3321,36 @@ extern char *ConvDDErrorToString(const HRESULT &error) { // Global system parameters we want to modify during our run static int iMouseTrails; -static bool bCursorShadowOn; +static bool bCursorShadowOn,bMouseVanish; + +#ifndef SPI_GETMOUSEVANISH +// get of this when we upgrade to winxp winuser.h +#define SPI_GETMOUSEVANISH 0x1020 +#define SPI_SETMOUSEVANISH 0x1021 +#endif void set_global_parameters(void) { - // turn off mousetrails and cursor shadow. + // turn off mousetrails and cursor shadow and mouse cursor vanish // cursor shadow causes cursor blink and reduced frame rate due to lack of driver support for // cursor alpha blending - // this is a win2k/xp only param, could use GetVersionEx to do it just for win2k + // this is a win2k/xp only param, could use GetVersionEx to do it just for win2k, + // but since it is just a param it will just cause a silent error on other OS's + // that should be ok SystemParametersInfo(SPI_GETCURSORSHADOW,NULL,&bCursorShadowOn,NULL); SystemParametersInfo(SPI_SETCURSORSHADOW,NULL,(PVOID)false,NULL); SystemParametersInfo(SPI_GETMOUSETRAILS,NULL,&iMouseTrails,NULL); SystemParametersInfo(SPI_SETMOUSETRAILS,NULL,(PVOID)0,NULL); + + // this is ME/XP only feature + SystemParametersInfo(SPI_GETMOUSEVANISH,NULL,&bMouseVanish,NULL); + SystemParametersInfo(SPI_SETMOUSEVANISH,NULL,(PVOID)false,NULL); } void restore_global_parameters(void) { SystemParametersInfo(SPI_SETCURSORSHADOW,NULL,(PVOID)bCursorShadowOn,NULL); SystemParametersInfo(SPI_SETMOUSETRAILS,NULL,(PVOID)iMouseTrails,NULL); + SystemParametersInfo(SPI_SETMOUSEVANISH,NULL,(PVOID)bMouseVanish,NULL); }