46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace AudioWallpaper {
|
|
public static class Win32 {
|
|
[DllImport("user32.dll")]
|
|
public static extern IntPtr FindWindow(string className, string winName);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern IntPtr SendMessageTimeout(IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam, uint fuFlage, uint timeout, IntPtr result);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern bool EnumWindows(EnumWindowsProc proc, IntPtr lParam);
|
|
public delegate bool EnumWindowsProc(IntPtr hwnd, IntPtr lParam);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string className, string winName);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern bool ShowWindow(IntPtr hwnd, int nCmdShow);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern IntPtr SetParent(IntPtr hwnd, IntPtr parentHwnd);
|
|
[DllImport("shell32.dll")]
|
|
public static extern uint SHAppBarMessage(uint dwMessage, ref APPBARDATA pData);
|
|
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
|
|
public static extern uint RegisterWindowMessage(string lpString);
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct APPBARDATA {
|
|
public int cbSize;
|
|
public IntPtr hWnd;
|
|
public uint uCallbackMessage;
|
|
public uint uEdge;
|
|
public RECT rc;
|
|
public int lParam;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct RECT {
|
|
public int left;
|
|
public int top;
|
|
public int right;
|
|
public int bottom;
|
|
}
|
|
}
|
|
}
|