Added NSD_Remove[Ex]Style and NCM_* messages

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7086 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2019-02-15 20:19:27 +00:00
parent 7a6c9e52b0
commit 217f250466
6 changed files with 28 additions and 3 deletions

View file

@ -31,6 +31,7 @@ typedef struct {
UINT32 Width, Height;
INT32 RawHeight;
WORD BPP, Planes;
bool IsTopDownBitmap() const { return Height != (UINT32) RawHeight; }
} GENERICIMAGEINFO;
DWORD GetDIBHeaderInfo(const void*pData, size_t DataSize, GENERICIMAGEINFO&Info);

View file

@ -770,7 +770,7 @@ bool CResourceEditor::AddExtraIconFromFile(const WINWCHAR* Type, WINWCHAR* Name,
GENERICIMAGEINFO info;
if (/*!IsPNGFile(pImg, imgSize, &info) &&*/ !GetDIBHeaderInfo(pImg, imgSize, info)) // Are PNG cursor images allowed?
goto fail;
//if (info.RawHeight != info.Height && isDib)
//if (info.IsTopDownBitmap() && isDib)
// goto fail; // Are TopDown DIBs allowed? Probably not but we play it safe.
typedef struct { WORD x, y; } CURSORIMGHDR; //msdn.microsoft.com/en-us/library/windows/desktop/ms648017(v=vs.85).aspx

View file

@ -146,7 +146,7 @@ int update_bitmap(CResourceEditor* re, WORD id, const TCHAR* filename, int width
signed char hdr[14+124], retval = -2;
size_t size = fread(hdr, 1, sizeof(hdr), f);
GENERICIMAGEINFO info;
if (IsBMPFile(hdr, size, &info) && 0 == fseek(f, 0, SEEK_SET) && info.Height == info.RawHeight)
if (IsBMPFile(hdr, size, &info) && 0 == fseek(f, 0, SEEK_SET) && !info.IsTopDownBitmap())
{
if ((width && width != (int) info.Width) || (height && height != (int) info.Height))
retval = -3;