Turn Off Monitor
-
Hi all, I would like to be able to turn off/on the monitor programmatically. In fact, I can do that with this piece of code: HWND hWnd = GetSafeHwnd(); ::SendMessage(hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); The problem is when the mouse is moving, the display is turning on back. I tried to use a global mouse hook (implemented in a DLL) which is called and enabled by my main MFC application. The hook works great ! Then, in my application, I have this : InstallHookMouse(); // Install mouse hook which lock all mouse messages DisplayOff(); // Turn off the monitor When I move the mouse while the display is turned off, it turns on back. :wtf: Have I to program a mouse filter driver to lock definitively this mouse and then, the monitor will not turn on back (until my application will decide to turn it on), or is there another solution ? :zzz: Thanks. :)
-
Hi all, I would like to be able to turn off/on the monitor programmatically. In fact, I can do that with this piece of code: HWND hWnd = GetSafeHwnd(); ::SendMessage(hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); The problem is when the mouse is moving, the display is turning on back. I tried to use a global mouse hook (implemented in a DLL) which is called and enabled by my main MFC application. The hook works great ! Then, in my application, I have this : InstallHookMouse(); // Install mouse hook which lock all mouse messages DisplayOff(); // Turn off the monitor When I move the mouse while the display is turned off, it turns on back. :wtf: Have I to program a mouse filter driver to lock definitively this mouse and then, the monitor will not turn on back (until my application will decide to turn it on), or is there another solution ? :zzz: Thanks. :)
hkulten wrote: The problem is when the mouse is moving, the display is turning on back. When I move the mouse while the display is turned off, it turns on back. If you turn the monitor off programmatically, how is it expected to turn back on other than via the mouse or keyboard?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
hkulten wrote: The problem is when the mouse is moving, the display is turning on back. When I move the mouse while the display is turned off, it turns on back. If you turn the monitor off programmatically, how is it expected to turn back on other than via the mouse or keyboard?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Hi all, I would like to be able to turn off/on the monitor programmatically. In fact, I can do that with this piece of code: HWND hWnd = GetSafeHwnd(); ::SendMessage(hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); The problem is when the mouse is moving, the display is turning on back. I tried to use a global mouse hook (implemented in a DLL) which is called and enabled by my main MFC application. The hook works great ! Then, in my application, I have this : InstallHookMouse(); // Install mouse hook which lock all mouse messages DisplayOff(); // Turn off the monitor When I move the mouse while the display is turned off, it turns on back. :wtf: Have I to program a mouse filter driver to lock definitively this mouse and then, the monitor will not turn on back (until my application will decide to turn it on), or is there another solution ? :zzz: Thanks. :)
hkulten wrote: ::SendMessage(hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); the
SC_MONITORPOWER
doesn't really turn the monitor off, it only make use of the power-saving feature of the monitor ( just like the screensaver does )
Maximilien Lincourt Your Head A Splode - Strong Bad
-
hkulten wrote: The problem is when the mouse is moving, the display is turning on back. When I move the mouse while the display is turned off, it turns on back. If you turn the monitor off programmatically, how is it expected to turn back on other than via the mouse or keyboard?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
That's right. I badly expressed myself. X| :zzz: As the same way I can turn off the display programmatically, I will turn it back on programmatically. I don't want the user can turn on the screen. That's why I tried to lock mouse moves, but it does not work. Any solution(s) ? :cool:
-
hkulten wrote: ::SendMessage(hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); the
SC_MONITORPOWER
doesn't really turn the monitor off, it only make use of the power-saving feature of the monitor ( just like the screensaver does )
Maximilien Lincourt Your Head A Splode - Strong Bad
Yes you are right, but my purpose is to use this power-saving feature from my application. I want to be able to turn on/off monitor when I need, and no turn back on of the display when the mouse is moving. Maybe are there softwares which can do that ? :~ Thanks.
-
That's right. I badly expressed myself. X| :zzz: As the same way I can turn off the display programmatically, I will turn it back on programmatically. I don't want the user can turn on the screen. That's why I tried to lock mouse moves, but it does not work. Any solution(s) ? :cool:
Unless you can convince me otherwise, I consider that to be very non user-friendly. If I'm working on the computer and some application decides that the monitor needs to go off and I can't turn it back on by moving the mouse, I would seriously consider removing that application.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Unless you can convince me otherwise, I consider that to be very non user-friendly. If I'm working on the computer and some application decides that the monitor needs to go off and I can't turn it back on by moving the mouse, I would seriously consider removing that application.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
Yes, you're right for this point, but my application is targeting PC which displays multimedia messages on screens (LCD or Plasma) and, normally, there are no interactive users on these machines. My application must turn off/on screens when no messages are displayed in order to save LCD/Plasma life time. My solution works well because, for that kind of PC, there are no users, but I want to develop my application properly, and I cannot accept that the screen could turn on without my application. :) Maybe this is not possible on Windows platform to turn off properly the screen. :( The last thing I would say is that I could do that on Atari ST platform, and fifteen years later, I could not do the same thing on Windows platform fifteen years old :confused: ?!! I think this is the progress... Thanks for your response.