Dear Sir,
I have an error like this "Cannot implicitly convert type 'bool' to 'int' in C#", please guide me
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
private static bool IsWindows10OrGreater(int build = -1)
{
return true;
}
private static bool UseImmersiveDarkMode(IntPtr handle, bool enabled)
{
try
{
if (Form1.IsWindows10OrGreater(17763))
{
int num = 19;
if (Form1.IsWindows10OrGreater(18985))
{
num = 20;
}
int num1 = enabled;
bool flag = Form1.DwmSetWindowAttribute(handle, num, ref num1, 4) == 0;
return flag;
}
}
catch (Exception exception)
{
}
return false;
}
}
}