I am trying to start off with a stripped-of-.net window except for what is included in NativeWindow. But GetMessage always returns false. The window is shown on the screen and then dissappears real fast because the message loop is never entered.
Code:
public class Form1 : NativeWindow
	{
		static Message message=new Message();
		static Form1 f;
		const int WS_VISIBLE= 0x10000000;
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			CreateParams cp=new CreateParams();
			cp.Caption="NativeWindowTester";
			cp.Width=500;
			cp.Height=500;
			cp.X=0;
			cp.Y=0;
			//cp.Style= WS_VISIBLE;
			cp.Parent= IntPtr.Zero;
			this.CreateHandle(cp);
		}

		[STAThread]
		static void Main() 
		{
			f=new Form1();
			//f.WndProc(ref message);
			Show();
		}

		static void Show()
		{
			a.Api.ShowWindow(f.Handle, a.Api.SW_SHOW);
			a.Api.UpdateWindow(f.Handle);

			while(Convert.ToBoolean(a.Api.GetMessage(ref message, null, 0, 0)))
			{
				a.Api.TranslateMessage(ref message);
				a.Api.DispatchMessage(ref message);
	a.MB.ShowDialog("GetMessage");
			}
		}

		[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
		protected override void WndProc(ref Message m)
		{
			switch (m.Msg)
			{
				case (int)wm.ACTIVATEAPP:
					a.MB.ShowDialog(m.WParam);
					break;
				case (int)wm.NCCREATE:
					break;
				case (int) wm.PAINT:
					Graphics g= Graphics.FromHwnd(f.Handle);
					g.FillRectangle(Brushes.Blue, 0, 0, 100, 100);
					g.Dispose();
					break;
			}
			base.WndProc(ref m);
		}
	}
How do I keep the message loop going?