Open Huaxink opened 6 years ago
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:
It does not contain ExtractIcon
currently but if you still want that, just create an issue and I will be happy to add it.
https://github.com/AllenDang/w32/blob/9a4ee0f7d224efbff75947fa7060daadccc4741c/shell32.go#L146
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.
Any idea about this? Thank you!