In c# winforms I have created a click through form using the code I found from this question. The code is below:
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string IpClassName, string IpWindowName);
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", SetLastError = true)]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetWindowRect(IntPtr hwnd, out RECT IpRect);
public static RECT rect;
public struct RECT
{
public int left, top, right, bottom;
}
private void Form1_Shown(object sender, EventArgs e)
{
int initialStyle = GetWindowLong(this.Handle, -20);
SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20);
}
However, In the answers there was no explicit description on how to undo this change with code, to make the form clickable again. I was wondering if anyone knew how to do that.