private void RegisterClass() { var wc = new WindowClassEx { Size = WindowClassEx.SizeInBytes, Style = WindowClassStyle.HRedraw|WindowClassStyle.VRedraw|WindowClassStyle.OwnDC, WndProc = WindowProcedure, Instance = _instance, ClassName = _className, Cursor = User32.LoadCursor(CursorName.Arrow) }; if (User32.RegisterClassEx(ref wc) == 0) throw new Exception(String.Format("Failed to reg class. Error: {0}", Marshal.GetLastWin32Error())); }
public static extern ushort RegisterClassEx(ref WindowClassEx windowClass);