Click here to Skip to main content
15,887,676 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Intellectual property Pin
Joe Woodbury6-May-04 11:53
professionalJoe Woodbury6-May-04 11:53 
GeneralMFC:Mnemonic executed without CTRL Pin
MarcoNedwig6-May-04 6:24
MarcoNedwig6-May-04 6:24 
GeneralRe: MFC:Mnemonic executed without CTRL Pin
Jens Doose7-May-04 0:48
Jens Doose7-May-04 0:48 
GeneralEnumDesktopWindows Pin
Member 10350186-May-04 6:01
Member 10350186-May-04 6:01 
GeneralRe: EnumDesktopWindows Pin
David Crow6-May-04 6:26
David Crow6-May-04 6:26 
GeneralRe: EnumDesktopWindows Pin
Member 10350188-May-04 23:13
Member 10350188-May-04 23:13 
GeneralRe: EnumDesktopWindows Pin
David Crow10-May-04 2:24
David Crow10-May-04 2:24 
GeneralTurn Off Monitor Pin
hkulten6-May-04 5:56
hkulten6-May-04 5:56 
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 | :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 ? Sleepy | :zzz:



Thanks.

Smile | :)


GeneralRe: Turn Off Monitor Pin
David Crow6-May-04 6:24
David Crow6-May-04 6:24 
GeneralRe: Turn Off Monitor Pin
Maximilien6-May-04 7:25
Maximilien6-May-04 7:25 
GeneralRe: Turn Off Monitor Pin
hkulten6-May-04 21:38
hkulten6-May-04 21:38 
GeneralRe: Turn Off Monitor Pin
David Crow7-May-04 2:00
David Crow7-May-04 2:00 
GeneralRe: Turn Off Monitor Pin
hkulten7-May-04 2:44
hkulten7-May-04 2:44 
GeneralRe: Turn Off Monitor Pin
Maximilien6-May-04 7:28
Maximilien6-May-04 7:28 
GeneralRe: Turn Off Monitor Pin
hkulten6-May-04 21:44
hkulten6-May-04 21:44 
GeneralGame Engine Hooking Pin
Opwar6-May-04 5:19
Opwar6-May-04 5:19 
GeneralRe: Game Engine Hooking Pin
jmkhael6-May-04 6:53
jmkhael6-May-04 6:53 
GeneralRe: Game Engine Hooking Pin
Alexander M.,6-May-04 7:20
Alexander M.,6-May-04 7:20 
GeneralCopyFile error 67 Pin
Member 10128696-May-04 5:18
Member 10128696-May-04 5:18 
GeneralRe: CopyFile error 67 Pin
David Crow6-May-04 5:57
David Crow6-May-04 5:57 
GeneralInjecting a MFC Dll Pin
Layane6-May-04 4:53
Layane6-May-04 4:53 
GeneralRe: Injecting a MFC Dll Pin
jmkhael6-May-04 7:01
jmkhael6-May-04 7:01 
GeneralRe: Injecting a MFC Dll Pin
Layane6-May-04 7:42
Layane6-May-04 7:42 
QuestionHow to use the windows API? Pin
sinbaski6-May-04 4:46
sinbaski6-May-04 4:46 
AnswerRe: How to use the windows API? Pin
Michael P Butler6-May-04 4:59
Michael P Butler6-May-04 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.