okay fixed this my self after finding the right imports...
EDIT:
Source code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace border_removal_test
{
public partial class Form1 : Form
{
[DllImport("USER32.DLL")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
[DllImport("user32.dll")]
static extern bool DrawMenuBar(IntPtr hWnd);
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags);
private readonly string WINDOW_NAME = "Form1";
private const int GWL_STYLE = -16;
private const int WS_BORDER = 0x00800000;
private const int WS_CAPTION = 0x00C00000;
private const int WS_SYSMENU = 0x00080000;
private const int WS_MINIMIZEBOX = 0x00020000;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
IntPtr window = FindWindowByCaption(IntPtr.Zero, WINDOW_NAME);
SetWindowLong(window, GWL_STYLE, WS_SYSMENU);
SetWindowPos(window, -2, 0, 0, 800, 600, 0x0040);
DrawMenuBar(window);
}
private void button2_Click(object sender, EventArgs e)
{
IntPtr window = FindWindowByCaption(IntPtr.Zero, WINDOW_NAME);
SetWindowLong(window, GWL_STYLE, WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX);
this.WindowState = FormWindowState.Normal;
DrawMenuBar(window);
}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
a simple google search on each import function will let you know how they works...