Enabling/Disabling Aero from a Windows Service

前端 未结 2 1396
我在风中等你
我在风中等你 2021-01-27 01:27

I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service. The code works in a standalone application, but when I run

2条回答
  •  感动是毒
    2021-01-27 02:17

    I dont know for certain, but perhaps you need to associate your service's process with the current desktop before that will work?

    Make sure that your service can interact with the desktop. Then use SetThreadDesktop() to set the desktop for the service thread passing in a handle to the desktop called "Default".

    I haven't tried it, and I can't guarantee it'll work. But it might be something to try?

    Good luck :)

提交回复
热议问题