home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Switch off monitor from inside MP (Plugin)
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="TheThunder" data-source="post: 564742" data-attributes="member: 50841"><p>Hi,</p><p>when i'm lying in bed to listen to music i want to shutdown my monitor with my remote. So i started to write a small plugin with the same code i have already used in other programs where it works nice.</p><p>But in my plugin the code does not work, indeed nothing happens when the function to shutdown the Monitor is called.</p><p></p><p>[CODE][DllImport("c:/Windows/System32/user32.dll")]</p><p>public static extern int SendMessage(int hWnd, uint Msg, long wParam, long lParam);</p><p></p><p>private const int WM_SYSCOMMAND = 0x0112;</p><p>private const int SC_MONITORPOWER = 0xF170;</p><p>private const int HWND_BROADCAST = 0xFFFF;</p><p></p><p>private void disable_monitor()</p><p>{</p><p> SendMessage((int)HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);</p><p>}</p><p>[/CODE]</p><p></p><p>Anyone an idea why it isn't working from inside MP?</p></blockquote><p></p>
[QUOTE="TheThunder, post: 564742, member: 50841"] Hi, when i'm lying in bed to listen to music i want to shutdown my monitor with my remote. So i started to write a small plugin with the same code i have already used in other programs where it works nice. But in my plugin the code does not work, indeed nothing happens when the function to shutdown the Monitor is called. [CODE][DllImport("c:/Windows/System32/user32.dll")] public static extern int SendMessage(int hWnd, uint Msg, long wParam, long lParam); private const int WM_SYSCOMMAND = 0x0112; private const int SC_MONITORPOWER = 0xF170; private const int HWND_BROADCAST = 0xFFFF; private void disable_monitor() { SendMessage((int)HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2); } [/CODE] Anyone an idea why it isn't working from inside MP? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Switch off monitor from inside MP (Plugin)
Contact us
RSS
Top
Bottom