hi, i want to redraw winform titlebar and borderframe in c#,the size ofvisible draw regionwas changedwhen i call winapi SetWinodowLong,rigth border and bottom was drawn black color or not drawn on,why & how to fix it. code fragmentas follows:
// test segment
IntPtr hWnd = this.Handle;
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
int num1 = WinApi.GetWindowLong(hWnd, WinApi.GWL_EXSTYLE);
num1 |= AlphaBlend.WS_EX_LAYERED;
WinApi.SetWindowLong(hWnd, WinApi.GWL_EXSTYLE, num1);
WinApi.SetLayeredWindowAttributes(hWnd, 0, 255, WinApi.LWA_ALPHA);
WinApi.SetWindowPos(hWnd, (IntPtr)(0), 0, 0, this.Width, this.Height, 9);
//........
IntPtr hDC = WinApi.GetWindowDC(this.Handle);
Graphics g = Graphics.FromHdc(hDC);
g.DrawImage(bmp, new Point(0, 0)); //g.VisibleClipBounds width and height is redueced scale