Created
May 26, 2023 17:42
-
-
Save puppis42/8e6c0c022f5b38d3e26e95c00291c151 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace Hide | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
[DllImport("user32.dll")] | |
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); | |
[DllImport("user32.dll", SetLastError = true)] | |
static extern IntPtr FindWindowEx(IntPtr hwndParent, | |
IntPtr hwndChildAfter, string lpszClass, string lpszWindow); | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null); | |
ShowWindow(hWnd, 0); | |
} | |
private void button2_Click(object sender, EventArgs e) | |
{ | |
IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null); | |
ShowWindow(hWnd, 5); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment