Mercurial > dwindows
comparison win/dw.c @ 1910:000a94a1ddc1
Fix a couple issues revealed by upgrading to Visual Studion 2015...
Fixed a problem with wide strings via _snprintf() in dw_window_get_font().
Fixed a problem on x64 with dw_named_memory_new() by using constant.
Added compatibility info to the manifests to support Windows 10.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 06 Oct 2015 02:56:46 +0000 |
parents | cb5f9aa9aebb |
children | 102fca5f2e19 |
comparison
equal
deleted
inserted
replaced
1909:cb5f9aa9aebb | 1910:000a94a1ddc1 |
---|---|
2859 DeleteObject(thiscinfo->hbrush); | 2859 DeleteObject(thiscinfo->hbrush); |
2860 thiscinfo->hbrush = CreateSolidBrush(RGB(DW_RED_VALUE(back), | 2860 thiscinfo->hbrush = CreateSolidBrush(RGB(DW_RED_VALUE(back), |
2861 DW_GREEN_VALUE(back), | 2861 DW_GREEN_VALUE(back), |
2862 DW_BLUE_VALUE(back))); | 2862 DW_BLUE_VALUE(back))); |
2863 SelectObject((HDC)mp1, thiscinfo->hbrush); | 2863 SelectObject((HDC)mp1, thiscinfo->hbrush); |
2864 return (LONG)(intptr_t)thiscinfo->hbrush; | 2864 return (LRESULT)(intptr_t)thiscinfo->hbrush; |
2865 } | 2865 } |
2866 } | 2866 } |
2867 #ifdef AEROGLASS | 2867 #ifdef AEROGLASS |
2868 switch(msg) | 2868 switch(msg) |
2869 { | 2869 { |
2880 SetBkColor((HDC)mp1, _dw_transparencykey); | 2880 SetBkColor((HDC)mp1, _dw_transparencykey); |
2881 if(thiscinfo->hbrush) | 2881 if(thiscinfo->hbrush) |
2882 DeleteObject(thiscinfo->hbrush); | 2882 DeleteObject(thiscinfo->hbrush); |
2883 thiscinfo->hbrush = CreateSolidBrush(_dw_transparencykey); | 2883 thiscinfo->hbrush = CreateSolidBrush(_dw_transparencykey); |
2884 SelectObject((HDC)mp1, thiscinfo->hbrush); | 2884 SelectObject((HDC)mp1, thiscinfo->hbrush); |
2885 return (LONG)thiscinfo->hbrush; | 2885 return (LRESULT)thiscinfo->hbrush; |
2886 } | 2886 } |
2887 } | 2887 } |
2888 } | 2888 } |
2889 } | 2889 } |
2890 #endif | 2890 #endif |
4899 bold = " Bold"; | 4899 bold = " Bold"; |
4900 if ( lf.lfItalic ) | 4900 if ( lf.lfItalic ) |
4901 italic = " Italic"; | 4901 italic = " Italic"; |
4902 height = MulDiv(abs(lf.lfHeight), 72, GetDeviceCaps (hdc, LOGPIXELSY)); | 4902 height = MulDiv(abs(lf.lfHeight), 72, GetDeviceCaps (hdc, LOGPIXELSY)); |
4903 ReleaseDC(handle, hdc); | 4903 ReleaseDC(handle, hdc); |
4904 _snprintf( str, 100, "%d.%s%s%s", height, lf.lfFaceName, bold, italic ); | 4904 _snprintf( str, 100, "%d.%s%s%s", height, WideToUTF8(lf.lfFaceName), bold, italic ); |
4905 } | 4905 } |
4906 } | 4906 } |
4907 if ( oldfont ) | 4907 if ( oldfont ) |
4908 DeleteObject( oldfont ); | 4908 DeleteObject( oldfont ); |
4909 return str; | 4909 return str; |
11308 | 11308 |
11309 sa.nLength = sizeof(SECURITY_ATTRIBUTES); | 11309 sa.nLength = sizeof(SECURITY_ATTRIBUTES); |
11310 sa.lpSecurityDescriptor = &_dwsd; | 11310 sa.lpSecurityDescriptor = &_dwsd; |
11311 sa.bInheritHandle = FALSE; | 11311 sa.bInheritHandle = FALSE; |
11312 | 11312 |
11313 handle = CreateFileMapping((HANDLE)0xFFFFFFFF, &sa, PAGE_READWRITE, 0, size, UTF8toWide(name)); | 11313 handle = CreateFileMapping(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE, 0, size, UTF8toWide(name)); |
11314 | 11314 |
11315 if(!handle) | 11315 if(!handle) |
11316 return 0; | 11316 return 0; |
11317 | 11317 |
11318 *dest = MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, 0); | 11318 *dest = MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, 0); |