#region 改变窗口样式
#if !DEBUG
[DllImport ("User32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hwnd);
[DllImport ("User32.dll")]
private static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
protected override void WndProc(ref Message m)
...{
base.WndProc(ref m);
switch(m.Msg)
...{
case 0x86://WM_NCACTIVATE
goto case 0x85;
case 0x85://WM_NCPAINT
...{
IntPtr hDC = GetWindowDC(m.HWnd);
//把DC转换为.NET的Graphics就可以很方便地使用Framework提供的绘图功能了
Graphics gs = Graphics.FromHdc(hDC);
处理色彩#region 处理色彩
int ibox = 1;
if (this.MaximizeBox) ibox ++;
if (this.MinimizeBox) ibox ++;
//得到相关背景图片
Image imgpm = Image.FromFile( Application.StartupPath+ @"Main.bmp");
1