PCbanter

PCbanter (http://www.pcbanter.net/index.php)
-   Windows XP Help and Support (http://www.pcbanter.net/forumdisplay.php?f=15)
-   -   Windows Media Player remnant (http://www.pcbanter.net/showthread.php?t=1107977)

Ron Hardin May 14th 19 11:49 AM

Windows Media Player remnant
 
Windows media player apparently, having been used in a format emergency to play a DVD
instead of VLC player, apparently leaves something running that prevents my "turn monitor
off" program from finishing.

$ cat monitoroff.c
#include windows.h
main() {
sleep(1);
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
exit(0);
}

It works but hangs instead of exiting.

(Cygwin under XP)
--


On the internet, nobody knows you're a jerk.

JJ[_11_] May 14th 19 09:15 PM

Windows Media Player remnant
 
On Tue, 14 May 2019 06:49:38 -0400, Ron Hardin wrote:
Windows media player apparently, having been used in a format emergency to play a DVD
instead of VLC player, apparently leaves something running that prevents my "turn monitor
off" program from finishing.

$ cat monitoroff.c
#include windows.h
main() {
sleep(1);
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
exit(0);
}

It works but hangs instead of exiting.

(Cygwin under XP)


Shouldn't you use the SC_MONITORPOWER? i.e. send the WM_SYSCOMMAND message
with SC_MONITORPOWER wParam and lParam 0x02 to the desktop process' window
(titled "Program Manager").

JJ[_11_] May 14th 19 09:17 PM

Windows Media Player remnant
 
On Tue, 14 May 2019 06:49:38 -0400, Ron Hardin wrote:
Windows media player apparently, having been used in a format emergency to play a DVD
instead of VLC player, apparently leaves something running that prevents my "turn monitor
off" program from finishing.

$ cat monitoroff.c
#include windows.h
main() {
sleep(1);
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
exit(0);
}

It works but hangs instead of exiting.

(Cygwin under XP)


Send it to the the desktop process' window instead (window title "Program
Manager").


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2006 PCbanter
Comments are property of their posters