question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[UxTheme.dll] GetThemeBitmap function is outdated

See original GitHub issue

Hello, according to the MSDN, the GetThemeBitmap pinvoke is outdated.

Probably there are more functions that don’t need the hDc argument.

According to the MSDN:

HRESULT GetThemeBitmap(
  _In_  HTHEME  hTheme,
  _In_  int     iPartId,
  _In_  int     iStateId,
  _In_  int     iPropId,
  _In_  ULONG   dwFlags,
  _Out_ HBITMAP *phBitmap
);

Your P/Invoke:

HRESULT GetThemeBitmap(
  UxTheme.SafeThemeHandle hTheme,
  Gdi32.SafeDCHandle hdc,
  int iPartId,
  int iStateId,
  int iPropId,
  int dwFlags,
  out IntPtr phBitmap
);

When running the code, this can be confirmed by Visual Sudio’s Managed Debugging Assistant:

Managed Debugging Assistant 'PInvokeStackImbalance' :
'A call to PInvoke function 'Vanara.PInvoke.UxTheme!Vanara.PInvoke.UxTheme::GetThemeBitmap' has unbalanced the stack.
This is likely because the managed PInvoke signature does not match the unmanaged target signature.
Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'

Thank you for the time you put to make this project into something really good and usable.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dahallcommented, Jun 27, 2018

Took a few days, but the update (1.0.15) is now available on NuGet. Thanks for pushing me to fully unit test this module.

0reactions
NickAcPTcommented, Jun 27, 2018

I’m the one that needs to thank your for this amazing project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 DLL File Information - uxtheme.dll
This means that when uxtheme.dll is loaded, the above files are automatically loaded too. If one of these files is corrupted or missing,...
Read more >
GetThemeBitmap function (uxtheme.h) - Win32 apps
Retrieves the bitmap associated with a particular theme, part, state, and property.
Read more >
Windows 8 DLL File Information - uxtheme.dll
This means that when uxtheme.dll is loaded, the above files are automatically loaded too. If one of these files is corrupted or missing,...
Read more >
Blank Desktop after trying to Change Theme, missing ...
After getting the new dll from withinwindows.com (under the windows vista SP0 pack) i went into my system32 folder, then changed my original...
Read more >
Uxtheme.dll: What It Is & How To Fix Errors
Uxtheme.dll: What It Is & How To Fix Errors · 1. Run the DISM and SFC scans · 2. Check for faulty software....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found