mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
StrSafe adaptions
This commit is contained in:
parent
3db1dbd0ab
commit
bfe3962a35
@ -234,7 +234,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
ShowWindow(GetDlgItem(hwnd,IDC_WEBPAGE2),SW_SHOWNORMAL);
|
||||
}
|
||||
else {
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"<A>%s</A>",VERSION_WEBPAGEDISPLAY);
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"<A>%s</A>",VERSION_WEBPAGEDISPLAY);
|
||||
SetDlgItemText(hwnd,IDC_WEBPAGE,wch);
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
ShowWindow(GetDlgItem(hwnd, IDC_MODWEBPAGE2), SW_SHOWNORMAL);
|
||||
}
|
||||
else {
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"<A>%s</A>", VERSION_MODPAGEDISPLAY);
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"<A>%s</A>", VERSION_MODPAGEDISPLAY);
|
||||
SetDlgItemText(hwnd, IDC_MODWEBPAGE, wch);
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
ShowWindow(GetDlgItem(hwnd, IDC_NOTE2WEBPAGE2), SW_SHOWNORMAL);
|
||||
}
|
||||
else {
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"<A>%s</A>", VERSION_WEBPAGE2DISPLAY);
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"<A>%s</A>", VERSION_WEBPAGE2DISPLAY);
|
||||
SetDlgItemText(hwnd, IDC_NOTE2WEBPAGE, wch);
|
||||
}
|
||||
|
||||
@ -343,7 +343,7 @@ INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
GetDlgItemText(hwnd,IDC_COMMANDLINE,szArgs,COUNTOF(szArgs));
|
||||
ExpandEnvironmentStringsEx(szArgs,COUNTOF(szArgs));
|
||||
ExtractFirstArgument(szArgs,szFile,szArg2);
|
||||
ExtractFirstArgument(szArgs,szFile,szArg2,MAX_PATH);
|
||||
|
||||
GetString(IDS_FILTER_EXE,szFilter,COUNTOF(szFilter));
|
||||
PrepareFilterStr(szFilter);
|
||||
@ -377,7 +377,7 @@ INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
WCHAR args[MAX_PATH] = { L'\0' };
|
||||
|
||||
if (GetDlgItemText(hwnd,IDC_COMMANDLINE,args,MAX_PATH))
|
||||
if (ExtractFirstArgument(args,args,NULL))
|
||||
if (ExtractFirstArgument(args,args,NULL,MAX_PATH))
|
||||
if (lstrlen(args))
|
||||
bEnableOK = TRUE;
|
||||
|
||||
@ -397,7 +397,7 @@ INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
BOOL bQuickExit = FALSE;
|
||||
|
||||
ExpandEnvironmentStringsEx(arg1,COUNTOF(arg1));
|
||||
ExtractFirstArgument(arg1,arg1,arg2);
|
||||
ExtractFirstArgument(arg1,arg1,arg2,MAX_PATH);
|
||||
|
||||
if (lstrcmpi(arg1,L"notepad3") == 0 ||
|
||||
lstrcmpi(arg1,L"notepad3.exe") == 0) {
|
||||
|
||||
20
src/Edit.c
20
src/Edit.c
@ -624,9 +624,9 @@ int EditDetectEOLMode(HWND hwnd,char* lpData,DWORD cbData)
|
||||
// Encoding Helper Functions
|
||||
//
|
||||
void Encoding_InitDefaults() {
|
||||
StringCchPrintfW(wchANSI,COUNTOF(wchANSI),L" (%u)",GetACP());
|
||||
StringCchPrintf(wchANSI,COUNTOF(wchANSI),L" (%u)",GetACP());
|
||||
mEncoding[CPI_OEM].uCodePage = GetOEMCP();
|
||||
StringCchPrintfW(wchOEM,COUNTOF(wchOEM),L" (%u)",mEncoding[CPI_OEM].uCodePage);
|
||||
StringCchPrintf(wchOEM,COUNTOF(wchOEM),L" (%u)",mEncoding[CPI_OEM].uCodePage);
|
||||
|
||||
g_DOSEncoding = CPI_OEM;
|
||||
|
||||
@ -2241,7 +2241,7 @@ void EditHex2Char(HWND hwnd) {
|
||||
else {
|
||||
UINT cp = (UINT)SendMessage(hwnd,SCI_GETCODEPAGE,0,0);
|
||||
WCHAR wch[4];
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"%lc",(WCHAR)i);
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"%lc",(WCHAR)i);
|
||||
cch = WideCharToMultiByte(cp,0,wch,-1,ch,COUNTOF(ch),NULL,NULL) - 1;
|
||||
if (bTrySelExpand && (char)SendMessage(hwnd,SCI_GETCHARAT,(WPARAM)iSelStart-1,0) == '\\') {
|
||||
iSelStart--;
|
||||
@ -4758,7 +4758,7 @@ void EditGetExcerpt(HWND hwnd,LPWSTR lpszExcerpt,DWORD cchExcerpt)
|
||||
int iAnchorPos = (int)SendMessage(hwnd,SCI_GETANCHOR,0,0);
|
||||
|
||||
if (iCurPos == iAnchorPos || SC_SEL_RECTANGLE == SendMessage(hwnd,SCI_GETSELECTIONMODE,0,0)) {
|
||||
lstrcpy(lpszExcerpt,L"");
|
||||
StringCchCopy(lpszExcerpt,cchExcerpt,L"");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4800,7 +4800,7 @@ void EditGetExcerpt(HWND hwnd,LPWSTR lpszExcerpt,DWORD cchExcerpt)
|
||||
}
|
||||
|
||||
if (cch == 1)
|
||||
lstrcpy(tch,L" ... ");
|
||||
StringCchCopy(tch,COUNTOF(tch),L" ... ");
|
||||
|
||||
if (cch > cchExcerpt) {
|
||||
tch[cchExcerpt-2] = L'.';
|
||||
@ -5107,12 +5107,12 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
}
|
||||
}
|
||||
else
|
||||
lstrcpyA(lpefr->szReplaceUTF8,"");
|
||||
StringCchCopyA(lpefr->szReplaceUTF8,COUNTOF(lpefr->szReplaceUTF8),"");
|
||||
}
|
||||
else {
|
||||
GetDlgItemTextA2W(CP_UTF8,hwnd,IDC_FINDTEXT,lpefr->szFindUTF8,COUNTOF(lpefr->szFindUTF8));
|
||||
if (!GetDlgItemTextA2W(CP_UTF8,hwnd,IDC_REPLACETEXT,lpefr->szReplaceUTF8,COUNTOF(lpefr->szReplaceUTF8)))
|
||||
lstrcpyA(lpefr->szReplaceUTF8,"");
|
||||
StringCchCopyA(lpefr->szReplaceUTF8,COUNTOF(lpefr->szReplaceUTF8),"");
|
||||
}
|
||||
|
||||
if (bIsFindDlg) {
|
||||
@ -5706,7 +5706,7 @@ void CompleteWord(HWND hwnd, BOOL autoInsert) {
|
||||
if (!found) {
|
||||
struct WLIST* el = (struct WLIST*)LocalAlloc(LPTR, sizeof(struct WLIST));
|
||||
el->word = LocalAlloc(LPTR, wordEnd - iPosFind + 2);
|
||||
lstrcpyA(el->word, pWord);
|
||||
StringCchCopyA(el->word,(wordEnd - iPosFind + 2),pWord);
|
||||
el->next = p;
|
||||
if (t) {
|
||||
t->next = el;
|
||||
@ -5731,8 +5731,8 @@ void CompleteWord(HWND hwnd, BOOL autoInsert) {
|
||||
|
||||
pList = LocalAlloc(LPTR, iWListSize + 1);
|
||||
while (p) {
|
||||
lstrcatA(pList, " ");
|
||||
lstrcatA(pList, p->word);
|
||||
StringCchCatA(pList,iWListSize + 1," ");
|
||||
StringCchCatA(pList,iWListSize + 1,p->word);
|
||||
LocalFree(p->word);
|
||||
t = p;
|
||||
p = p->next;
|
||||
|
||||
140
src/Helpers.c
140
src/Helpers.c
@ -47,20 +47,20 @@ int IniSectionGetString(
|
||||
int ich;
|
||||
|
||||
if (p) {
|
||||
lstrcpy(tch,lpName);
|
||||
lstrcat(tch,L"=");
|
||||
StringCchCopy(tch,COUNTOF(tch),lpName);
|
||||
StringCchCat(tch,COUNTOF(tch),L"=");
|
||||
ich = lstrlen(tch);
|
||||
|
||||
while (*p) {
|
||||
if (StrCmpNI(p,tch,ich) == 0) {
|
||||
lstrcpyn(lpReturnedString,p + ich,cchReturnedString);
|
||||
StringCchCopyN(lpReturnedString,cchReturnedString,p + ich,cchReturnedString);
|
||||
return(lstrlen(lpReturnedString));
|
||||
}
|
||||
else
|
||||
p = StrEnd(p) + 1;
|
||||
}
|
||||
}
|
||||
lstrcpyn(lpReturnedString,lpDefault,cchReturnedString);
|
||||
StringCchCopyN(lpReturnedString,cchReturnedString,lpDefault,cchReturnedString);
|
||||
return(lstrlen(lpReturnedString));
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ int IniSectionGetInt(
|
||||
int i;
|
||||
|
||||
if (p) {
|
||||
lstrcpy(tch,lpName);
|
||||
lstrcat(tch,L"=");
|
||||
StringCchCopy(tch,COUNTOF(tch),lpName);
|
||||
StringCchCat(tch,COUNTOF(tch),L"=");
|
||||
ich = lstrlen(tch);
|
||||
|
||||
while (*p) {
|
||||
@ -105,9 +105,9 @@ UINT IniSectionGetUInt(
|
||||
UINT u;
|
||||
|
||||
if (p) {
|
||||
lstrcpy(tch, lpName);
|
||||
lstrcat(tch, L"=");
|
||||
ich = lstrlen(tch);
|
||||
StringCchCopy(tch,COUNTOF(tch),lpName);
|
||||
StringCchCat(tch,COUNTOF(tch),L"=");
|
||||
ich = lstrlen(tch);
|
||||
|
||||
while (*p) {
|
||||
if (StrCmpNI(p, tch, ich) == 0) {
|
||||
@ -132,8 +132,8 @@ BOOL IniSectionSetString(LPWSTR lpCachedIniSection,LPCWSTR lpName,LPCWSTR lpStri
|
||||
while (*p) {
|
||||
p = StrEnd(p) + 1;
|
||||
}
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%s=%s",lpName,lpString);
|
||||
lstrcpy(p,tch);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%s=%s",lpName,lpString);
|
||||
StringCchCopy(p,512*3+64,tch);
|
||||
p = StrEnd(p) + 1;
|
||||
*p = 0;
|
||||
return(TRUE);
|
||||
@ -409,14 +409,14 @@ BOOL SetWindowTitle(HWND hwnd,UINT uIDAppName,BOOL bIsElevated,UINT uIDUntitled,
|
||||
}
|
||||
|
||||
if (bModified)
|
||||
lstrcpy(szTitle,pszMod);
|
||||
StringCchCopy(szTitle,COUNTOF(szTitle),pszMod);
|
||||
else
|
||||
lstrcpy(szTitle,L"");
|
||||
StringCchCopy(szTitle,COUNTOF(szTitle),L"");
|
||||
|
||||
if (lstrlen(lpszExcerpt)) {
|
||||
GetString(IDS_TITLEEXCERPT,szExcrptFmt,COUNTOF(szExcrptFmt));
|
||||
StringCchPrintfW(szExcrptQuot,COUNTOF(szExcrptQuot),szExcrptFmt,lpszExcerpt);
|
||||
StrCat(szTitle,szExcrptQuot);
|
||||
StringCchPrintf(szExcrptQuot,COUNTOF(szExcrptQuot),szExcrptFmt,lpszExcerpt);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),szExcrptQuot);
|
||||
}
|
||||
|
||||
else if (lstrlen(lpszFile))
|
||||
@ -425,40 +425,39 @@ BOOL SetWindowTitle(HWND hwnd,UINT uIDAppName,BOOL bIsElevated,UINT uIDUntitled,
|
||||
{
|
||||
if (lstrcmp(szCachedFile,lpszFile) != 0) {
|
||||
SHFILEINFO shfi;
|
||||
lstrcpy(szCachedFile,lpszFile);
|
||||
StringCchCopy(szCachedFile,COUNTOF(szCachedFile),lpszFile);
|
||||
if (SHGetFileInfo2(lpszFile,0,&shfi,sizeof(SHFILEINFO),SHGFI_DISPLAYNAME))
|
||||
lstrcpy(szCachedDisplayName,shfi.szDisplayName);
|
||||
StringCchCopy(szCachedDisplayName,COUNTOF(szCachedDisplayName),shfi.szDisplayName);
|
||||
else
|
||||
lstrcpy(szCachedDisplayName,PathFindFileName(lpszFile));
|
||||
StringCchCopy(szCachedDisplayName,COUNTOF(szCachedDisplayName),PathFindFileName(lpszFile));
|
||||
}
|
||||
lstrcat(szTitle,szCachedDisplayName);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),szCachedDisplayName);
|
||||
if (iFormat == 1) {
|
||||
WCHAR tchPath[MAX_PATH] = { L'\0' };
|
||||
StrCpyN(tchPath,lpszFile,COUNTOF(tchPath));
|
||||
PathRemoveFileSpec(tchPath);
|
||||
StrCat(szTitle,L" [");
|
||||
StrCat(szTitle,tchPath);
|
||||
StrCat(szTitle,L"]");
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),L" [");
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),tchPath);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),L"]");
|
||||
}
|
||||
}
|
||||
else
|
||||
lstrcat(szTitle,lpszFile);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),lpszFile);
|
||||
}
|
||||
|
||||
else {
|
||||
lstrcpy(szCachedFile,L"");
|
||||
lstrcpy(szCachedDisplayName,L"");
|
||||
lstrcat(szTitle,szUntitled);
|
||||
StringCchCopy(szCachedFile,COUNTOF(szCachedFile),L"");
|
||||
StringCchCopy(szCachedDisplayName,COUNTOF(szCachedDisplayName),L"");
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),szUntitled);
|
||||
}
|
||||
|
||||
if (bReadOnly && GetString(uIDReadOnly,szReadOnly,COUNTOF(szReadOnly)))
|
||||
{
|
||||
lstrcat(szTitle,L" ");
|
||||
lstrcat(szTitle,szReadOnly);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),L" ");
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),szReadOnly);
|
||||
}
|
||||
|
||||
lstrcat(szTitle,pszSep);
|
||||
lstrcat(szTitle,szAppName);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),pszSep);
|
||||
StringCchCat(szTitle,COUNTOF(szTitle),szAppName);
|
||||
|
||||
return SetWindowText(hwnd,szTitle);
|
||||
|
||||
@ -859,22 +858,22 @@ int StatusCalcPaneWidth(HWND hwnd,LPCWSTR lpsz)
|
||||
//
|
||||
int Toolbar_GetButtons(HWND hwnd,int cmdBase,LPWSTR lpszButtons,int cchButtons)
|
||||
{
|
||||
WCHAR tchButtons[512];
|
||||
WCHAR tchItem[32];
|
||||
WCHAR tchButtons[512] = { L'\0' };
|
||||
WCHAR tchItem[32] = { L'\0' };
|
||||
int i,c;
|
||||
TBBUTTON tbb;
|
||||
|
||||
lstrcpy(tchButtons,L"");
|
||||
StringCchCopy(tchButtons,COUNTOF(tchButtons),L"");
|
||||
c = min(50,(int)SendMessage(hwnd,TB_BUTTONCOUNT,0,0));
|
||||
|
||||
for (i = 0; i < c; i++) {
|
||||
SendMessage(hwnd,TB_GETBUTTON,(WPARAM)i,(LPARAM)&tbb);
|
||||
StringCchPrintfW(tchItem,COUNTOF(tchItem),L"%i ",
|
||||
StringCchPrintf(tchItem,COUNTOF(tchItem),L"%i ",
|
||||
(tbb.idCommand==0)?0:tbb.idCommand-cmdBase+1);
|
||||
lstrcat(tchButtons,tchItem);
|
||||
StringCchCat(tchButtons,COUNTOF(tchButtons),tchItem);
|
||||
}
|
||||
TrimString(tchButtons);
|
||||
lstrcpyn(lpszButtons,tchButtons,cchButtons);
|
||||
StringCchCopyN(lpszButtons,cchButtons,tchButtons,COUNTOF(tchButtons));
|
||||
return(c);
|
||||
}
|
||||
|
||||
@ -951,7 +950,7 @@ int FormatString(LPWSTR lpOutput,int nOutput,UINT uIdFormat,...)
|
||||
WCHAR *p = LocalAlloc(LPTR,sizeof(WCHAR)*nOutput);
|
||||
|
||||
if (GetString(uIdFormat,p,nOutput))
|
||||
wvsprintf(lpOutput,p,(LPVOID)((PUINT_PTR)&uIdFormat+1));
|
||||
StringCchVPrintf(lpOutput,nOutput,p,(LPVOID)((PUINT_PTR)&uIdFormat + 1));
|
||||
|
||||
LocalFree(p);
|
||||
|
||||
@ -976,7 +975,7 @@ void PathRelativeToApp(
|
||||
DWORD dwAttrTo = (bSrcIsFile) ? 0 : FILE_ATTRIBUTE_DIRECTORY;
|
||||
|
||||
GetModuleFileName(NULL,wchAppPath,COUNTOF(wchAppPath));
|
||||
PathCanonicalizeEx(wchAppPath);
|
||||
PathCanonicalizeEx(wchAppPath,MAX_PATH);
|
||||
PathRemoveFileSpec(wchAppPath);
|
||||
GetWindowsDirectory(wchWinDir,COUNTOF(wchWinDir));
|
||||
SHGetFolderPath(NULL,CSIDL_PERSONAL,NULL,SHGFP_TYPE_CURRENT,wchUserFiles);
|
||||
@ -986,28 +985,29 @@ void PathRelativeToApp(
|
||||
!PathIsPrefix(wchUserFiles,wchAppPath) &&
|
||||
PathIsPrefix(wchUserFiles,lpszSrc) &&
|
||||
PathRelativePathTo(wchPath,wchUserFiles,FILE_ATTRIBUTE_DIRECTORY,lpszSrc,dwAttrTo)) {
|
||||
lstrcpy(wchUserFiles,L"%CSIDL:MYDOCUMENTS%");
|
||||
StringCchCopy(wchUserFiles,COUNTOF(wchUserFiles),L"%CSIDL:MYDOCUMENTS%");
|
||||
PathAppend(wchUserFiles,wchPath);
|
||||
lstrcpy(wchPath,wchUserFiles);
|
||||
StringCchCopy(wchPath,COUNTOF(wchPath),wchUserFiles);
|
||||
}
|
||||
else if (PathIsRelative(lpszSrc) || PathCommonPrefix(wchAppPath,wchWinDir,NULL))
|
||||
lstrcpyn(wchPath,lpszSrc,COUNTOF(wchPath));
|
||||
StringCchCopyN(wchPath,COUNTOF(wchPath),lpszSrc,COUNTOF(wchPath));
|
||||
else {
|
||||
if (!PathRelativePathTo(wchPath,wchAppPath,FILE_ATTRIBUTE_DIRECTORY,lpszSrc,dwAttrTo))
|
||||
lstrcpyn(wchPath,lpszSrc,COUNTOF(wchPath));
|
||||
StringCchCopyN(wchPath,COUNTOF(wchPath),lpszSrc,COUNTOF(wchPath));
|
||||
}
|
||||
|
||||
if (bUnexpandEnv) {
|
||||
if (!PathUnExpandEnvStrings(wchPath,wchResult,COUNTOF(wchResult)))
|
||||
lstrcpyn(wchResult,wchPath,COUNTOF(wchResult));
|
||||
StringCchCopyN(wchResult,COUNTOF(wchResult),wchPath,COUNTOF(wchResult));
|
||||
}
|
||||
else
|
||||
lstrcpyn(wchResult,wchPath,COUNTOF(wchResult));
|
||||
StringCchCopyN(wchResult,COUNTOF(wchResult),wchPath,COUNTOF(wchResult));
|
||||
|
||||
int cchLen = (cchDest == 0) ? MAX_PATH : cchDest;
|
||||
if (lpszDest == NULL || lpszSrc == lpszDest)
|
||||
lstrcpyn(lpszSrc,wchResult,(cchDest == 0) ? MAX_PATH : cchDest);
|
||||
StringCchCopyN(lpszSrc,cchLen,wchResult,cchLen);
|
||||
else
|
||||
lstrcpyn(lpszDest,wchResult,(cchDest == 0) ? MAX_PATH : cchDest);
|
||||
StringCchCopyN(lpszDest,cchLen,wchResult,cchLen);
|
||||
}
|
||||
|
||||
|
||||
@ -1040,14 +1040,14 @@ void PathAbsoluteFromApp(LPWSTR lpszSrc,LPWSTR lpszDest,int cchDest,BOOL bExpand
|
||||
|
||||
if (PathIsRelative(wchPath)) {
|
||||
GetModuleFileName(NULL,wchResult,COUNTOF(wchResult));
|
||||
PathCanonicalizeEx(wchResult);
|
||||
PathCanonicalizeEx(wchResult,MAX_PATH);
|
||||
PathRemoveFileSpec(wchResult);
|
||||
PathAppend(wchResult,wchPath);
|
||||
}
|
||||
else
|
||||
lstrcpyn(wchResult,wchPath,COUNTOF(wchResult));
|
||||
|
||||
PathCanonicalizeEx(wchResult);
|
||||
PathCanonicalizeEx(wchResult,MAX_PATH);
|
||||
if (PathGetDriveNumber(wchResult) != -1)
|
||||
CharUpperBuff(wchResult,1);
|
||||
|
||||
@ -1131,9 +1131,8 @@ BOOL PathGetLnkPath(LPCWSTR pszLnkFile,LPWSTR pszResPath,int cchResPath)
|
||||
{
|
||||
WORD wsz[MAX_PATH] = { L'\0' };
|
||||
|
||||
/*MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,
|
||||
pszLnkFile,-1,wsz,MAX_PATH);*/
|
||||
lstrcpy(wsz,pszLnkFile);
|
||||
/*MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,pszLnkFile,-1,wsz,MAX_PATH);*/
|
||||
StringCchCopy(wsz,COUNTOF(wsz),pszLnkFile);
|
||||
|
||||
if (SUCCEEDED(ppf->lpVtbl->Load(ppf,wsz,STGM_READ)))
|
||||
{
|
||||
@ -1151,7 +1150,7 @@ BOOL PathGetLnkPath(LPCWSTR pszLnkFile,LPWSTR pszResPath,int cchResPath)
|
||||
|
||||
if (bSucceeded) {
|
||||
ExpandEnvironmentStringsEx(pszResPath,cchResPath);
|
||||
PathCanonicalizeEx(pszResPath);
|
||||
PathCanonicalizeEx(pszResPath,cchResPath);
|
||||
}
|
||||
|
||||
return(bSucceeded);
|
||||
@ -1228,11 +1227,11 @@ BOOL PathCreateDeskLnk(LPCWSTR pszDocument)
|
||||
// init strings
|
||||
GetModuleFileName(NULL,tchExeFile,COUNTOF(tchExeFile));
|
||||
|
||||
lstrcpy(tchDocTemp,pszDocument);
|
||||
StringCchCopy(tchDocTemp,COUNTOF(tchDocTemp),pszDocument);
|
||||
PathQuoteSpaces(tchDocTemp);
|
||||
|
||||
lstrcpy(tchArguments,L"-n ");
|
||||
lstrcat(tchArguments,tchDocTemp);
|
||||
StringCchCopy(tchArguments,COUNTOF(tchArguments),L"-n ");
|
||||
StringCchCat(tchArguments,COUNTOF(tchArguments),tchDocTemp);
|
||||
|
||||
SHGetSpecialFolderPath(NULL,tchLinkDir,CSIDL_DESKTOPDIRECTORY,TRUE);
|
||||
|
||||
@ -1252,9 +1251,8 @@ BOOL PathCreateDeskLnk(LPCWSTR pszDocument)
|
||||
{
|
||||
WORD wsz[MAX_PATH] = { L'\0' };
|
||||
|
||||
/*MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,
|
||||
tchLnkFileName,-1,wsz,MAX_PATH);*/
|
||||
lstrcpy(wsz,tchLnkFileName);
|
||||
/*MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,tchLnkFileName,-1,wsz,MAX_PATH);*/
|
||||
StringCchCopy(wsz,COUNTOF(wsz),tchLnkFileName);
|
||||
|
||||
psl->lpVtbl->SetPath(psl,tchExeFile);
|
||||
psl->lpVtbl->SetArguments(psl,tchArguments);
|
||||
@ -1293,9 +1291,9 @@ BOOL PathCreateFavLnk(LPCWSTR pszName,LPCWSTR pszTarget,LPCWSTR pszDir)
|
||||
if (!pszName || lstrlen(pszName) == 0)
|
||||
return TRUE;
|
||||
|
||||
lstrcpy(tchLnkFileName,pszDir);
|
||||
StringCchCopy(tchLnkFileName,COUNTOF(tchLnkFileName),pszDir);
|
||||
PathAppend(tchLnkFileName,pszName);
|
||||
lstrcat(tchLnkFileName,L".lnk");
|
||||
StringCchCat(tchLnkFileName,COUNTOF(tchLnkFileName),L".lnk");
|
||||
|
||||
if (PathFileExists(tchLnkFileName))
|
||||
return FALSE;
|
||||
@ -1310,9 +1308,8 @@ BOOL PathCreateFavLnk(LPCWSTR pszName,LPCWSTR pszTarget,LPCWSTR pszDir)
|
||||
{
|
||||
WORD wsz[MAX_PATH] = { L'\0' };
|
||||
|
||||
/*MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,
|
||||
tchLnkFileName,-1,wsz,MAX_PATH);*/
|
||||
lstrcpy(wsz,tchLnkFileName);
|
||||
/*MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,tchLnkFileName,-1,wsz,MAX_PATH);*/
|
||||
StringCchCopy(wsz,COUNTOF(wsz),tchLnkFileName);
|
||||
|
||||
psl->lpVtbl->SetPath(psl,pszTarget);
|
||||
|
||||
@ -1385,13 +1382,13 @@ BOOL TrimString(LPWSTR lpString)
|
||||
//
|
||||
// ExtractFirstArgument()
|
||||
//
|
||||
BOOL ExtractFirstArgument(LPCWSTR lpArgs,LPWSTR lpArg1,LPWSTR lpArg2)
|
||||
BOOL ExtractFirstArgument(LPCWSTR lpArgs,LPWSTR lpArg1,LPWSTR lpArg2,int len)
|
||||
{
|
||||
|
||||
LPWSTR psz;
|
||||
BOOL bQuoted = FALSE;
|
||||
|
||||
lstrcpy(lpArg1,lpArgs);
|
||||
StringCchCopy(lpArg1,len,lpArgs);
|
||||
if (lpArg2)
|
||||
*lpArg2 = L'\0';
|
||||
|
||||
@ -1414,7 +1411,7 @@ BOOL ExtractFirstArgument(LPCWSTR lpArgs,LPWSTR lpArg1,LPWSTR lpArg2)
|
||||
{
|
||||
*psz = L'\0';
|
||||
if (lpArg2)
|
||||
lstrcpy(lpArg2,psz + 1);
|
||||
StringCchCopy(lpArg2,len,psz + 1);
|
||||
}
|
||||
|
||||
TrimString(lpArg1);
|
||||
@ -1494,11 +1491,12 @@ void ExpandEnvironmentStringsEx(LPWSTR lpSrc,DWORD dwSrc)
|
||||
// PathCanonicalizeEx()
|
||||
//
|
||||
//
|
||||
void PathCanonicalizeEx(LPWSTR lpSrc)
|
||||
void PathCanonicalizeEx(LPWSTR lpSrc,int len)
|
||||
{
|
||||
WCHAR szDst[MAX_PATH] = { L'\0' };
|
||||
|
||||
if (PathCanonicalize(szDst,lpSrc))
|
||||
StringCchCopy(lpSrc,len,szDst);
|
||||
lstrcpy(lpSrc,szDst);
|
||||
}
|
||||
|
||||
@ -1592,7 +1590,7 @@ BOOL SetDlgItemIntEx(HWND hwnd,int nIdItem,UINT uValue)
|
||||
{
|
||||
WCHAR szBuf[64];
|
||||
|
||||
StringCchPrintfW(szBuf,COUNTOF(szBuf),L"%u",uValue);
|
||||
StringCchPrintf(szBuf,COUNTOF(szBuf),L"%u",uValue);
|
||||
FormatNumberStr(szBuf);
|
||||
|
||||
return(SetDlgItemText(hwnd,nIdItem,szBuf));
|
||||
@ -1803,7 +1801,7 @@ BOOL MRU_Load(LPMRULIST pmru) {
|
||||
LoadIniSection(pmru->szRegKey,pIniSection,(int)LocalSize(pIniSection)/sizeof(WCHAR));
|
||||
|
||||
for (i = 0; i < pmru->iSize; i++) {
|
||||
StringCchPrintfW(tchName,COUNTOF(tchName),L"%.2i",i+1);
|
||||
StringCchPrintf(tchName,COUNTOF(tchName),L"%.2i",i+1);
|
||||
if (IniSectionGetString(pIniSection,tchName,L"",tchItem,COUNTOF(tchItem))) {
|
||||
/*if (pmru->iFlags & MRU_UTF8) {
|
||||
WCHAR wchItem[1024];
|
||||
@ -1829,7 +1827,7 @@ BOOL MRU_Save(LPMRULIST pmru) {
|
||||
|
||||
for (i = 0; i < pmru->iSize; i++) {
|
||||
if (pmru->pszItems[i]) {
|
||||
StringCchPrintfW(tchName,COUNTOF(tchName),L"%.2i",i+1);
|
||||
StringCchPrintf(tchName,COUNTOF(tchName),L"%.2i",i+1);
|
||||
/*if (pmru->iFlags & MRU_UTF8) {
|
||||
WCHAR tchItem[1024];
|
||||
WCHAR wchItem[1024];
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#ifndef _NP3_HELPERS_H_
|
||||
#define _NP3_HELPERS_H_
|
||||
|
||||
//#define STRSAFE_NO_DEPRECATE // comment out to see missing migrations
|
||||
#define STRSAFE_NO_DEPRECATE // comment out to see missing migrations
|
||||
#define STRSAFE_NO_CB_FUNCTIONS
|
||||
#include <strsafe.h>
|
||||
|
||||
@ -44,7 +44,7 @@ extern WCHAR szIniFile[MAX_PATH];
|
||||
#define IniDeleteSection(lpSection) \
|
||||
WritePrivateProfileSection(lpSection,NULL,szIniFile)
|
||||
__inline BOOL IniSetInt(LPCWSTR lpSection,LPCWSTR lpName,int i) {
|
||||
WCHAR tch[32]; StringCchPrintfW(tch,COUNTOF(tch),L"%i",i); return IniSetString(lpSection,lpName,tch);
|
||||
WCHAR tch[32]; StringCchPrintf(tch,COUNTOF(tch),L"%i",i); return IniSetString(lpSection,lpName,tch);
|
||||
}
|
||||
#define LoadIniSection(lpSection,lpBuf,cchBuf) \
|
||||
GetPrivateProfileSection(lpSection,lpBuf,cchBuf,szIniFile)
|
||||
@ -55,7 +55,7 @@ int IniSectionGetInt(LPCWSTR,LPCWSTR,int);
|
||||
UINT IniSectionGetUInt(LPCWSTR,LPCWSTR,UINT);
|
||||
BOOL IniSectionSetString(LPWSTR,LPCWSTR,LPCWSTR);
|
||||
__inline BOOL IniSectionSetInt(LPWSTR lpCachedIniSection,LPCWSTR lpName,int i) {
|
||||
WCHAR tch[32]; StringCchPrintfW(tch,COUNTOF(tch),L"%i",i); return IniSectionSetString(lpCachedIniSection,lpName,tch);
|
||||
WCHAR tch[32]; StringCchPrintf(tch,COUNTOF(tch),L"%i",i); return IniSectionSetString(lpCachedIniSection,lpName,tch);
|
||||
}
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ BOOL PathCreateFavLnk(LPCWSTR,LPCWSTR,LPCWSTR);
|
||||
|
||||
BOOL StrLTrim(LPWSTR,LPCWSTR);
|
||||
BOOL TrimString(LPWSTR);
|
||||
BOOL ExtractFirstArgument(LPCWSTR, LPWSTR, LPWSTR);
|
||||
BOOL ExtractFirstArgument(LPCWSTR, LPWSTR, LPWSTR, int);
|
||||
|
||||
void PrepareFilterStr(LPWSTR);
|
||||
|
||||
@ -147,7 +147,7 @@ void PathFixBackslashes(LPWSTR);
|
||||
|
||||
|
||||
void ExpandEnvironmentStringsEx(LPWSTR,DWORD);
|
||||
void PathCanonicalizeEx(LPWSTR);
|
||||
void PathCanonicalizeEx(LPWSTR,int);
|
||||
DWORD GetLongPathNameEx(LPWSTR,DWORD);
|
||||
DWORD_PTR SHGetFileInfo2(LPCWSTR,DWORD,SHFILEINFO*,UINT,UINT);
|
||||
|
||||
|
||||
125
src/Notepad3.c
125
src/Notepad3.c
@ -1916,7 +1916,7 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance)
|
||||
if (tbbMainWnd[i].fsStyle == TBSTYLE_SEP)
|
||||
continue;
|
||||
|
||||
StringCchPrintfW(tchIndex,COUNTOF(tchIndex),L"%02i",n++);
|
||||
StringCchPrintf(tchIndex,COUNTOF(tchIndex),L"%02i",n++);
|
||||
|
||||
if (IniSectionGetString(pIniSection,tchIndex,L"",tchDesc,COUNTOF(tchDesc))) {
|
||||
tbbMainWnd[i].iString = SendMessage(hwndToolbar,TB_ADDSTRING,0,(LPARAM)tchDesc);
|
||||
@ -2500,7 +2500,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
}
|
||||
|
||||
else {
|
||||
ExtractFirstArgument(tchTemp,tchExeFile,tchParam);
|
||||
ExtractFirstArgument(tchTemp,tchExeFile,tchParam,MAX_PATH+4);
|
||||
if (PathIsRelative(tchExeFile)) {
|
||||
if (!SearchPath(NULL,tchExeFile,NULL,COUNTOF(tchTemp),tchTemp,NULL)) {
|
||||
GetModuleFileName(NULL,tchTemp,COUNTOF(tchTemp));
|
||||
@ -2556,10 +2556,10 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
GetModuleFileName(NULL,szModuleName,COUNTOF(szModuleName));
|
||||
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"\"-appid=%s\"",g_wchAppUserModelID);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"\"-appid=%s\"",g_wchAppUserModelID);
|
||||
lstrcpy(szParameters,tch);
|
||||
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L" \"-sysmru=%i\"",(flagUseSystemMRU == 2) ? 1 : 0);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L" \"-sysmru=%i\"",(flagUseSystemMRU == 2) ? 1 : 0);
|
||||
lstrcat(szParameters,tch);
|
||||
|
||||
lstrcat(szParameters,L" -f");
|
||||
@ -2594,7 +2594,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
imax = IsZoomed(hwnd);
|
||||
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L" -pos %i,%i,%i,%i,%i",x,y,cx,cy,imax);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L" -pos %i,%i,%i,%i,%i",x,y,cx,cy,imax);
|
||||
lstrcat(szParameters,tch);
|
||||
|
||||
if (LOWORD(wParam) != IDM_FILE_NEWWINDOW2 && lstrlen(szCurFile)) {
|
||||
@ -3418,7 +3418,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
&st,NULL,tchDate,COUNTOF(tchDate));
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT,TIME_NOSECONDS,&st,NULL,tchTime,COUNTOF(tchTime));
|
||||
|
||||
StringCchPrintfW(tchDateTime,COUNTOF(tchDateTime),L"%s %s",tchTime,tchDate);
|
||||
StringCchPrintf(tchDateTime,COUNTOF(tchDateTime),L"%s %s",tchTime,tchDate);
|
||||
}
|
||||
|
||||
UINT uCP = (UINT)SendMessage(hwndEdit, SCI_GETCODEPAGE, 0, 0);
|
||||
@ -4258,11 +4258,11 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
wi.cy = wndpl.rcNormalPosition.bottom - wndpl.rcNormalPosition.top;
|
||||
wi.max = (IsZoomed(hwndMain) || (wndpl.flags & WPF_RESTORETOMAXIMIZED));
|
||||
|
||||
StringCchPrintfW(tchPosX,COUNTOF(tchPosX),L"%ix%i PosX",ResX,ResY);
|
||||
StringCchPrintfW(tchPosY,COUNTOF(tchPosY),L"%ix%i PosY",ResX,ResY);
|
||||
StringCchPrintfW(tchSizeX,COUNTOF(tchSizeX),L"%ix%i SizeX",ResX,ResY);
|
||||
StringCchPrintfW(tchSizeY,COUNTOF(tchSizeY),L"%ix%i SizeY",ResX,ResY);
|
||||
StringCchPrintfW(tchMaximized,COUNTOF(tchMaximized),L"%ix%i Maximized",ResX,ResY);
|
||||
StringCchPrintf(tchPosX,COUNTOF(tchPosX),L"%ix%i PosX",ResX,ResY);
|
||||
StringCchPrintf(tchPosY,COUNTOF(tchPosY),L"%ix%i PosY",ResX,ResY);
|
||||
StringCchPrintf(tchSizeX,COUNTOF(tchSizeX),L"%ix%i SizeX",ResX,ResY);
|
||||
StringCchPrintf(tchSizeY,COUNTOF(tchSizeY),L"%ix%i SizeY",ResX,ResY);
|
||||
StringCchPrintf(tchMaximized,COUNTOF(tchMaximized),L"%ix%i Maximized",ResX,ResY);
|
||||
|
||||
bStickyWinPos = 1;
|
||||
IniSetInt(L"Settings2",L"StickyWindowPosition",1);
|
||||
@ -4751,11 +4751,11 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
int cmdsz = (512 + COUNTOF(szCmdTemplate) + MAX_PATH + 32);
|
||||
lpszCommand = GlobalAlloc(GPTR,sizeof(WCHAR)*cmdsz);
|
||||
StringCchPrintfW(lpszCommand,cmdsz,szCmdTemplate,wszSelection);
|
||||
StringCchPrintf(lpszCommand,cmdsz,szCmdTemplate,wszSelection);
|
||||
ExpandEnvironmentStringsEx(lpszCommand,(DWORD)GlobalSize(lpszCommand)/sizeof(WCHAR));
|
||||
|
||||
lpszArgs = GlobalAlloc(GPTR,GlobalSize(lpszCommand));
|
||||
ExtractFirstArgument(lpszCommand,lpszCommand,lpszArgs);
|
||||
ExtractFirstArgument(lpszCommand,lpszCommand,lpszArgs,cmdsz);
|
||||
|
||||
if (lstrlen(szCurFile)) {
|
||||
lstrcpy(wchDirectory,szCurFile);
|
||||
@ -4976,7 +4976,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
cy = wndpl.rcNormalPosition.bottom - wndpl.rcNormalPosition.top;
|
||||
max = (IsZoomed(hwndMain) || (wndpl.flags & WPF_RESTORETOMAXIMIZED));
|
||||
|
||||
StringCchPrintfW(wszWinPos,COUNTOF(wszWinPos),L"/pos %i,%i,%i,%i,%i",x,y,cx,cy,max);
|
||||
StringCchPrintf(wszWinPos,COUNTOF(wszWinPos),L"/pos %i,%i,%i,%i,%i",x,y,cx,cy,max);
|
||||
|
||||
if (OpenClipboard(hwnd)) {
|
||||
HANDLE hData;
|
||||
@ -5897,11 +5897,16 @@ void LoadSettings()
|
||||
iSciFontQuality = IniSectionGetInt(pIniSection,L"SciFontQuality",-1);
|
||||
iSciFontQuality = max(min(iSciFontQuality,3),-1);
|
||||
|
||||
WCHAR buffer[MIDSZ_BUFFER];
|
||||
const WCHAR defextwsc[] = L".,;:|/-+$%&<>(){}[]=?#'*";
|
||||
WCHAR buffer[MIDSZ_BUFFER] = { L'\0' };
|
||||
const WCHAR defextwsc[] = L"!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"; // underscore counted as part of word
|
||||
IniSectionGetString(pIniSection, L"ExtendedWhiteSpaceChars", defextwsc, buffer, COUNTOF(buffer));
|
||||
if (!lstrlen(buffer)) lstrcpyn(buffer, defextwsc, COUNTOF(buffer));
|
||||
WCHAR2MBCS(CP_ACP,buffer,chExtendedWhiteSpaceChars,COUNTOF(chExtendedWhiteSpaceChars));
|
||||
// clear non-7-bit-ASCII chars
|
||||
for (size_t i = 0; i < strlen(chExtendedWhiteSpaceChars); i++) {
|
||||
if (chExtendedWhiteSpaceChars[i] & ~0x7F)
|
||||
chExtendedWhiteSpaceChars[i] = ' '; // space
|
||||
}
|
||||
|
||||
|
||||
LoadIniSection(L"Toolbar Images",pIniSection,cchIniSection);
|
||||
@ -5919,7 +5924,7 @@ void LoadSettings()
|
||||
LoadIniSection(L"Window", pIniSection, cchIniSection);
|
||||
|
||||
WCHAR tchHighDpiToolBar[32];
|
||||
StringCchPrintfW(tchHighDpiToolBar,COUNTOF(tchHighDpiToolBar),L"%ix%i HighDpiToolBar", ResX, ResY);
|
||||
StringCchPrintf(tchHighDpiToolBar,COUNTOF(tchHighDpiToolBar),L"%ix%i HighDpiToolBar", ResX, ResY);
|
||||
iHighDpiToolBar = IniSectionGetInt(pIniSection, tchHighDpiToolBar, -1);
|
||||
iHighDpiToolBar = max(min(iHighDpiToolBar, 1), -1);
|
||||
if (iHighDpiToolBar < 0) { // undefined: derermine high DPI (higher than Full-HD)
|
||||
@ -5931,11 +5936,11 @@ void LoadSettings()
|
||||
|
||||
WCHAR tchPosX[32], tchPosY[32], tchSizeX[32], tchSizeY[32], tchMaximized[32];
|
||||
|
||||
StringCchPrintfW(tchPosX,COUNTOF(tchPosX),L"%ix%i PosX",ResX,ResY);
|
||||
StringCchPrintfW(tchPosY,COUNTOF(tchPosY),L"%ix%i PosY",ResX,ResY);
|
||||
StringCchPrintfW(tchSizeX,COUNTOF(tchSizeX),L"%ix%i SizeX",ResX,ResY);
|
||||
StringCchPrintfW(tchSizeY,COUNTOF(tchSizeY),L"%ix%i SizeY",ResX,ResY);
|
||||
StringCchPrintfW(tchMaximized,COUNTOF(tchMaximized),L"%ix%i Maximized",ResX,ResY);
|
||||
StringCchPrintf(tchPosX,COUNTOF(tchPosX),L"%ix%i PosX",ResX,ResY);
|
||||
StringCchPrintf(tchPosY,COUNTOF(tchPosY),L"%ix%i PosY",ResX,ResY);
|
||||
StringCchPrintf(tchSizeX,COUNTOF(tchSizeX),L"%ix%i SizeX",ResX,ResY);
|
||||
StringCchPrintf(tchSizeY,COUNTOF(tchSizeY),L"%ix%i SizeY",ResX,ResY);
|
||||
StringCchPrintf(tchMaximized,COUNTOF(tchMaximized),L"%ix%i Maximized",ResX,ResY);
|
||||
|
||||
wi.x = IniSectionGetInt(pIniSection,tchPosX,CW_USEDEFAULT);
|
||||
wi.y = IniSectionGetInt(pIniSection,tchPosY,CW_USEDEFAULT);
|
||||
@ -5948,12 +5953,12 @@ void LoadSettings()
|
||||
// --- override by resolution specific settings ---
|
||||
|
||||
WCHAR tchSciDirectWriteTech[32];
|
||||
StringCchPrintfW(tchSciDirectWriteTech,COUNTOF(tchSciDirectWriteTech),L"%ix%i SciDirectWriteTech",ResX,ResY);
|
||||
StringCchPrintf(tchSciDirectWriteTech,COUNTOF(tchSciDirectWriteTech),L"%ix%i SciDirectWriteTech",ResX,ResY);
|
||||
iSciDirectWriteTech = IniSectionGetInt(pIniSection,tchSciDirectWriteTech,iSciDirectWriteTech);
|
||||
iSciDirectWriteTech = max(min(iSciDirectWriteTech,3),-1);
|
||||
|
||||
WCHAR tchSciFontQuality[32];
|
||||
StringCchPrintfW(tchSciFontQuality,COUNTOF(tchSciFontQuality),L"%ix%i SciFontQuality",ResX,ResY);
|
||||
StringCchPrintf(tchSciFontQuality,COUNTOF(tchSciFontQuality),L"%ix%i SciFontQuality",ResX,ResY);
|
||||
iSciFontQuality = IniSectionGetInt(pIniSection,tchSciFontQuality,iSciFontQuality);
|
||||
iSciFontQuality = max(min(iSciFontQuality,3),-1);
|
||||
|
||||
@ -6117,18 +6122,18 @@ void SaveSettings(BOOL bSaveSettingsNow) {
|
||||
int ResY = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
WCHAR tchHighDpiToolBar[32];
|
||||
StringCchPrintfW(tchHighDpiToolBar,COUNTOF(tchHighDpiToolBar),L"%ix%i HighDpiToolBar", ResX, ResY);
|
||||
StringCchPrintf(tchHighDpiToolBar,COUNTOF(tchHighDpiToolBar),L"%ix%i HighDpiToolBar", ResX, ResY);
|
||||
IniSetInt(L"Window", tchHighDpiToolBar, iHighDpiToolBar);
|
||||
|
||||
if (!IniGetInt(L"Settings2",L"StickyWindowPosition",0)) {
|
||||
|
||||
WCHAR tchPosX[32], tchPosY[32], tchSizeX[32], tchSizeY[32], tchMaximized[32];
|
||||
|
||||
StringCchPrintfW(tchPosX,COUNTOF(tchPosX),L"%ix%i PosX",ResX,ResY);
|
||||
StringCchPrintfW(tchPosY,COUNTOF(tchPosY),L"%ix%i PosY",ResX,ResY);
|
||||
StringCchPrintfW(tchSizeX,COUNTOF(tchSizeX),L"%ix%i SizeX",ResX,ResY);
|
||||
StringCchPrintfW(tchSizeY,COUNTOF(tchSizeY),L"%ix%i SizeY",ResX,ResY);
|
||||
StringCchPrintfW(tchMaximized,COUNTOF(tchMaximized),L"%ix%i Maximized",ResX,ResY);
|
||||
StringCchPrintf(tchPosX,COUNTOF(tchPosX),L"%ix%i PosX",ResX,ResY);
|
||||
StringCchPrintf(tchPosY,COUNTOF(tchPosY),L"%ix%i PosY",ResX,ResY);
|
||||
StringCchPrintf(tchSizeX,COUNTOF(tchSizeX),L"%ix%i SizeX",ResX,ResY);
|
||||
StringCchPrintf(tchSizeY,COUNTOF(tchSizeY),L"%ix%i SizeY",ResX,ResY);
|
||||
StringCchPrintf(tchMaximized,COUNTOF(tchMaximized),L"%ix%i Maximized",ResX,ResY);
|
||||
|
||||
IniSetInt(L"Window",tchPosX,wi.x);
|
||||
IniSetInt(L"Window",tchPosY,wi.y);
|
||||
@ -6164,14 +6169,15 @@ void ParseCommandLine()
|
||||
// Good old console can also send args separated by Tabs
|
||||
StrTab2Space(lpCmdLine);
|
||||
|
||||
lp1 = LocalAlloc(LPTR,sizeof(WCHAR)*(lstrlen(lpCmdLine) + 1));
|
||||
lp2 = LocalAlloc(LPTR,sizeof(WCHAR)*(lstrlen(lpCmdLine) + 1));
|
||||
lp3 = LocalAlloc(LPTR,sizeof(WCHAR)*(lstrlen(lpCmdLine) + 1));
|
||||
int len = lstrlen(lpCmdLine) + 1;
|
||||
lp1 = LocalAlloc(LPTR,sizeof(WCHAR)*len);
|
||||
lp2 = LocalAlloc(LPTR,sizeof(WCHAR)*len);
|
||||
lp3 = LocalAlloc(LPTR,sizeof(WCHAR)*len);
|
||||
|
||||
// Start with 2nd argument
|
||||
ExtractFirstArgument(lpCmdLine,lp1,lp3);
|
||||
ExtractFirstArgument(lpCmdLine,lp1,lp3,len);
|
||||
|
||||
while (bContinue && ExtractFirstArgument(lp3,lp1,lp2))
|
||||
while (bContinue && ExtractFirstArgument(lp3,lp1,lp2,len))
|
||||
{
|
||||
|
||||
// options
|
||||
@ -6254,7 +6260,7 @@ void ParseCommandLine()
|
||||
case L'F':
|
||||
if (*(lp1+1) == L'0' || *CharUpper(lp1+1) == L'O')
|
||||
lstrcpy(szIniFile,L"*?");
|
||||
else if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
else if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
StrCpyN(szIniFile,lp1,COUNTOF(szIniFile));
|
||||
TrimString(szIniFile);
|
||||
PathUnquoteSpaces(szIniFile);
|
||||
@ -6283,7 +6289,7 @@ void ParseCommandLine()
|
||||
lp += 1;
|
||||
else if (bIsNotepadReplacement) {
|
||||
if (*(lp1+1) == L'T')
|
||||
ExtractFirstArgument(lp2,lp1,lp2);
|
||||
ExtractFirstArgument(lp2,lp1,lp2,len);
|
||||
break;
|
||||
}
|
||||
if (*(lp+1) == L'0' || *CharUpper(lp+1) == L'O') {
|
||||
@ -6329,7 +6335,7 @@ void ParseCommandLine()
|
||||
p = CharNext(p);
|
||||
}
|
||||
}
|
||||
else if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
else if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
int itok =
|
||||
swscanf_s(lp1,L"%i,%i,%i,%i,%i",&wi.x,&wi.y,&wi.cx,&wi.cy,&wi.max);
|
||||
if (itok == 4 || itok == 5) { // scan successful
|
||||
@ -6345,7 +6351,7 @@ void ParseCommandLine()
|
||||
break;
|
||||
|
||||
case L'T':
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
StrCpyN(szTitleExcerpt,lp1,COUNTOF(szTitleExcerpt));
|
||||
fKeepTitleExcerpt = 1;
|
||||
}
|
||||
@ -6360,7 +6366,7 @@ void ParseCommandLine()
|
||||
break;
|
||||
|
||||
case L'E':
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
if (lpEncodingArg)
|
||||
LocalFree(lpEncodingArg);
|
||||
lpEncodingArg = StrDup(lp1);
|
||||
@ -6368,7 +6374,7 @@ void ParseCommandLine()
|
||||
break;
|
||||
|
||||
case L'G':
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
int itok =
|
||||
swscanf_s(lp1,L"%i,%i",&iInitialLine,&iInitialColumn);
|
||||
if (itok == 1 || itok == 2) { // scan successful
|
||||
@ -6390,7 +6396,7 @@ void ParseCommandLine()
|
||||
if (StrChr(lp1,L'B'))
|
||||
bTransBS = TRUE;
|
||||
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
if (lpMatchArg)
|
||||
GlobalFree(lpMatchArg);
|
||||
lpMatchArg = StrDup(lp1);
|
||||
@ -6424,7 +6430,7 @@ void ParseCommandLine()
|
||||
break;
|
||||
|
||||
case L'S':
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2,len)) {
|
||||
if (lpSchemeArg)
|
||||
LocalFree(lpSchemeArg);
|
||||
lpSchemeArg = StrDup(lp1);
|
||||
@ -6464,7 +6470,7 @@ void ParseCommandLine()
|
||||
break;
|
||||
|
||||
case L'Z':
|
||||
ExtractFirstArgument(lp2,lp1,lp2);
|
||||
ExtractFirstArgument(lp2,lp1,lp2,len);
|
||||
flagMultiFileArg = 1;
|
||||
bIsNotepadReplacement = TRUE;
|
||||
break;
|
||||
@ -6489,7 +6495,7 @@ void ParseCommandLine()
|
||||
// pathname
|
||||
else
|
||||
{
|
||||
LPWSTR lpFileBuf = LocalAlloc(LPTR,sizeof(WCHAR)*(lstrlen(lpCmdLine) + 1));
|
||||
LPWSTR lpFileBuf = LocalAlloc(LPTR,sizeof(WCHAR)*len);
|
||||
|
||||
cchiFileList = lstrlen(lpCmdLine) - lstrlen(lp3);
|
||||
|
||||
@ -6513,7 +6519,7 @@ void ParseCommandLine()
|
||||
|
||||
StrTrim(lpFileArg,L" \"");
|
||||
|
||||
while (cFileList < 32 && ExtractFirstArgument(lp3,lpFileBuf,lp3)) {
|
||||
while (cFileList < 32 && ExtractFirstArgument(lp3,lpFileBuf,lp3,len)) {
|
||||
PathQuoteSpaces(lpFileBuf);
|
||||
lpFileList[cFileList++] = StrDup(lpFileBuf);
|
||||
}
|
||||
@ -6711,8 +6717,8 @@ int FindIniFile() {
|
||||
}
|
||||
|
||||
// normalize path
|
||||
PathCanonicalizeEx(szIniFile);
|
||||
GetLongPathNameEx(szIniFile, COUNTOF(szIniFile));
|
||||
PathCanonicalizeEx(szIniFile,COUNTOF(szIniFile));
|
||||
GetLongPathNameEx(szIniFile,COUNTOF(szIniFile));
|
||||
|
||||
return(1);
|
||||
}
|
||||
@ -6875,26 +6881,26 @@ void UpdateStatusbar()
|
||||
iPos = (int)SendMessage(hwndEdit,SCI_GETCURRENTPOS,0,0);
|
||||
|
||||
iLn = (int)SendMessage(hwndEdit,SCI_LINEFROMPOSITION,iPos,0) + 1;
|
||||
StringCchPrintfW(tchLn,COUNTOF(tchLn),L"%i",iLn);
|
||||
StringCchPrintf(tchLn,COUNTOF(tchLn),L"%i",iLn);
|
||||
FormatNumberStr(tchLn);
|
||||
|
||||
iLines = (int)SendMessage(hwndEdit,SCI_GETLINECOUNT,0,0);
|
||||
StringCchPrintfW(tchLines,COUNTOF(tchLines),L"%i",iLines);
|
||||
StringCchPrintf(tchLines,COUNTOF(tchLines),L"%i",iLines);
|
||||
FormatNumberStr(tchLines);
|
||||
|
||||
iCol = (int)SendMessage(hwndEdit,SCI_GETCOLUMN,iPos,0) + 1;
|
||||
StringCchPrintfW(tchCol,COUNTOF(tchCol),L"%i",iCol);
|
||||
StringCchPrintf(tchCol,COUNTOF(tchCol),L"%i",iCol);
|
||||
FormatNumberStr(tchCol);
|
||||
|
||||
if (bMarkLongLines) {
|
||||
StringCchPrintfW(tchCols,COUNTOF(tchCols),L"%i",iLongLinesLimit);
|
||||
StringCchPrintf(tchCols,COUNTOF(tchCols),L"%i",iLongLinesLimit);
|
||||
FormatNumberStr(tchCols);
|
||||
}
|
||||
|
||||
if (SC_SEL_RECTANGLE != SendMessage(hwndEdit,SCI_GETSELECTIONMODE,0,0))
|
||||
{
|
||||
iSel = (int)SendMessage(hwndEdit,SCI_GETSELECTIONEND,0,0) - (int)SendMessage(hwndEdit,SCI_GETSELECTIONSTART,0,0);
|
||||
StringCchPrintfW(tchSel,COUNTOF(tchSel),L"%i",iSel);
|
||||
StringCchPrintf(tchSel,COUNTOF(tchSel),L"%i",iSel);
|
||||
FormatNumberStr(tchSel);
|
||||
}
|
||||
else
|
||||
@ -6908,7 +6914,7 @@ void UpdateStatusbar()
|
||||
iStartOfLinePos = (int)SendMessage( hwndEdit , SCI_POSITIONFROMLINE , iLineEnd , 0 );
|
||||
iLinesSelected = iLineEnd - iLineStart;
|
||||
if( iSelStart != iSelEnd && iStartOfLinePos != iSelEnd ) iLinesSelected += 1;
|
||||
StringCchPrintfW(tchLinesSelected,COUNTOF(tchLinesSelected),L"%i",iLinesSelected);
|
||||
StringCchPrintf(tchLinesSelected,COUNTOF(tchLinesSelected),L"%i",iLinesSelected);
|
||||
FormatNumberStr(tchLinesSelected);
|
||||
|
||||
if (!bMarkLongLines)
|
||||
@ -7224,7 +7230,7 @@ BOOL FileLoad(BOOL bDontSave,BOOL bNew,BOOL bReload,BOOL bNoEncDetect,LPCWSTR lp
|
||||
else
|
||||
lstrcpy(szFileName,tch);
|
||||
|
||||
PathCanonicalizeEx(szFileName);
|
||||
PathCanonicalizeEx(szFileName,COUNTOF(szFileName));
|
||||
GetLongPathNameEx(szFileName,COUNTOF(szFileName));
|
||||
|
||||
if (PathIsLnkFile(szFileName))
|
||||
@ -7925,9 +7931,10 @@ BOOL RelaunchElevated() {
|
||||
GetStartupInfo(&si);
|
||||
|
||||
lpCmdLine = GetCommandLine();
|
||||
lpArg1 = LocalAlloc(LPTR,sizeof(WCHAR)*(lstrlen(lpCmdLine) + 1));
|
||||
lpArg2 = LocalAlloc(LPTR,sizeof(WCHAR)*(lstrlen(lpCmdLine) + 1));
|
||||
ExtractFirstArgument(lpCmdLine,lpArg1,lpArg2);
|
||||
int len = lstrlen(lpCmdLine) + 1;
|
||||
lpArg1 = LocalAlloc(LPTR,sizeof(WCHAR)*len);
|
||||
lpArg2 = LocalAlloc(LPTR,sizeof(WCHAR)*len);
|
||||
ExtractFirstArgument(lpCmdLine,lpArg1,lpArg2,len);
|
||||
|
||||
if (lstrlen(lpArg1)) {
|
||||
|
||||
@ -8055,7 +8062,7 @@ void SetNotifyIconTitle(HWND hwnd)
|
||||
|
||||
if (lstrlen(szTitleExcerpt)) {
|
||||
GetString(IDS_TITLEEXCERPT,tchFormat,COUNTOF(tchFormat));
|
||||
StringCchPrintfW(tchTitle,COUNTOF(tchTitle),tchFormat,szTitleExcerpt);
|
||||
StringCchPrintf(tchTitle,COUNTOF(tchTitle),tchFormat,szTitleExcerpt);
|
||||
}
|
||||
|
||||
else if (lstrlen(szCurFile)) {
|
||||
|
||||
40
src/Styles.c
40
src/Styles.c
@ -2694,7 +2694,7 @@ void Style_Load()
|
||||
int itok;
|
||||
int irgb;
|
||||
WCHAR wch[32];
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%02i",i+1);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%02i",i+1);
|
||||
if (IniSectionGetString(pIniSection,tch,L"",wch,COUNTOF(wch))) {
|
||||
if (wch[0] == L'#') {
|
||||
itok = swscanf_s(CharNext(wch),L"%x",&irgb);
|
||||
@ -2753,8 +2753,8 @@ void Style_Save()
|
||||
// Custom colors
|
||||
for (i = 0; i < 16; i++) {
|
||||
WCHAR wch[32];
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%02i",i+1);
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%02i",i+1);
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"#%02X%02X%02X",
|
||||
(int)GetRValue(crCustom[i]),(int)GetGValue(crCustom[i]),(int)GetBValue(crCustom[i]));
|
||||
IniSectionSetString(pIniSection,tch,wch);
|
||||
}
|
||||
@ -3046,10 +3046,10 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
|
||||
lstrcpyn(wchStyle,lexDefault.Styles[7+iIdx].szValue,COUNTOF(lexDefault.Styles[0].szValue));
|
||||
|
||||
iValue = max(min(iValue,5),0);
|
||||
StringCchPrintfW(lexDefault.Styles[7+iIdx].szValue,EDSTYLE_BUFFER,L"size:%i",iValue);
|
||||
StringCchPrintf(lexDefault.Styles[7+iIdx].szValue,EDSTYLE_BUFFER,L"size:%i",iValue);
|
||||
|
||||
if (Style_StrGetColor(TRUE,wchStyle,&rgb)) {
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X",
|
||||
(int)GetRValue(rgb),
|
||||
(int)GetGValue(rgb),
|
||||
(int)GetBValue(rgb));
|
||||
@ -3057,7 +3057,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
|
||||
}
|
||||
|
||||
if (Style_StrGetColor(FALSE,wchStyle,&rgb)) {
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"; back:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"; back:#%02X%02X%02X",
|
||||
(int)GetRValue(rgb),
|
||||
(int)GetGValue(rgb),
|
||||
(int)GetBValue(rgb));
|
||||
@ -3094,7 +3094,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
|
||||
iValue = 1;
|
||||
if (Style_StrGetSize(lexDefault.Styles[9+iIdx].szValue,&iValue)) {
|
||||
iValue = max(min(iValue,3),1);
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"size:%i",iValue);
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"size:%i",iValue);
|
||||
lstrcat(wchCaretStyle,wch);
|
||||
}
|
||||
SendMessage(hwnd,SCI_SETCARETSTYLE,CARETSTYLE_LINE,0);
|
||||
@ -3114,7 +3114,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
|
||||
rgb = GetSysColor(COLOR_WINDOWTEXT);
|
||||
else {
|
||||
WCHAR wch[32];
|
||||
StringCchPrintfW(wch,COUNTOF(wch),L"fore:#%02X%02X%02X",
|
||||
StringCchPrintf(wch,COUNTOF(wch),L"fore:#%02X%02X%02X",
|
||||
(int)GetRValue(rgb),
|
||||
(int)GetGValue(rgb),
|
||||
(int)GetBValue(rgb));
|
||||
@ -3146,7 +3146,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
|
||||
int iAscent = 0;
|
||||
int iDescent = 0;
|
||||
iValue = min(max(iValue,0),64);
|
||||
StringCchPrintfW(lexDefault.Styles[11+iIdx].szValue,EDSTYLE_BUFFER,L"size:%i",iValue);
|
||||
StringCchPrintf(lexDefault.Styles[11+iIdx].szValue,EDSTYLE_BUFFER,L"size:%i",iValue);
|
||||
if (iValue % 2) {
|
||||
iAscent++;
|
||||
iValue--;
|
||||
@ -4013,11 +4013,11 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
|
||||
lf.lfCharSet != ANSI_CHARSET &&
|
||||
lf.lfCharSet != iDefaultCharSet) {
|
||||
lstrcat(szNewStyle,L"; charset:");
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%i",lf.lfCharSet);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%i",lf.lfCharSet);
|
||||
lstrcat(szNewStyle,tch);
|
||||
}
|
||||
lstrcat(szNewStyle,L"; size:");
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%i",cf.iPointSize/10);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%i",cf.iPointSize/10);
|
||||
lstrcat(szNewStyle,tch);
|
||||
if (cf.nFontType & BOLD_FONTTYPE)
|
||||
lstrcat(szNewStyle,L"; bold");
|
||||
@ -4030,7 +4030,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
|
||||
// save colors
|
||||
if (Style_StrGetColor(TRUE,lpszStyle,&iValue))
|
||||
{
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X",
|
||||
(int)GetRValue(iValue),
|
||||
(int)GetGValue(iValue),
|
||||
(int)GetBValue(iValue));
|
||||
@ -4038,7 +4038,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
|
||||
}
|
||||
if (Style_StrGetColor(FALSE,lpszStyle,&iValue))
|
||||
{
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"; back:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"; back:#%02X%02X%02X",
|
||||
(int)GetRValue(iValue),
|
||||
(int)GetGValue(iValue),
|
||||
(int)GetBValue(iValue));
|
||||
@ -4055,7 +4055,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
|
||||
|
||||
if (Style_StrGetAlpha(lpszStyle,&iValue)) {
|
||||
lstrcat(szNewStyle,L"; alpha:");
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%i",iValue);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%i",iValue);
|
||||
lstrcat(szNewStyle,tch);
|
||||
}
|
||||
|
||||
@ -4110,7 +4110,7 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
|
||||
{
|
||||
if (lstrlen(szNewStyle))
|
||||
lstrcat(szNewStyle,L"; ");
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"charset:%i",iValue);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"charset:%i",iValue);
|
||||
lstrcat(szNewStyle,tch);
|
||||
}
|
||||
if (Style_StrGetSizeStr(lpszStyle,tch,COUNTOF(tch)))
|
||||
@ -4144,14 +4144,14 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
|
||||
{
|
||||
if (lstrlen(szNewStyle))
|
||||
lstrcat(szNewStyle,L"; ");
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"fore:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"fore:#%02X%02X%02X",
|
||||
(int)GetRValue(iRGBResult),
|
||||
(int)GetGValue(iRGBResult),
|
||||
(int)GetBValue(iRGBResult));
|
||||
lstrcat(szNewStyle,tch);
|
||||
if (Style_StrGetColor(FALSE,lpszStyle,&iValue))
|
||||
{
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"; back:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"; back:#%02X%02X%02X",
|
||||
(int)GetRValue(iValue),
|
||||
(int)GetGValue(iValue),
|
||||
(int)GetBValue(iValue));
|
||||
@ -4164,13 +4164,13 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
|
||||
lstrcat(szNewStyle,L"; ");
|
||||
if (Style_StrGetColor(TRUE,lpszStyle,&iValue))
|
||||
{
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"fore:#%02X%02X%02X; ",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"fore:#%02X%02X%02X; ",
|
||||
(int)GetRValue(iValue),
|
||||
(int)GetGValue(iValue),
|
||||
(int)GetBValue(iValue));
|
||||
lstrcat(szNewStyle,tch);
|
||||
}
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"back:#%02X%02X%02X",
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"back:#%02X%02X%02X",
|
||||
(int)GetRValue(iRGBResult),
|
||||
(int)GetGValue(iRGBResult),
|
||||
(int)GetBValue(iRGBResult));
|
||||
@ -4187,7 +4187,7 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
|
||||
|
||||
if (Style_StrGetAlpha(lpszStyle,&iValue)) {
|
||||
lstrcat(szNewStyle,L"; alpha:");
|
||||
StringCchPrintfW(tch,COUNTOF(tch),L"%i",iValue);
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%i",iValue);
|
||||
lstrcat(szNewStyle,tch);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user