protected override void WndProc(ref Message m)
を動かすと、自作のウィンドウが表示されず、
描画もされません。
DX.SetUserWindowMessageProcessDXLibFlag(DX.FALSE);
とはしているんですど、他に何か設定が足りないん
でしょうか。それから、WndProcをコメントアウトしたら、
自作のウィンドウに黒色のみの描画はできていました。
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using DxLibDLL;
namespace DxUltimate
{
public partial class DxViewerForm1 : Form
{
[DllImport("DxLib.dll")]
public static extern int dx_SetUserWindow_2(IntPtr handle);
public DxViewerForm1()
{
InitializeComponent();
}
#region 初期化
private void DxViewerForm1_Load(object sender, EventArgs e)
{
try
{
// 描画先画面を裏画面にセット
DX.SetDrawScreen(DX.DX_SCREEN_BACK);
dx_SetUserWindow_2(Handle);
DX.SetUserWindowMessageProcessDXLibFlag(DX.FALSE);
DX.DxLib_Init();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
#endregion 初期化
protected override void WndProc(ref Message m)
{
DX.DrawLine(0, 0, 300, 300, DX.GetColor(255, 255, 255));
DX.ScreenFlip();
base.WndProc(ref m);
}
}
}