-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNativeMethods.cs
More file actions
33 lines (24 loc) · 1.19 KB
/
Copy pathNativeMethods.cs
File metadata and controls
33 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Runtime.InteropServices;
namespace Yotepad
{
internal static class NativeMethods
{
[DllImport("dwmapi.dll")]
public static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
public const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DestroyIcon(IntPtr hIcon);
[DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
public static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string? pszSubIdList);
[DllImport("uxtheme.dll", EntryPoint = "#135")]
public static extern int SetPreferredAppMode(int preferredAppMode);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth, int nHeight);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool ShowCaret(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool DestroyCaret();
}
}