Patch #258, Makensisw x64 fixes
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6557 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
6d2adf744d
commit
eb5d77214a
4 changed files with 70 additions and 53 deletions
|
@ -65,13 +65,13 @@ int WINAPI _tWinMain(HINSTANCE hInst,HINSTANCE hOldInst,LPTSTR CmdLineParams,int
|
||||||
HINSTANCE hRichEditDLL = LoadLibrary(_T("RichEd20.dll"));
|
HINSTANCE hRichEditDLL = LoadLibrary(_T("RichEd20.dll"));
|
||||||
|
|
||||||
if (!InitBranding()) {
|
if (!InitBranding()) {
|
||||||
MessageBox(0,NSISERROR,ERRBOXTITLE,MB_ICONEXCLAMATION|MB_OK);
|
MessageBox(0,NSISERROR,ERRBOXTITLE,MB_ICONEXCLAMATION|MB_OK|MB_TASKMODAL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ResetObjects();
|
ResetObjects();
|
||||||
HWND hDialog = CreateDialog(g_sdata.hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
|
HWND hDialog = CreateDialog(g_sdata.hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
|
||||||
if (!hDialog) {
|
if (!hDialog) {
|
||||||
MessageBox(0,DLGERROR,ERRBOXTITLE,MB_ICONEXCLAMATION|MB_OK);
|
MessageBox(0,DLGERROR,ERRBOXTITLE,MB_ICONEXCLAMATION|MB_OK|MB_TASKMODAL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
haccel = LoadAccelerators(g_sdata.hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
haccel = LoadAccelerators(g_sdata.hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
||||||
|
@ -92,7 +92,7 @@ int WINAPI _tWinMain(HINSTANCE hInst,HINSTANCE hOldInst,LPTSTR CmdLineParams,int
|
||||||
if (g_sdata.sigint_event_legacy) CloseHandle(g_sdata.sigint_event_legacy);
|
if (g_sdata.sigint_event_legacy) CloseHandle(g_sdata.sigint_event_legacy);
|
||||||
FreeLibrary(hRichEditDLL);
|
FreeLibrary(hRichEditDLL);
|
||||||
FinalizeUpdate();
|
FinalizeUpdate();
|
||||||
return msg.wParam;
|
return (int) msg.wParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetScript(const TCHAR *script, bool clearArgs /*= true*/)
|
void SetScript(const TCHAR *script, bool clearArgs /*= true*/)
|
||||||
|
@ -174,6 +174,22 @@ void ProcessCommandLine()
|
||||||
MemSafeFree(argv);
|
MemSafeFree(argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DWORD CALLBACK SaveFileStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
|
||||||
|
{
|
||||||
|
HANDLE hFile = (HANDLE) ((DWORD_PTR*)dwCookie)[0];
|
||||||
|
DWORD cbio;
|
||||||
|
#ifdef UNICODE
|
||||||
|
if (!((DWORD_PTR*)dwCookie)[1])
|
||||||
|
{
|
||||||
|
if (!WriteUTF16LEBOM(hFile)) return -1;
|
||||||
|
((DWORD_PTR*)dwCookie)[1] = TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
BOOL wop = WriteFile(hFile, pbBuff, cb, &cbio, 0);
|
||||||
|
return (*pcb = (LONG) cbio, !wop);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
|
@ -659,17 +675,12 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
l.Flags = OFN_HIDEREADONLY|OFN_EXPLORER|OFN_PATHMUSTEXIST;
|
l.Flags = OFN_HIDEREADONLY|OFN_EXPLORER|OFN_PATHMUSTEXIST;
|
||||||
lstrcpy(buf,_T("output"));
|
lstrcpy(buf,_T("output"));
|
||||||
if (GetSaveFileName(&l)) {
|
if (GetSaveFileName(&l)) {
|
||||||
HANDLE hFile = CreateFile(buf,GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0);
|
HANDLE hFile = CreateFile(buf, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
|
||||||
if (INVALID_HANDLE_VALUE != hFile) {
|
if (INVALID_HANDLE_VALUE != hFile) { // BUGBUG:TODO: Error message for bad hFile or failed EM_STREAMOUT?
|
||||||
int len=SendDlgItemMessage(g_sdata.hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
WPARAM opts = sizeof(TCHAR) > 1 ? (SF_TEXT|SF_UNICODE) : (SF_TEXT);
|
||||||
TCHAR *existing_text=(TCHAR*) MemAlloc(len * sizeof(TCHAR));
|
DWORD_PTR cookie[2] = { (DWORD_PTR)hFile, FALSE };
|
||||||
if (existing_text) { // BUGBUG:TODO: Error message for bad hFile and existing_text?
|
EDITSTREAM es = { (DWORD_PTR)&cookie, 0, SaveFileStreamCallback };
|
||||||
existing_text[0]=0;
|
SendMessage(GetDlgItem(g_sdata.hwnd, IDC_LOGWIN), EM_STREAMOUT, opts, (LPARAM)&es);
|
||||||
GetDlgItemText(g_sdata.hwnd, IDC_LOGWIN, existing_text, len);
|
|
||||||
DWORD dwWritten = 0;
|
|
||||||
WriteFile(hFile,existing_text,len,&dwWritten,0);
|
|
||||||
MemFree(existing_text);
|
|
||||||
}
|
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -709,13 +720,14 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
if (lpfr->Flags & FR_WHOLEWORD) flags |= FR_WHOLEWORD;
|
if (lpfr->Flags & FR_WHOLEWORD) flags |= FR_WHOLEWORD;
|
||||||
FINDTEXTEX ft;
|
FINDTEXTEX ft;
|
||||||
SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM)&ft.chrg);
|
SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM)&ft.chrg);
|
||||||
if (ft.chrg.cpMax == ft.chrg.cpMin) ft.chrg.cpMin = 0;
|
ft.chrg.cpMin = (ft.chrg.cpMax == ft.chrg.cpMin) ? 0 : ft.chrg.cpMax;
|
||||||
else ft.chrg.cpMin = ft.chrg.cpMax;
|
ft.chrg.cpMax = (LONG) SendDlgItemMessage(hwndDlg, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0);
|
||||||
ft.chrg.cpMax = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0);
|
|
||||||
ft.lpstrText = lpfr->lpstrFindWhat;
|
ft.lpstrText = lpfr->lpstrFindWhat;
|
||||||
ft.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_FINDTEXTEX, flags, (LPARAM)&ft);
|
ft.chrg.cpMin = (LONG) SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_FINDTEXTEX, flags, (LPARAM)&ft);
|
||||||
if (ft.chrg.cpMin != -1) SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_SETSEL, ft.chrgText.cpMin, ft.chrgText.cpMax);
|
if (ft.chrg.cpMin != -1)
|
||||||
else MessageBeep(MB_ICONASTERISK);
|
SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_SETSEL, ft.chrgText.cpMin, ft.chrgText.cpMax);
|
||||||
|
else
|
||||||
|
MessageBeep(MB_ICONASTERISK);
|
||||||
}
|
}
|
||||||
if (lpfr->Flags & FR_DIALOGTERM) g_find.hwndFind = 0;
|
if (lpfr->Flags & FR_DIALOGTERM) g_find.hwndFind = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -857,14 +869,14 @@ INT_PTR CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
void EnableSymbolSetButtons(HWND hwndDlg)
|
void EnableSymbolSetButtons(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
|
LRESULT n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_CLEAR), n > 0);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_CLEAR), n > 0);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_SAVE), n > 0);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_SAVE), n > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnableSymbolEditButtons(HWND hwndDlg)
|
void EnableSymbolEditButtons(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
|
LRESULT n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_LEFT), n == 1);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_LEFT), n == 1);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_DEL), n != 0);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_DEL), n != 0);
|
||||||
}
|
}
|
||||||
|
@ -887,13 +899,13 @@ void SetSymbols(HWND hwndDlg, TCHAR **symbols)
|
||||||
|
|
||||||
TCHAR **GetSymbols(HWND hwndDlg)
|
TCHAR **GetSymbols(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
|
LRESULT n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
|
||||||
TCHAR **symbols = NULL;
|
TCHAR **symbols = NULL;
|
||||||
if(n > 0) {
|
if(n > 0) {
|
||||||
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, (n+1)*sizeof(TCHAR *));
|
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, (n+1)*sizeof(TCHAR *));
|
||||||
symbols = (TCHAR **)GlobalLock(hMem);
|
symbols = (TCHAR **)GlobalLock(hMem);
|
||||||
for (int i = 0; i < n; i++) {
|
for (LRESULT i = 0; i < n; i++) {
|
||||||
int len = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)i, 0);
|
LRESULT len = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)i, 0);
|
||||||
symbols[i] = (TCHAR*) MemAllocZI((len+1)*sizeof(TCHAR));
|
symbols[i] = (TCHAR*) MemAllocZI((len+1)*sizeof(TCHAR));
|
||||||
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXT, (WPARAM)i, (LPARAM)symbols[i]);
|
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXT, (WPARAM)i, (LPARAM)symbols[i]);
|
||||||
}
|
}
|
||||||
|
@ -955,8 +967,8 @@ INT_PTR CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
|
||||||
ResetSymbols();
|
ResetSymbols();
|
||||||
g_sdata.symbols = GetSymbols(hwndDlg);
|
g_sdata.symbols = GetSymbols(hwndDlg);
|
||||||
|
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
|
INT_PTR n = SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
|
||||||
if (n >= (int)COMPRESSOR_SCRIPT && n <= (int)COMPRESSOR_BEST) {
|
if (n >= (INT_PTR)COMPRESSOR_SCRIPT && n <= (INT_PTR)COMPRESSOR_BEST) {
|
||||||
g_sdata.default_compressor = (NCOMPRESSOR)n;
|
g_sdata.default_compressor = (NCOMPRESSOR)n;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -971,7 +983,7 @@ INT_PTR CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
|
||||||
break;
|
break;
|
||||||
case IDC_RIGHT:
|
case IDC_RIGHT:
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
|
LRESULT n = SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
|
||||||
if(n > 0) {
|
if(n > 0) {
|
||||||
TCHAR *buf = (TCHAR*) MemAllocZI((n+1)*sizeof(TCHAR));
|
TCHAR *buf = (TCHAR*) MemAllocZI((n+1)*sizeof(TCHAR));
|
||||||
SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXT, n+1, (LPARAM)buf);
|
SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXT, n+1, (LPARAM)buf);
|
||||||
|
@ -991,7 +1003,7 @@ INT_PTR CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
|
||||||
buf = buf3;
|
buf = buf3;
|
||||||
MemFree(buf2);
|
MemFree(buf2);
|
||||||
}
|
}
|
||||||
int idx = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_ADDSTRING, 0, (LPARAM)buf);
|
INT_PTR idx = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_ADDSTRING, 0, (LPARAM)buf);
|
||||||
if (idx >= 0)
|
if (idx >= 0)
|
||||||
{
|
{
|
||||||
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_SETSEL, FALSE, -1);
|
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_SETSEL, FALSE, -1);
|
||||||
|
@ -1011,9 +1023,9 @@ INT_PTR CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
int num = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, 1, (LPARAM) &index);
|
INT_PTR num = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, 1, (LPARAM)&index);
|
||||||
if(num == 1) {
|
if(num == 1) {
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)index, 0);
|
INT_PTR n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)index, 0);
|
||||||
if(n > 0) {
|
if(n > 0) {
|
||||||
TCHAR *buf = (TCHAR*) MemAllocZI((n+1)*sizeof(TCHAR));
|
TCHAR *buf = (TCHAR*) MemAllocZI((n+1)*sizeof(TCHAR));
|
||||||
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXT, (WPARAM)index, (LPARAM)buf);
|
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXT, (WPARAM)index, (LPARAM)buf);
|
||||||
|
@ -1047,11 +1059,11 @@ INT_PTR CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
|
||||||
break;
|
break;
|
||||||
case IDC_DEL:
|
case IDC_DEL:
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
|
INT_PTR n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
|
||||||
int *items = (int*) MemAllocZI(n*sizeof(int));
|
int *items = (int*) MemAllocZI(n*sizeof(int));
|
||||||
if (items) {
|
if (items) {
|
||||||
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, (WPARAM)n, (LPARAM)items);
|
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, (WPARAM)n, (LPARAM)items);
|
||||||
for(int i=n-1;i>=0;i--)
|
for(INT_PTR i=n-1;i>=0;i--)
|
||||||
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_DELETESTRING, (WPARAM)items[i], 0);
|
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_DELETESTRING, (WPARAM)items[i], 0);
|
||||||
MemFree(items);
|
MemFree(items);
|
||||||
}
|
}
|
||||||
|
@ -1062,7 +1074,7 @@ INT_PTR CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
|
||||||
case IDC_SYMBOL:
|
case IDC_SYMBOL:
|
||||||
if(HIWORD(wParam) == EN_CHANGE)
|
if(HIWORD(wParam) == EN_CHANGE)
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
|
LRESULT n = SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHT), n > 0);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHT), n > 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1102,15 +1114,11 @@ INT_PTR CALLBACK CompressorProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
case IDOK:
|
case IDOK:
|
||||||
{
|
{
|
||||||
int n;
|
INT_PTR n = SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
|
||||||
n = SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
|
if(n >= (INT_PTR)COMPRESSOR_SCRIPT && n <= (INT_PTR)COMPRESSOR_BEST)
|
||||||
if(n >= (int)COMPRESSOR_SCRIPT && n <= (int)COMPRESSOR_BEST) {
|
|
||||||
SetCompressor((NCOMPRESSOR)n);
|
SetCompressor((NCOMPRESSOR)n);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
SetCompressor(g_sdata.default_compressor);
|
SetCompressor(g_sdata.default_compressor);
|
||||||
}
|
|
||||||
|
|
||||||
EndDialog(hwndDlg, 0);
|
EndDialog(hwndDlg, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1203,9 +1211,9 @@ INT_PTR CALLBACK SymbolSetProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
||||||
}
|
}
|
||||||
case IDC_DEL:
|
case IDC_DEL:
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
|
LONG_PTR n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
|
||||||
if(n != CB_ERR) {
|
if(n != CB_ERR) {
|
||||||
long len = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXTLEN, (WPARAM)n, 0);
|
INT_PTR len = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXTLEN, (WPARAM)n, 0);
|
||||||
TCHAR *buf = (TCHAR*) MemAllocZI((len+1)*sizeof(TCHAR));
|
TCHAR *buf = (TCHAR*) MemAllocZI((len+1)*sizeof(TCHAR));
|
||||||
if(SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXT, (WPARAM)n, (LPARAM)buf) != CB_ERR) {
|
if(SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXT, (WPARAM)n, (LPARAM)buf) != CB_ERR) {
|
||||||
SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_DELETESTRING, n, 0);
|
SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_DELETESTRING, n, 0);
|
||||||
|
@ -1220,16 +1228,13 @@ INT_PTR CALLBACK SymbolSetProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
||||||
{
|
{
|
||||||
if(HIWORD(wParam) == CBN_SELCHANGE)
|
if(HIWORD(wParam) == CBN_SELCHANGE)
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
|
LONG_PTR n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_DEL), CB_ERR != n);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_DEL), CB_ERR != n);
|
||||||
}
|
}
|
||||||
else if(HIWORD(wParam) == CBN_DBLCLK)
|
else if(HIWORD(wParam) == CBN_DBLCLK)
|
||||||
{
|
{
|
||||||
int n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
|
LONG_PTR n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
|
||||||
if (n != CB_ERR)
|
if (n != CB_ERR) SendDlgItemMessage(hwndDlg, IDOK, BM_CLICK, 0, 0);
|
||||||
{
|
|
||||||
SendDlgItemMessage(hwndDlg, IDOK, BM_CLICK, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,17 @@ extern const TCHAR *compressor_names[];
|
||||||
void MemSafeFree(void*mem) { if (mem) GlobalFree(mem); }
|
void MemSafeFree(void*mem) { if (mem) GlobalFree(mem); }
|
||||||
void*MemAllocZI(SIZE_T cb) { return GlobalAlloc(GPTR, cb); }
|
void*MemAllocZI(SIZE_T cb) { return GlobalAlloc(GPTR, cb); }
|
||||||
|
|
||||||
|
static bool WriteFile(HANDLE hFile, const void*pData, DWORD cb)
|
||||||
|
{
|
||||||
|
DWORD cbio;
|
||||||
|
return WriteFile(hFile, pData, cb, &cbio, 0) && cb == cbio;
|
||||||
|
}
|
||||||
|
bool WriteUTF16LEBOM(HANDLE hFile)
|
||||||
|
{
|
||||||
|
static const unsigned char u16lb[] = {0xFF,0xFE};
|
||||||
|
return WriteFile(hFile, u16lb, sizeof(u16lb));
|
||||||
|
}
|
||||||
|
|
||||||
int SetArgv(const TCHAR *cmdLine, TCHAR ***argv) {
|
int SetArgv(const TCHAR *cmdLine, TCHAR ***argv) {
|
||||||
const TCHAR *p;
|
const TCHAR *p;
|
||||||
TCHAR *arg, *argSpace;
|
TCHAR *arg, *argSpace;
|
||||||
|
@ -134,14 +145,14 @@ void SetTitle(HWND hwnd,const TCHAR *substr) {
|
||||||
|
|
||||||
void CopyToClipboard(HWND hwnd) {
|
void CopyToClipboard(HWND hwnd) {
|
||||||
if (!hwnd||!OpenClipboard(hwnd)) return;
|
if (!hwnd||!OpenClipboard(hwnd)) return;
|
||||||
int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
LRESULT len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
||||||
HGLOBAL mem = GlobalAlloc(GMEM_MOVEABLE,(len+1)*sizeof(TCHAR));
|
HGLOBAL mem = GlobalAlloc(GMEM_MOVEABLE,(len+1)*sizeof(TCHAR));
|
||||||
if (!mem) { CloseClipboard(); return; }
|
if (!mem) { CloseClipboard(); return; }
|
||||||
TCHAR *existing_text = (TCHAR *)GlobalLock(mem);
|
TCHAR *existing_text = (TCHAR *)GlobalLock(mem);
|
||||||
if (!existing_text) { CloseClipboard(); return; }
|
if (!existing_text) { CloseClipboard(); return; }
|
||||||
EmptyClipboard();
|
EmptyClipboard();
|
||||||
existing_text[0]=0;
|
existing_text[0]=0;
|
||||||
GetDlgItemText(hwnd, IDC_LOGWIN, existing_text, len+1);
|
SendMessage(GetDlgItem(hwnd, IDC_LOGWIN), WM_GETTEXT, (WPARAM)(len+1), (LPARAM)existing_text);
|
||||||
GlobalUnlock(mem);
|
GlobalUnlock(mem);
|
||||||
#ifdef _UNICODE
|
#ifdef _UNICODE
|
||||||
SetClipboardData(CF_UNICODETEXT,mem);
|
SetClipboardData(CF_UNICODETEXT,mem);
|
||||||
|
@ -217,7 +228,7 @@ void Items(HWND hwnd, int on)
|
||||||
|
|
||||||
void SetCompressorStats()
|
void SetCompressorStats()
|
||||||
{
|
{
|
||||||
DWORD line_count, i;
|
DWORD_PTR line_count, i;
|
||||||
TCHAR buf[1024];
|
TCHAR buf[1024];
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ void* MemAllocZI(SIZE_T cb);
|
||||||
void MemSafeFree(void*mem);
|
void MemSafeFree(void*mem);
|
||||||
#define MemAlloc MemAllocZI
|
#define MemAlloc MemAllocZI
|
||||||
#define MemFree MemSafeFree
|
#define MemFree MemSafeFree
|
||||||
|
bool WriteUTF16LEBOM(HANDLE hFile);
|
||||||
|
|
||||||
void FreeSpawn(PROCESS_INFORMATION *pPI, HANDLE hRd, HANDLE hWr);
|
void FreeSpawn(PROCESS_INFORMATION *pPI, HANDLE hRd, HANDLE hWr);
|
||||||
BOOL InitSpawn(STARTUPINFO &si, HANDLE &hRd, HANDLE &hWr);
|
BOOL InitSpawn(STARTUPINFO &si, HANDLE &hRd, HANDLE &hWr);
|
||||||
|
|
|
@ -3157,11 +3157,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
if (TOK_P_MAKENSIS == which_token)
|
if (TOK_P_MAKENSIS == which_token)
|
||||||
{
|
{
|
||||||
extern const TCHAR *g_argv0;
|
extern const TCHAR *g_argv0;
|
||||||
extern NStreamEncoding g_outputenc;
|
|
||||||
TCHAR buf[33];
|
TCHAR buf[33];
|
||||||
compile=_T("\""), compile+=get_executable_path(g_argv0), compile+= _T("\"");
|
compile=_T("\""), compile+=get_executable_path(g_argv0), compile+= _T("\"");
|
||||||
compile+= _T(" ") OPT_STR _T("v"), wsprintf(buf,_T("%d"),get_verbosity()), compile+=buf;
|
compile+= _T(" ") OPT_STR _T("v"), wsprintf(buf,_T("%d"),get_verbosity()), compile+=buf;
|
||||||
#ifdef _WIN32 // POSIX does not support -OUTPUTCHARSET
|
#ifdef _WIN32 // POSIX does not support -OUTPUTCHARSET
|
||||||
|
extern NStreamEncoding g_outputenc;
|
||||||
compile+= _T(" ") OPT_STR _T("OCS "), g_outputenc.GetCPDisplayName(buf), compile+=buf;
|
compile+= _T(" ") OPT_STR _T("OCS "), g_outputenc.GetCPDisplayName(buf), compile+=buf;
|
||||||
#endif
|
#endif
|
||||||
if (*exec) compile+= _T(" "), compile+=exec;
|
if (*exec) compile+= _T(" "), compile+=exec;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue