public DefaultForm(WindowClassStyle classStyle, WindowsExtendedStyle dwStyleEx, string title, WindowStyles windowStyle, int left, int top, int winWidth, int winHeight, Control parentHWnd) { this._classStyle = classStyle; this._dwStyleEx = dwStyleEx; this._windowStyle = windowStyle; this.Text = title; SuspendLayout(); BackColor = Color.Black; Name = title; Left = left; Top = top; Width = winWidth; Height = winHeight; if (parentHWnd != null) { Parent = parentHWnd; } Load += _defaultFormLoad; Deactivate += _defaultFormDeactivate; Activated += _defaultFormActivated; Closing += _defaultFormClose; Resize += _defaultFormResize; Cursor.Hide(); ResumeLayout(false); }
public DefaultForm( WindowClassStyle classStyle, WindowsExtendedStyle dwStyleEx, string title, WindowStyles windowStyle, int left, int top, int winWidth, int winHeight, Control parentHWnd ) { _classStyle = classStyle; _dwStyleEx = dwStyleEx; _windowStyle = windowStyle; SuspendLayout(); AutoScaleBaseSize = new System.Drawing.Size(5, 13); BackColor = System.Drawing.Color.Black; ClientSize = new System.Drawing.Size(640, 480); Name = title; Left = left; Top = top; Width = winWidth; Height = winHeight; if (parentHWnd != null) Parent = parentHWnd; Load += DefaultFormLoad; Deactivate += DefaultFormDeactivate; Activated += DefaultFormActivated; Closing += DefaultFormClose; Resize += DefaultFormResize; ResumeLayout(false); }
[DllImport("user32", EntryPoint="CreateWindowEx", CharSet=CharSet.Auto, ExactSpelling=false, CallingConvention = CallingConvention.Winapi)] //Auto public static extern IntPtr CreateWindowExA(WindowsExtendedStyle dwExStyle, string lpszClassName, string lpszWindowName, WindowStyle style, int x, int y, int width, int height, IntPtr hWndParent, IntPtr hMenu, IntPtr hInst, IntPtr pvParam);
public static extern bool AdjustWindowRectEx(ref RECT lpRect, WindowStyle dwStyle, [MarshalAs(UnmanagedType.Bool)] bool bMenu, WindowsExtendedStyle dwExStyle);
public static extern int SetWindowLongA( IntPtr hWnd, SetWindowLongType nIndex, WindowsExtendedStyle dwNewLong);
public DefaultForm( WindowClassStyle classStyle, WindowsExtendedStyle dwStyleEx, string title, WindowStyles windowStyle, int left, int top, int winWidth, int winHeight, Control parentHWnd ) { this._classStyle = classStyle; this._dwStyleEx = dwStyleEx; this._windowStyle = windowStyle; SuspendLayout(); BackColor = Color.Black; Name = title; Left = left; Top = top; Width = winWidth; Height = winHeight; if ( parentHWnd != null ) { Parent = parentHWnd; } Load += _defaultFormLoad; Deactivate += _defaultFormDeactivate; Activated += _defaultFormActivated; Closing += _defaultFormClose; Resize += _defaultFormResize; Cursor.Hide(); ResumeLayout( false ); }