Mercurial > dwindows
comparison win/dw.c @ 1842:123d1a900f54
More MINGW cleanups... eliminate a few more warnings and disable the unused-value warning due to unfixable warnings generated by the Win32 macros.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 20 Nov 2012 20:42:06 +0000 |
parents | 22225eb286e5 |
children | 905f8632005b |
comparison
equal
deleted
inserted
replaced
1841:7677754a1ca5 | 1842:123d1a900f54 |
---|---|
1863 char *utf8 = NULL, ch[2] = {0}; | 1863 char *utf8 = NULL, ch[2] = {0}; |
1864 #ifdef UNICODE | 1864 #ifdef UNICODE |
1865 WCHAR uc[2] = { 0 }; | 1865 WCHAR uc[2] = { 0 }; |
1866 | 1866 |
1867 uc[0] = (WCHAR)mp1; | 1867 uc[0] = (WCHAR)mp1; |
1868 utf8 = WideToUTF8(uc); | 1868 utf8 = WideToUTF8(&uc[0]); |
1869 #endif | 1869 #endif |
1870 | 1870 |
1871 if(GetAsyncKeyState(VK_SHIFT) & 0x8000) | 1871 if(GetAsyncKeyState(VK_SHIFT) & 0x8000) |
1872 special |= KC_SHIFT; | 1872 special |= KC_SHIFT; |
1873 if(GetAsyncKeyState(VK_CONTROL) & 0x8000) | 1873 if(GetAsyncKeyState(VK_CONTROL) & 0x8000) |
9172 */ | 9172 */ |
9173 int _lookup_icon(HWND handle, HICON hicon, int type) | 9173 int _lookup_icon(HWND handle, HICON hicon, int type) |
9174 { | 9174 { |
9175 int z; | 9175 int z; |
9176 static HWND lasthwnd = NULL; | 9176 static HWND lasthwnd = NULL; |
9177 HIMAGELIST himl; | |
9178 | 9177 |
9179 /* We can't add an invalid handle */ | 9178 /* We can't add an invalid handle */ |
9180 if(!hicon) | 9179 if(!hicon) |
9181 return -1; | 9180 return -1; |
9182 | 9181 |
9192 lookup[z] = hicon; | 9191 lookup[z] = hicon; |
9193 ImageList_AddIcon(hSmall, hicon); | 9192 ImageList_AddIcon(hSmall, hicon); |
9194 ImageList_AddIcon(hLarge, hicon); | 9193 ImageList_AddIcon(hLarge, hicon); |
9195 if(type) | 9194 if(type) |
9196 { | 9195 { |
9197 himl = TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL); | 9196 TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL); |
9198 } | 9197 } |
9199 else | 9198 else |
9200 { | 9199 { |
9201 himl = ListView_SetImageList(handle, hSmall, LVSIL_SMALL); | 9200 ListView_SetImageList(handle, hSmall, LVSIL_SMALL); |
9202 himl = ListView_SetImageList(handle, hLarge, LVSIL_NORMAL); | 9201 ListView_SetImageList(handle, hLarge, LVSIL_NORMAL); |
9203 } | 9202 } |
9204 lasthwnd = handle; | 9203 lasthwnd = handle; |
9205 return z; | 9204 return z; |
9206 } | 9205 } |
9207 | 9206 |
9209 { | 9208 { |
9210 if(lasthwnd != handle) | 9209 if(lasthwnd != handle) |
9211 { | 9210 { |
9212 if(type) | 9211 if(type) |
9213 { | 9212 { |
9214 himl = TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL); | 9213 TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL); |
9215 } | 9214 } |
9216 else | 9215 else |
9217 { | 9216 { |
9218 himl = ListView_SetImageList(handle, hSmall, LVSIL_SMALL); | 9217 ListView_SetImageList(handle, hSmall, LVSIL_SMALL); |
9219 himl = ListView_SetImageList(handle, hLarge, LVSIL_NORMAL); | 9218 ListView_SetImageList(handle, hLarge, LVSIL_NORMAL); |
9220 } | 9219 } |
9221 lasthwnd = handle; | 9220 lasthwnd = handle; |
9222 } | 9221 } |
9223 return z; | 9222 return z; |
9224 } | 9223 } |