Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I've gotten an error "0x3b02 User stopped resource enumeration." while I used the ExtractIcon #79

Open
Huaxink opened this issue Jan 10, 2018 · 1 comment

Comments

@Huaxink
Copy link

Huaxink commented Jan 10, 2018

w32/shell32.go

Line 146 in 9a4ee0f

func ExtractIcon(lpszExeFileName string, nIconIndex int) HICON {

I just want to get other exe-file icon bytes, but I've gotten the error "0x3b02 User stopped resource enumeration." while I used the ExtractIcon. I have not found out any effective answer by google.

Well, I used the api in my local application built by electron.
4
5

Any idea about this?
Thank you!

@gonutz
Copy link

gonutz commented Apr 23, 2020

Working with the syscall package I have found that it is safer to only use the first of the three return values of Call. In your example you check the err in

ret, _, err := procExtractIcon.Call(

but just ignore that and interpret the ret value according the the MSDN docs. This is the result that the function gives you and it usually contains everything you need to know. I have found in the past that the err might be set but really the function did not fail. I think this is some global error code that might be set by some other function as well and is not reset or something along those lines.

Your link to the code does not actually use the err value anymore which supports my point. It seems to not work for others either.

If you want to use my actively supported fork of this repo, here it is:

https://github.com/gonutz/w32

It does not contain ExtractIcon currently but if you still want that, just create an issue and I will be happy to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants