diff --git a/Contrib/nsDialogs/Readme.html b/Contrib/nsDialogs/Readme.html index ad03ec1d..d2cb359e 100644 --- a/Contrib/nsDialogs/Readme.html +++ b/Contrib/nsDialogs/Readme.html @@ -57,7 +57,7 @@ abbr { font-variant: none; cursor: help; }
  • NSD_OnBack, NSD_OnChange, NSD_OnClick, NSD_OnNotify
  • NSD_SetFocus
  • NSD_CreateTimer, NSD_KillTimer
  • -
  • NSD_AddStyle, NSD_AddExStyle
  • +
  • NSD_AddStyle, NSD_AddExStyle, NSD_RemoveStyle, NSD_RemoveExStyle
  • NSD_GetText, NSD_SetText
  • Text, Password & Number: NSD_Edit_SetTextLimit, @@ -598,6 +598,14 @@ SectionEnd

    Adds one or more extended window styles to a control. Multiple styles should be separated with pipes `|'.

    See MSDN for style descriptions.

    +

    NSD_RemoveStyle

    +

    ${NSD_RemoveStyle} control_HWND style

    +

    Removes one or more window styles from a control.

    + +

    NSD_RemoveExStyle

    +

    ${NSD_RemoveExStyle} control_HWND style

    +

    Removes one or more extended window styles from a control.

    +

    NSD_GetText

    ${NSD_GetText} control_HWND $output_variable

    Retrieves the text of a control and stores it into output_variable. Especially useful for textual controls.

    diff --git a/Contrib/nsDialogs/nsDialogs.nsh b/Contrib/nsDialogs/nsDialogs.nsh index 671f8e6f..55d6168b 100644 --- a/Contrib/nsDialogs/nsDialogs.nsh +++ b/Contrib/nsDialogs/nsDialogs.nsh @@ -481,6 +481,15 @@ System::Call 'COMCTL32::InitCommonControlsEx(*ls)' ; INITCOMMONCONTROLSEX as UIN System::Call "user32::SetWindowLong(p${HWND},p${GWL},ps)" !macroend +!define NSD_RemoveStyle "!insertmacro _NSD_GWLRemoveFlags ${GWL_STYLE} " +!define NSD_RemoveExStyle "!insertmacro _NSD_GWLRemoveFlags ${GWL_EXSTYLE} " +!macro _NSD_GWLRemoveFlags GWL HWND DATA +System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s" +System::Int64Op "${DATA}" ~ & ; Perform ~ and prepare the stack for & +System::Int64Op ; Perform & +System::Call "user32::SetWindowLong(p${HWND},i${GWL},ps)" +!macroend + !define NSD_GetStyle "!insertmacro _NSD_GWLGetFlags ${GWL_STYLE} " !define NSD_GetExStyle "!insertmacro _NSD_GWLGetFlags ${GWL_EXSTYLE} " !macro _NSD_GWLGetFlags GWL HWND RET diff --git a/Include/WinMessages.nsh b/Include/WinMessages.nsh index 08c038aa..eab4b5d7 100644 --- a/Include/WinMessages.nsh +++ b/Include/WinMessages.nsh @@ -46,6 +46,7 @@ TBM Track bar UDM Up-down control HKM Hot key control IPM IP address control +NCM Network address control ----------------------------------- NOT included messages (WM_USER + X) @@ -823,5 +824,11 @@ ${_NSIS_DEFAW} ACM_OPEN !define /math IPM_SETFOCUS ${WM_USER} + 104 !define /math IPM_ISBLANK ${WM_USER} + 105 +#NetworkAddress control# +!define /math NCM_GETADDRESS ${WM_USER} + 1 ; Vista+ +!define /math NCM_SETALLOWTYPE ${WM_USER} + 2 +!define /math NCM_GETALLOWTYPE ${WM_USER} + 3 +!define /math NCM_DISPLAYERRORTIP ${WM_USER} + 4 + !verbose pop !endif \ No newline at end of file diff --git a/Source/BinInterop.h b/Source/BinInterop.h index 5b8c20ab..a65a8c35 100644 --- a/Source/BinInterop.h +++ b/Source/BinInterop.h @@ -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); diff --git a/Source/ResourceEditor.cpp b/Source/ResourceEditor.cpp index 1fd45cb0..d54062a2 100644 --- a/Source/ResourceEditor.cpp +++ b/Source/ResourceEditor.cpp @@ -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 diff --git a/Source/util.cpp b/Source/util.cpp index ba194c1c..fed50407 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -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;