Try to avoid clobbering SysLink GWLP_USERDATA
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6949 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
dda1998421
commit
bcef923727
6 changed files with 18 additions and 6 deletions
|
@ -9,6 +9,7 @@ b { color: red; }
|
||||||
code { margin-left: 1.2em; padding: 0.5em; background-color: #f0f0f0; }
|
code { margin-left: 1.2em; padding: 0.5em; background-color: #f0f0f0; }
|
||||||
span.inlcod i { padding: 0px 0.2em; color: #222222; font-family: monospace; font-style: normal; }
|
span.inlcod i { padding: 0px 0.2em; color: #222222; font-family: monospace; font-style: normal; }
|
||||||
blockquote pre { background-color: #fcfcfc; font-family: monospace; }
|
blockquote pre { background-color: #fcfcfc; font-family: monospace; }
|
||||||
|
abbr { font-variant: none; cursor: help; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -550,7 +551,7 @@ SectionEnd</pre></blockquote>
|
||||||
<li>${NSD_CreateVTrackBar}</li>
|
<li>${NSD_CreateVTrackBar}</li>
|
||||||
<li>${NSD_CreateUpDown}</li>
|
<li>${NSD_CreateUpDown}</li>
|
||||||
<li>${NSD_CreateHotKey}</li>
|
<li>${NSD_CreateHotKey}</li>
|
||||||
<li>${NSD_CreateIPAddress} <small>(Requires IE4)</small></li>
|
<li>${NSD_CreateIPAddress} <small>(Requires <abbr title="Internet Explorer">IE</abbr>4)</small></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Returns the new control's HWND on the stack or <i>error</i></p>
|
<p>Returns the new control's HWND on the stack or <i>error</i></p>
|
||||||
|
|
||||||
|
|
|
@ -533,6 +533,7 @@ IntOp ${RET} ${RET} & ${BIT}
|
||||||
|
|
||||||
|
|
||||||
### RichEdit ###
|
### RichEdit ###
|
||||||
|
|
||||||
!define NSD_RichEd_SetTextLimit `${__NSD_MkCtlCmd_LP} EM_EXLIMITTEXT 0 `
|
!define NSD_RichEd_SetTextLimit `${__NSD_MkCtlCmd_LP} EM_EXLIMITTEXT 0 `
|
||||||
!define NSD_RichEd_GetEventMask `${__NSD_MkCtlCmd_RV} EM_GETEVENTMASK 0 0 `
|
!define NSD_RichEd_GetEventMask `${__NSD_MkCtlCmd_RV} EM_GETEVENTMASK 0 0 `
|
||||||
!define NSD_RichEd_SetEventMask `${__NSD_MkCtlCmd_LP} EM_SETEVENTMASK 0 ` ; LP:ENM_*
|
!define NSD_RichEd_SetEventMask `${__NSD_MkCtlCmd_LP} EM_SETEVENTMASK 0 ` ; LP:ENM_*
|
||||||
|
|
|
@ -268,7 +268,7 @@ static bool GetTLBVersionInterop(const TCHAR *filepath, DWORD &high, DWORD &low)
|
||||||
{
|
{
|
||||||
if (!result && !resonly) result = MSTLB_GetVersion(pFileData, size, high, low); // A raw TLB file?
|
if (!result && !resonly) result = MSTLB_GetVersion(pFileData, size, high, low); // A raw TLB file?
|
||||||
if (!result) result = GetTLBVersionUsingRE(pFileData, size, resid, high, low); // A resource in a PE file?
|
if (!result) result = GetTLBVersionUsingRE(pFileData, size, resid, high, low); // A resource in a PE file?
|
||||||
// TODO: if (!result) result = GetTLBVersion16(pFileData, size, resid, high, low); // A resouce in a 16-bit executable?
|
// TODO: if (!result) result = GetTLBVersion16(pFileData, size, resid, high, low); // A resource in a 16-bit executable?
|
||||||
free(pFileData);
|
free(pFileData);
|
||||||
}
|
}
|
||||||
// Not supported: if (!result) result = GetTLBVersionFromMoniker(filepath, high, low);
|
// Not supported: if (!result) result = GetTLBVersionFromMoniker(filepath, high, low);
|
||||||
|
|
|
@ -126,6 +126,13 @@ static void NSISCALL NotifyCurWnd(UINT uNotifyCode)
|
||||||
#define GetUIItem(it) GetDlgItem(hwndDlg,it)
|
#define GetUIItem(it) GetDlgItem(hwndDlg,it)
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||||
|
// "Link Window"/"SysLink" stores a pointer in GWLP_USERDATA on 2000/XP/2003 and it crashes if we clobber it (forums.winamp.com/showthread.php?t=333379).
|
||||||
|
// Checking for ROLE_SYSTEM_LINK is probably more reliable but requires more code.
|
||||||
|
#define IsNSISCtlColor(p) ( ( ((p)->lbStyle) <= 1 ) /* BS_SOLID||BS_HOLLOW */ \
|
||||||
|
&& ( (UINT)((p)->bkmode) <= 2 ) /* TRANSPARENT||OPAQUE */ \
|
||||||
|
&& ( ((p)->flags >> CC_FLAGSSHIFTFORZERO) == 0 ) /* CC_* flags */ \
|
||||||
|
)
|
||||||
|
|
||||||
#define HandleStaticBkColor() _HandleStaticBkColor(uMsg, wParam, lParam)
|
#define HandleStaticBkColor() _HandleStaticBkColor(uMsg, wParam, lParam)
|
||||||
static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +140,7 @@ static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
ctlcolors *c = (ctlcolors *)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
|
ctlcolors *c = (ctlcolors *)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
|
||||||
|
|
||||||
if (c) {
|
if (c && IsNSISCtlColor(c)) {
|
||||||
COLORREF text;
|
COLORREF text;
|
||||||
LOGBRUSH lh;
|
LOGBRUSH lh;
|
||||||
|
|
||||||
|
@ -156,7 +163,7 @@ static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
lh.lbStyle = c->lbStyle;
|
lh.lbStyle = c->lbStyle;
|
||||||
if (c->bkb)
|
if (c->bkb)
|
||||||
DeleteObject(c->bkb);
|
DeleteObject(c->bkb);
|
||||||
c->bkb = CreateBrushIndirect(&lh);
|
c->bkb = CreateBrushIndirect(&lh); // LOGBRUSH::lbHatch is ignored by BS_SOLID and BS_HOLLOW
|
||||||
}
|
}
|
||||||
|
|
||||||
return (INT_PTR)c->bkb;
|
return (INT_PTR)c->bkb;
|
||||||
|
@ -166,7 +173,7 @@ static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define HandleStaticBkColor() 0
|
#define HandleStaticBkColor() 0
|
||||||
#endif//!NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
#endif//~ NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_LOG
|
#ifdef NSIS_CONFIG_LOG
|
||||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||||
|
|
|
@ -467,12 +467,14 @@ typedef struct
|
||||||
int parms[5];
|
int parms[5];
|
||||||
} page;
|
} page;
|
||||||
|
|
||||||
// text/bg color
|
// ctlcolors text/bg color flags
|
||||||
#define CC_TEXT 1
|
#define CC_TEXT 1
|
||||||
#define CC_TEXT_SYS 2
|
#define CC_TEXT_SYS 2
|
||||||
#define CC_BK 4
|
#define CC_BK 4
|
||||||
#define CC_BK_SYS 8
|
#define CC_BK_SYS 8
|
||||||
#define CC_BKB 16
|
#define CC_BKB 16
|
||||||
|
#define CC_FLAGSMASK 0x1f
|
||||||
|
#define CC_FLAGSSHIFTFORZERO 5
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
COLORREF text;
|
COLORREF text;
|
||||||
|
|
|
@ -149,6 +149,7 @@ void page_writer::write(const page *data)
|
||||||
|
|
||||||
void ctlcolors_writer::write(const ctlcolors *data, const writer_target_info&ti)
|
void ctlcolors_writer::write(const ctlcolors *data, const writer_target_info&ti)
|
||||||
{
|
{
|
||||||
|
assert(CC_FLAGSMASK >> CC_FLAGSSHIFTFORZERO == 0);
|
||||||
assert(sizeof(int) == 4 && sizeof(ctlcolors64) > sizeof(ctlcolors32));
|
assert(sizeof(int) == 4 && sizeof(ctlcolors64) > sizeof(ctlcolors32));
|
||||||
const ctlcolors *p = data;
|
const ctlcolors *p = data;
|
||||||
m_sink->write_int(p->text);
|
m_sink->write_int(p->text);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue