Advertisement
HaLo2FrEeEk

WndProc override

Jan 8th, 2011
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. protected override void WndProc(ref Message m)
  2. {
  3.     base.WndProc(ref m);
  4.  
  5.     switch (m.Msg)
  6.     {
  7.         case 0x1:
  8.             Rectangle recClient = RectangleToScreen(ClientRectangle);
  9.             SetWindowPos(m.HWnd, IntPtr.Zero, recClient.Left, recClient.Top, recClient.Width, recClient.Height, 0x0020);
  10.             break;
  11.         case 0x83:
  12.             NCCALCSIZE_PARAMS p = (NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(NCCALCSIZE_PARAMS));
  13.             p.rgrc[0].left = p.rgrc[0].left + 0;
  14.             p.rgrc[0].top = p.rgrc[0].top + 0;
  15.             p.rgrc[0].right = p.rgrc[0].right - 0;
  16.             p.rgrc[0].bottom = p.rgrc[0].bottom - 0;
  17.  
  18.             m.Result = IntPtr.Zero;
  19.             break;
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement