Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
If SHGFI_USEFILEATTRIBUTES is specified, it is supposed to return the default .exe icon if the supplied path does not exist or if the .exe does not have embedded icons.
static void MakeIconWindow(LPCWSTR path, UINT att, UINT flags) |
{
|
SHFILEINFO fi;
|
if (SHGetFileInfoW(path, att, &fi, sizeof(fi), SHGFI_ICON|SHGFI_SMALLICON|SHGFI_SHELLICONSIZE|flags)) |
{
|
static int x = 0; |
HWND hWnd = CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_APPWINDOW, TEXT("STATIC"), path, SS_ICON|SS_REALSIZEIMAGE|WS_POPUP|WS_VISIBLE, x, 0, 32, 32, 0, 0, 0, 0); |
SendMessage(hWnd, STM_SETIMAGE, IMAGE_ICON, (LPARAM) fi.hIcon); |
x += 32;
|
}
|
}
|
static void Bug() |
{
|
WCHAR path[MAX_PATH]; |
lstrcatW(path+GetSystemDirectory(path, MAX_PATH), L"\\ping.exe"); // a real exe without embedded icon |
MakeIconWindow(path, 0, 0);
|
MakeIconWindow(L"doesnotexist.exe", 0, SHGFI_USEFILEATTRIBUTES); // .exe icon |
MakeIconWindow(L"doesnotexist", 0, SHGFI_USEFILEATTRIBUTES); // default file icon |
MessageBoxA(0, "Stop?", 0, 0); |
}
|
This might be a Wine bug.
Attachments
Issue Links
- relates to
-
CORE-19117 "Open with..." shows wrong icon for files not present
- Reopened