//IntPtr.ToString 메서드
using System;
using System.Windows.Forms;
class Program
{
public static void Main()
{
Application.Run(new APMCommManage());
#if(false)
APMCommManage nm = new APMCommManage();
nm.running();
#endif
}
}
class DBMS2022FRM : Form
{
public DBMS2022FRM()
{
this.Text = "DBMS2022FRM";
}
protected override bool ProcessCmdKey(ref Message m, Keys keyData)
{
const int WM_KEYDOWN=0x0100;
if(m.Msg==WM_KEYDOWN)
{
switch(keyData.ToString())
{
case "Return":
break;
case "Right":
break;
case "Left":
break;
case "Space":
break;
case "Escape":
this.Close();
break;
default:
break;
}
}
return base.ProcessCmdKey(ref m, keyData);
}
}
class APMCommManage : Form
{
IntPtr currentHandle = IntPtr.Zero;
public APMCommManage()
{
currentHandle = Handle;
}
protected override void WndProc(ref Message m)
{
const int WM_PAINT=0x000f;
base.WndProc(ref m);
switch(m.Msg)
{
case WM_PAINT:
break;
default:
break;
}
}
protected override bool ProcessCmdKey(ref Message m, Keys keyData)
{
const int WM_KEYDOWN=0x0100;
if(m.Msg==WM_KEYDOWN)
{
switch(keyData.ToString())
{
case "Return":
Console.WriteLine("HANDLE:" + "[" + currentHandle.ToString() + "]");
break;
case "Right":
break;
case "Left":
break;
case "Space":
DBMS2022FRM dbms2022frm = new DBMS2022FRM();
dbms2022frm.ShowDialog();
break;
case "Escape":
Application.Exit();
break;
default:
break;
}
}
return base.ProcessCmdKey(ref m, keyData);
}
}
/*
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe frm_01.cs
*/
'c# 언어 > 초급과정' 카테고리의 다른 글
프로퍼티(Property) - get, set 사용 example(handle) (0) | 2022.12.31 |
---|---|
System.Windows.Forms.ListBox listBox1 = null; (0) | 2022.12.27 |
csc /reference:Newtonsoft.Json.Net20.dll /out:form_2.exe form_2.cs (0) | 2022.09.14 |
c# 프로그램 종료 (0) | 2022.04.14 |
c# *.DLL IDE에 추가하기(using System.Data.SQLite) (0) | 2022.04.06 |