1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", EntryPoint = "SendMessage", SetLastError = true)]
static extern IntPtr SendMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam);
const int WM_COMMAND = 0x111;
const int MIN_ALL = 419;
const int MIN_ALL_UNDO = 416;
static void Main(string[] args)
{
IntPtr lHwnd = FindWindow("Shell_TrayWnd", null);
SendMessage(lHwnd, WM_COMMAND, (IntPtr)MIN_ALL, IntPtr.Zero);
//System.Threading.Thread.Sleep(2000);
//SendMessage(lHwnd, WM_COMMAND, (IntPtr)MIN_ALL_UNDO, IntPtr.Zero);
}
|
cs |
'프로그래밍 > └ .NET' 카테고리의 다른 글
[C#] WPF ShutdownMode (0) | 2020.02.28 |
---|---|
[C#] 다른 Thread에서 UI Thread 접근 (0) | 2020.02.24 |
[C#] Pipe 통신 (0) | 2020.02.21 |
[C#] 응용프로그램 실행 시 관리자권한 요청하게 하기 (0) | 2020.02.14 |
[C#] Windows Service에서 현재 유저의 관리자 권한으로 프로세스 실행 (0) | 2020.02.11 |