locked
SystemParametersInfo doesnt seem to work RRS feed

  • Question

  • Hi,

    I was trying to disable all visual effects using the  SystemParametersInfo api with this piece of code though it says succeeded in disabling i dont see any change in UI and also when i run this again it reports that its enabled going to disable. I am running this from admin prompt - still i see no change - is the way i am using this wrong or its not supposed to work this way? could someone please help?

          BOOL fResult;
    BOOL res;          
    fResult = SystemParametersInfo(SPI_GETUIEFFECTS, 0, &res, 0);                         
    if (fResult )
    {
    if (res)
    {
    cout << "GUI effects are enabled going to disable  now..." << endl;
    res = false;
    fResult = SystemParametersInfo(SPI_SETUIEFFECTS, 0, &res, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
    if (fResult)
    cout << "Ui VE disabled successfully : " << GetLastError()<<endl;
    else
    cout << "Ui VE disabled UNsuccessfull: " << GetLastError()<<endl;
    }}
    Monday, November 12, 2018 10:26 AM

All replies

  • res = false;
    fResult = SystemParametersInfo(SPI_SETUIEFFECTS, 0, &res, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);

    Above code contains an error.  The call to disable UI effects should pass FALSE.  Instead, it passes the address of the res variable.

    SPI_SETUIEFFECTS
    0x103F
    Enables or disables UI effects. Set the pvParam parameter to TRUE to enable all UI effects or FALSE to disable all UI effects.



    • Edited by RLWA32 Monday, November 12, 2018 11:10 AM
    • Proposed as answer by Baron Bi Tuesday, November 13, 2018 2:12 AM
    Monday, November 12, 2018 11:06 AM
  • Hi,

    Yes once i put as SystemParametersInfo(SPI_SETUIEFFECTS, 0, FALSE, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); I could see that in the next run it would say its disabled. But still i dont see any change in UI when i disable , what am i missing?

    thanks!

    Tuesday, November 13, 2018 5:24 AM
  • Hi,

    Yes once i put as SystemParametersInfo(SPI_SETUIEFFECTS, 0, FALSE, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); I could see that in the next run it would say its disabled. But still i dont see any change in UI when i disable , what am i missing?

    thanks!


    I can't see your system from here. :)  Maybe you are looking for the wrong things as a result of the call?
    Tuesday, November 13, 2018 10:05 AM
  • Hi,

    I was testing on latest Win10 so i was expecting some visible changes in UI if UI effects are disabled like no shadow to mouse pointer or windows  - but i was not able to see them even when I enabled all UI effects!

    Basically i was expecting that the list of GUI effects shown at "system properties - advanced - performance options - visual effect " to be all enabled when I set using SPI_SETUIEFFECTS, and all disabled when its disabled - this is not happening why so?

    thanks!
    Monday, November 19, 2018 8:20 AM
  • It does not even work for me with the Control Panel

    If I set for example "Show shadows under mouse pointer", it does nothing (in fact it worked just once...)

    Monday, November 19, 2018 8:53 AM