/*
csc /reference:Newtonsoft.Json.Net20.dll,ServiceStack.dll,ServiceStack.Interfaces.dll,ServiceStack.ServiceInterface.dll /out:frm01.exe frm01.cs dbmsfrm9801.cs
csc /out:frm01.exe frm01.cs dbmsfrm9801.cs
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;//Marshal
using System.Timers;
class Program
{
public static void Main(string[] args)
{
Application.Run(new CommonLibManage());
}
}
class dbmsfrm9801 : Form
{
public IntPtr localHandle = IntPtr.Zero;
public IntPtr ____localHandle
{
get{ return localHandle; }
set{ localHandle = value; }
}
public dbmsfrm9801()
{
localHandle = Handle;
this.Text = "[" + localHandle.ToString() + "]";
}
protected override bool ProcessCmdKey(ref Message m, Keys keyData)
{
const int WM_KEYDOWN = 0x0100;
if(m.Msg==WM_KEYDOWN)
{
switch(keyData.ToString())
{
case "Escape":
Close();
break;
}
}
return base.ProcessCmdKey(ref m, keyData);
}
}
class CommonLibManage : Form
{
public CommonLibManage()
{
//
}
protected override bool ProcessCmdKey(ref Message m, Keys keyData)
{
const int WM_KEYDOWN = 0x0100;
if(m.Msg==WM_KEYDOWN)
{
switch(keyData.ToString())
{
case "Return":
dbmsfrm9801 frm = new dbmsfrm9801();
Console.WriteLine(frm.____localHandle.ToString());
frm.Show();
break;
case "Escape":
Application.Exit();
break;
}
}
return base.ProcessCmdKey(ref m, keyData);
}
}
'c# 언어 > 초급과정' 카테고리의 다른 글
ComponentOne 프로젝트에 컨트롤 추가하고, 빌드하기 (0) | 2023.03.21 |
---|---|
string 배열을 add로 추가해서, 배열데이타 초기화하기 (0) | 2023.02.22 |
System.Windows.Forms.ListBox listBox1 = null; (0) | 2022.12.27 |
frm.ShowModal() (0) | 2022.12.08 |
csc /reference:Newtonsoft.Json.Net20.dll /out:form_2.exe form_2.cs (0) | 2022.09.14 |