Hi,
This is a follow-up issue of #645 (comment).
I played with the code a little bit:
var ICCE: INITCOMMONCONTROLSEX =
INITCOMMONCONTROLSEX(dwSize: DWORD(MemoryLayout<INITCOMMONCONTROLSEX>.size),
dwICC: dwICC)
if !InitCommonControlsEx(&ICCE) {
log.error("InitCommonControlsEx: \(Error(win32: GetLastError()))")
}
I found 2 results:
- if
mt tool is not called (no manifest file), InitCommonControlsEx will fail but GetLastError() is 0 (no error), in this case, there will be a very confusing log like this: error message of no errors:
error org.compnerd.swift-win32 : [SwiftWin32] InitCommonControlsEx: Win32 Error 0 - The operation completed successfully.
If mt tool is called, the error message is gone.
- Only
ICC_STANDARD_CLASSES causes the issue 1) above, if ICC_STANDARD_CLASSES is not used at all, mt does not matter, InitCommonControlsEx will always succeed.
By its name, ICC_STANDARD_CLASSES seems to have effects on buttons at lease, but at least to "UICatalog" UI, all controls including buttons are initialized correctly without ICC_STANDARD_CLASSES.
So maybe we can remove ICC_STANDARD_CLASSES? It will make InitCommonControlsEx to always succeed (with or without mt)
and have no bad effect on the buttons and other controls.
Hi,
This is a follow-up issue of #645 (comment).
I played with the code a little bit:
I found 2 results:
mttool is not called (no manifest file),InitCommonControlsExwill fail butGetLastError()is 0 (no error), in this case, there will be a very confusing log like this: error message of no errors:If
mttool is called, the error message is gone.ICC_STANDARD_CLASSEScauses the issue 1) above, ifICC_STANDARD_CLASSESis not used at all,mtdoes not matter,InitCommonControlsExwill always succeed.By its name,
ICC_STANDARD_CLASSESseems to have effects on buttons at lease, but at least to "UICatalog" UI, all controls including buttons are initialized correctly withoutICC_STANDARD_CLASSES.So maybe we can remove
ICC_STANDARD_CLASSES? It will makeInitCommonControlsExto always succeed (with or withoutmt)and have no bad effect on the buttons and other controls.