Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cuwin:cuwinbacklight:index [2026/02/08 04:10] – created admincuwin:cuwinbacklight:index [2026/03/19 02:42] (current) admin
Line 3: Line 3:
 CUWIN 백라이트를 소프트웨어적으로 ON /OFF하는 소스코드입니다. CUWIN 백라이트를 소프트웨어적으로 ON /OFF하는 소스코드입니다.
  
-{{ :cuwin:cuwin_백라이트_on_ooff하기:backlite.png?nolink |}} +{{ :cuwin:cuwinbacklight:backlite.png?nolink |}}
  
 +++++ [소스코드 보기] |
 <code csharp> <code csharp>
 using System; using System;
Line 89: Line 89:
 } }
 </code> </code>
 +++++
  
-<html> <center+++++[CWR 백라이트 On/Off하기]| 
-<iframe width="544" height="306" src="http://serviceapi.nmv.naver.com/flash/convertIframeTag.nhn?vid=155D667F34924197A5AF463C2458197E492A&outKey=V123e80aee04379b3cf27acb9dc3074b7360cce2ee458595fb388acb9dc3074b7360c" frameborder="no" scrolling="no"></iframe> +<code csharp
-</center> </html>+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/performance
 +D2, // Standby: partially powered with automatic wake
 +D3, // Sleep: partially powered with device initiated wake
 +D4, // Off: unpowered
 +}
 +
 +[DllImport("coredll.dll", SetLastError = true)]
 +private static extern int SetDevicePower
 +(
 +string pvDevice,
 +int dwDeviceFlags,
 +DevicePowerState DeviceState
 +);
 +
 +public Form1()
 +{
 +InitializeComponent();
 +}
 +
 +private void onButton_Click(object sender, EventArgs e)
 +{
 +SetDevicePower("BKL1:", POWER_NAME, DevicePowerState.D0);
 +}
 +
 +private void offButton_Click(object sender, EventArgs e)
 +{
 +SetDevicePower("BKL1:", POWER_NAME, DevicePowerState.D4);
 +}
 +}
 +
 +}
 +</code>
 +++++
 [[cuwin:index|한단계 뒤로]] [[cuwin:index|한단계 뒤로]]