diff --git a/trunk/ProcessHacker.Native/Api/Functions.cs b/trunk/ProcessHacker.Native/Api/Functions.cs
index cc20a37c3..bf1809da9 100644
--- a/trunk/ProcessHacker.Native/Api/Functions.cs
+++ b/trunk/ProcessHacker.Native/Api/Functions.cs
@@ -2332,7 +2332,7 @@ namespace ProcessHacker.Native.Api
);
[DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- public static extern int SetWindowTheme(
+ public static extern HResult SetWindowTheme(
[In] IntPtr hWnd,
[In] string appName,
[In] string idList
diff --git a/trunk/ProcessHacker/Common/PhUtils.cs b/trunk/ProcessHacker/Common/PhUtils.cs
index eb1a52bc8..0028216d2 100644
--- a/trunk/ProcessHacker/Common/PhUtils.cs
+++ b/trunk/ProcessHacker/Common/PhUtils.cs
@@ -314,7 +314,8 @@ namespace ProcessHacker.Common
/// A name of a theme.
public static void SetTheme(this Control control, string theme)
{
- Win32.SetWindowTheme(control.Handle, theme, null);
+ HResult setWindowThemeResult = Win32.SetWindowTheme(control.Handle, theme, null);
+ setWindowThemeResult.ThrowIf();
}
///
diff --git a/trunk/ProcessHacker/Components/ExtendedListView.cs b/trunk/ProcessHacker/Components/ExtendedListView.cs
index f5d09424e..629df414f 100644
--- a/trunk/ProcessHacker/Components/ExtendedListView.cs
+++ b/trunk/ProcessHacker/Components/ExtendedListView.cs
@@ -163,7 +163,9 @@ namespace ProcessHacker
{
case 0x1: /*WM_CREATE*/
{
- Win32.SetWindowTheme(this.Handle, "explorer", null);
+ HResult setThemeResult = Win32.SetWindowTheme(this.Handle, "explorer", null);
+ setThemeResult.ThrowIf();
+
Win32.SendMessage(this.Handle, (WindowMessage)LVM_SetExtendedListViewStyle, LVS_Ex_DoubleBuffer, LVS_Ex_DoubleBuffer);
break;
}
diff --git a/trunk/ProcessHacker/Components/ExtendedTreeView.cs b/trunk/ProcessHacker/Components/ExtendedTreeView.cs
index 70c84107e..53a9d11b2 100644
--- a/trunk/ProcessHacker/Components/ExtendedTreeView.cs
+++ b/trunk/ProcessHacker/Components/ExtendedTreeView.cs
@@ -41,7 +41,8 @@ public class VistaTreeView : System.Windows.Forms.TreeView
if (OSVersion.IsAboveOrEqual(WindowsVersion.Vista))
{
Win32.SendMessage(this.Handle, (WindowMessage)TVM_SETEXTENDEDSTYLE, 0, TVS_EX_FADEINOUTEXPANDOS);
- Win32.SetWindowTheme(this.Handle, "explorer", null);
+ HResult setThemeResult = Win32.SetWindowTheme(this.Handle, "explorer", null);
+ setThemeResult.ThrowIf();
}
base.OnHandleCreated(e);
}
diff --git a/trunk/ProcessHacker/Components/TaskbarLib/Interop/Interop.cs b/trunk/ProcessHacker/Components/TaskbarLib/Interop/Interop.cs
index c5b237755..dee0a96e6 100644
--- a/trunk/ProcessHacker/Components/TaskbarLib/Interop/Interop.cs
+++ b/trunk/ProcessHacker/Components/TaskbarLib/Interop/Interop.cs
@@ -174,7 +174,7 @@ namespace TaskbarLib.Interop
private CALPWSTR calpwstr;
[DllImport("ole32.dll")]
- private static extern int PropVariantClear(ref PropVariant pvar);
+ private static extern HResult PropVariantClear(ref PropVariant pvar);
public VarEnum VarType
{
@@ -202,7 +202,8 @@ namespace TaskbarLib.Interop
public void Clear()
{
- PropVariantClear(ref this);
+ HResult clearResult = PropVariantClear(ref this);
+ clearResult.ThrowIf();
}
public void Dispose()