Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cuwin:cuwinbacklight:index [2026/02/08 04:15] – admin | cuwin:cuwinbacklight:index [2026/03/19 02:42] (current) – admin | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| {{ : | {{ : | ||
| + | ++++ [소스코드 보기] | | ||
| <code csharp> | <code csharp> | ||
| using System; | using System; | ||
| Line 88: | Line 89: | ||
| } | } | ||
| </ | </ | ||
| + | ++++ | ||
| + | ++++[CWR 백라이트 On/ | ||
| + | <code csharp> | ||
| + | using System; | ||
| + | using System.Linq; | ||
| + | using System.Collections.Generic; | ||
| + | using System.ComponentModel; | ||
| + | using System.Data; | ||
| + | using System.Drawing; | ||
| + | using System.Text; | ||
| + | using System.Windows.Forms; | ||
| + | using System.Runtime.InteropServices; | ||
| + | |||
| + | namespace BacklightTest | ||
| + | { | ||
| + | public partial class Form1 : Form | ||
| + | { | ||
| + | private const int POWER_NAME = 1; | ||
| + | private const int POWER_FORCE = 0x00001000; | ||
| + | |||
| + | private enum DevicePowerState : int | ||
| + | { | ||
| + | Unspecified = -1, | ||
| + | D0 = 0, // Full On: full power, full functionality | ||
| + | D1, // Low Power On: fully functional at low power/ | ||
| + | D2, // Standby: partially powered with automatic wake | ||
| + | D3, // Sleep: partially powered with device initiated wake | ||
| + | D4, // Off: unpowered | ||
| + | } | ||
| + | |||
| + | [DllImport(" | ||
| + | private static extern int SetDevicePower | ||
| + | ( | ||
| + | string pvDevice, | ||
| + | int dwDeviceFlags, | ||
| + | DevicePowerState DeviceState | ||
| + | ); | ||
| + | |||
| + | public Form1() | ||
| + | { | ||
| + | InitializeComponent(); | ||
| + | } | ||
| + | |||
| + | private void onButton_Click(object sender, EventArgs e) | ||
| + | { | ||
| + | SetDevicePower(" | ||
| + | } | ||
| + | |||
| + | private void offButton_Click(object sender, EventArgs e) | ||
| + | { | ||
| + | SetDevicePower(" | ||
| + | } | ||
| + | } | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | ++++ | ||
| [[cuwin: | [[cuwin: | ||
