write HWND and HWND2 entries to the INI with the control's HWND

no more weird calculations when there's a browse button


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4315 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-10-11 16:27:04 +00:00
parent 49179ea08d
commit d144639111
3 changed files with 36 additions and 16 deletions

View file

@ -156,6 +156,9 @@ struct FieldType {
int nParentIdx; // this is used to store original windowproc for LINK
HANDLE hImage; // this is used by image/icon field to save the handle to the image
int nField; // field number in INI file
char *pszHwndEntry; // "HWND" or "HWND2"
};
// initial buffer size. buffers will grow as required.
@ -482,6 +485,9 @@ int WINAPI ReadSettings(void) {
};
FieldType *pField = pFields + nIdx;
pField->nField = nCtrlIdx + 1;
pField->pszHwndEntry = "HWND";
wsprintf(szField, "Field %d", nCtrlIdx + 1);
pszAppName = szField;
@ -565,6 +571,8 @@ int WINAPI ReadSettings(void) {
pNewField->rect.bottom = pField->rect.bottom;
pNewField->rect.top = pField->rect.top;
pField->rect.right = pNewField->rect.left - 3;
pNewField->nField = nCtrlIdx + 1;
pNewField->pszHwndEntry = "HWND2";
nNumFields++;
nIdx++;
}
@ -1114,6 +1122,14 @@ int WINAPI createCfgDlg()
NULL
);
{
char szField[64];
char szHwnd[64];
wsprintf(szField, "Field %d", pField->nField);
wsprintf(szHwnd, "%d", hwCtrl);
WritePrivateProfileString(szField, pField->pszHwndEntry, szHwnd, pszFilename);
}
if (hwCtrl) {
// Sets the font of IO window to be the same as the main window
mySendMessage(hwCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);