#form hexa created by console(WndProc)
#form hexa created by console(WndProc)

#IDE 필요없음, Windows10 csc로 개발가능(메모장으로 개발)
#IDE 필요없음, Windows10 csc로 개발가능(메모장으로 개발)
#IDE 필요없음, Windows10 csc로 개발가능(메모장으로 개발)


Caution)Semaphor Needed, Duplicate DrawHexa Execution Error!!!!
Caution)Semaphor Needed, Duplicate DrawHexa Execution Error!!!!
Caution)Semaphor Needed, Duplicate DrawHexa Execution Error!!!!

DrawStyle 1)
DrawStyle 2)


#기본 sample(base sample code)

namespace WindowForm
{
public class ____KingDom : Form
{
private const int WM_KEYDOWN = 0x0100;
private const int WM_PAINT = 0x000F;
static int toggle=0;

static System.Timers.Timer timer;

static Graphics graphics;
static Font font;

public ____KingDom()
{
//
}
// 윈도우 메시지 처리 함수
protected override void WndProc(ref Message m)
{
  base.WndProc(ref m);
  // 메시지 콘솔 출력
  Console.Write(m.Msg + "/");
  Console.Write("0x"+Convert.ToString(m.Msg, 16) + "/");

  switch(m.Msg)
  {
    case WM_PAINT:
    if(toggle==0)
    {
      this.Size = new Size(800,800);
      this.Text = "HEXA BY CONSOLE FORM";

      graphics = CreateGraphics();
      font = new Font("바탕체", 17, FontStyle.Bold);

      toggle=100;

      timer = new System.Timers.Timer();
      timer.Interval = 1000;
      timer.Elapsed += new ElapsedEventHandler(__time_tick);
      timer.Start();

      MessageBox.Show("HEXA START, Time Interval:" + timer.Interval);

      init(ref hexa, ref xpos, ref ypos, ref __design);
      DrawHexa(hexa);
    }
    break;
    case 0x0100 :
    Console.WriteLine("WM_KEYDOWN");

    if (m.Msg == WM_KEYDOWN)
    {
      int ____keyCode=m.WParam.ToInt32();
      if(____keyCode == VK_RIGHT) //RIGHT
      {
        kk = f_rightkey(ref hexa, ref xpos, ref ypos, ref __design);
      }
      if(____keyCode == VK_LEFT) //LEFT
      {
        kk = f_leftkey(ref hexa, ref xpos, ref ypos, ref __design);
      }
      if(____keyCode == VK_SPACE) //SPACE
      {
        kk = f_spacekey(ref hexa, ref xpos, ref ypos, ref __design);
      }
      }
      break;
      }
    }

    [STAThread]
    static void Main(string[] args)
    {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new ____KingDom());
    }
  }
}

f13.cs
0.03MB

+ Recent posts