diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/SendScreenshotPlus | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
less TCHARs:
- TCHAR is replaced with wchar_t everywhere;
- LPGENT replaced with either LPGENW or LPGEN;
- fixes for ANSI plugins that improperly used _t functions;
- TCHAR *t removed from MAllStrings;
- ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz*
git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus')
18 files changed, 180 insertions, 180 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index eb4b9dcc61..1a9f0de514 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -94,7 +94,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(ICO_MAIN)); { CSend* self = (CSend*)lParam; - TCHAR* tmp = mir_tstrdup(TranslateT("Resulting URL from\n")); + wchar_t* tmp = mir_tstrdup(TranslateT("Resulting URL from\n")); mir_tstradd(tmp, self->m_pszSendTyp); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tmp); mir_free(tmp); @@ -124,16 +124,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case ID_btnCopy: case ID_btnThumbCopy: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_COPY)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy"), BATF_TCHAR); break; case ID_btnBBC: case ID_btnThumbBBC: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBC)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy BBCode"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode"), BATF_TCHAR); break; default: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBCLNK)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy BBCode w/ link"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode w/ link"), BATF_TCHAR); } } } @@ -151,7 +151,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case ID_btnBBC: case ID_btnThumbBBC: case ID_btnThumbBBC2: - TCHAR tmp[2048]; + wchar_t tmp[2048]; int edtID = ID_edtURL; int bbc = 0; switch (LOWORD(wParam)) { @@ -166,16 +166,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, size_t len; if (bbc) { if (bbc == 1) { - memcpy(tmp, L"[img]", 5 * sizeof(TCHAR)); len = 5; + memcpy(tmp, L"[img]", 5 * sizeof(wchar_t)); len = 5; len += GetDlgItemText(hwndDlg, edtID, tmp + len, 2048 - 11); - memcpy(tmp + len, L"[/img]", 7 * sizeof(TCHAR)); len += 7; + memcpy(tmp + len, L"[/img]", 7 * sizeof(wchar_t)); len += 7; } else { - memcpy(tmp, L"[url=", 5 * sizeof(TCHAR)); len = 5; + memcpy(tmp, L"[url=", 5 * sizeof(wchar_t)); len = 5; len += GetDlgItemText(hwndDlg, ID_edtURL, tmp + len, 1024); - memcpy(tmp + len, L"][img]", 6 * sizeof(TCHAR)); len += 6; + memcpy(tmp + len, L"][img]", 6 * sizeof(wchar_t)); len += 6; len += GetDlgItemText(hwndDlg, edtID, tmp + len, 1024); - memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(TCHAR)); len += 12; + memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(wchar_t)); len += 12; } } else @@ -187,8 +187,8 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, continue; } EmptyClipboard(); - HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(TCHAR) + sizeof(TCHAR)); - TCHAR* tmp2 = (TCHAR*)GlobalLock(clipbuffer); + HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(wchar_t) + sizeof(wchar_t)); + wchar_t* tmp2 = (wchar_t*)GlobalLock(clipbuffer); mir_tstrncpy(tmp2, tmp, len + 1); tmp2[len] = '\0'; GlobalUnlock(clipbuffer); SetClipboardData(CF_UNICODETEXT, clipbuffer); @@ -215,7 +215,7 @@ void CSend::svcSendMsgExit(const char* szMessage) Exit(CSEND_DIALOG); return; } if (m_ChatRoom) { - TCHAR* tmp = mir_a2t(szMessage); + wchar_t* tmp = mir_a2t(szMessage); if (m_pszFileDesc) { mir_tstradd(tmp, L"\r\n"); mir_tstradd(tmp, m_pszFileDesc); @@ -282,7 +282,7 @@ void CSend::svcSendFileExit() Exit(ACKRESULT_SUCCESS); return; } if (!m_hContact) { - Error(LPGENT("%s requires a valid contact!"), m_pszSendTyp); + Error(LPGENW("%s requires a valid contact!"), m_pszSendTyp); Exit(ACKRESULT_FAILED); return; } mir_freeAndNil(m_szEventMsg); @@ -307,8 +307,8 @@ void CSend::svcSendFileExit() } // Start miranda PSS_FILE based on mir ver (T) - TCHAR* ppFile[2] = { 0, 0 }; - TCHAR* pDesc = mir_tstrdup(m_pszFileDesc); + wchar_t* ppFile[2] = { 0, 0 }; + wchar_t* pDesc = mir_tstrdup(m_pszFileDesc); ppFile[0] = mir_tstrdup(m_pszFile); ppFile[1] = NULL; m_hSend = (HANDLE)ProtoChainSend(m_hContact, PSS_FILE, (WPARAM)pDesc, (LPARAM)ppFile); @@ -336,13 +336,13 @@ int CSend::OnSend(void *obj, WPARAM, LPARAM lParam) */ switch (ack->result) { - case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENT("Initialising..."), FTS_TEXT); break; - case ACKRESULT_CONNECTING: //SetFtStatus(hwndDlg, LPGENT("Connecting..."), FTS_TEXT); break; - case ACKRESULT_CONNECTPROXY: //SetFtStatus(hwndDlg, LPGENT("Connecting to proxy..."), FTS_TEXT); break; - case ACKRESULT_LISTENING: //SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); break; - case ACKRESULT_CONNECTED: //SetFtStatus(hwndDlg, LPGENT("Connected"), FTS_TEXT); break; - case ACKRESULT_SENTREQUEST: //SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break; - case ACKRESULT_NEXTFILE: //SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT); + case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENW("Initialising..."), FTS_TEXT); break; + case ACKRESULT_CONNECTING: //SetFtStatus(hwndDlg, LPGENW("Connecting..."), FTS_TEXT); break; + case ACKRESULT_CONNECTPROXY: //SetFtStatus(hwndDlg, LPGENW("Connecting to proxy..."), FTS_TEXT); break; + case ACKRESULT_LISTENING: //SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); break; + case ACKRESULT_CONNECTED: //SetFtStatus(hwndDlg, LPGENW("Connected"), FTS_TEXT); break; + case ACKRESULT_SENTREQUEST: //SetFtStatus(hwndDlg, LPGENW("Decision sent"), FTS_TEXT); break; + case ACKRESULT_NEXTFILE: //SetFtStatus(hwndDlg, LPGENW("Moving to next file..."), FTS_TEXT); case ACKRESULT_FILERESUME: // case ACKRESULT_DATA: //transfer is on progress break; @@ -397,7 +397,7 @@ void CSend::DB_EventAdd(WORD EventType) //--------------------------------------------------------------------------- void CSend::Error(LPCTSTR pszFormat, ...) { - TCHAR tszMsg[MAX_SECONDLINE]; + wchar_t tszMsg[MAX_SECONDLINE]; mir_sntprintf(tszMsg, L"%s - %s", _T(SZ_SENDSS), TranslateT("Error")); mir_free(m_ErrorTitle), m_ErrorTitle = mir_tstrdup(tszMsg); @@ -456,7 +456,7 @@ void CSend::Exit(unsigned int Result) if (err) { SkinPlaySound("FileFailed"); if (m_ErrorMsg) MsgBoxService(NULL, (LPARAM)&m_box); - else MsgErr(NULL, LPGENT("An unknown error has occurred.")); + else MsgErr(NULL, LPGENW("An unknown error has occurred.")); } } if (m_pszFile && *m_pszFile && m_bDeleteAfterSend && m_EnableItem&SS_DLG_DELETEAFTERSSEND) { diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 9ff63828de..293e34f077 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -42,10 +42,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define GC_RESULT_ERROR 202 #define GC_RESULT_NOSESSION 209 -const TCHAR SS_ERR_INIT[] =LPGENT("Unable to initiate %s."); -const TCHAR SS_ERR_MAPI[] =LPGENT("MAPI error (%i):\n%s."); -const TCHAR SS_ERR_RESPONSE[] =LPGENT("Unknown response from %s (%i)"); -const TCHAR SS_ERR_NORESPONSE[] =LPGENT("Got no response from %s (%i)"); +const wchar_t SS_ERR_INIT[] =LPGENW("Unable to initiate %s."); +const wchar_t SS_ERR_MAPI[] =LPGENW("MAPI error (%i):\n%s."); +const wchar_t SS_ERR_RESPONSE[] =LPGENW("Unknown response from %s (%i)"); +const wchar_t SS_ERR_NORESPONSE[] =LPGENW("Got no response from %s (%i)"); //--------------------------------------------------------------------------- class CSend { @@ -56,25 +56,25 @@ class CSend { virtual int Send() = NULL; // returns 1 if sent (you must delete class) and 0 when still sending (class deletes itself) int SendSilent() {m_bAsync=m_bSilent=true; return Send();}; - void SetFile(TCHAR* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);}; + void SetFile(wchar_t* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);}; void SetFile(char* file){mir_free(m_pszFile), m_pszFile=mir_a2t(file);}; - void SetDescription(TCHAR* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);}; + void SetDescription(wchar_t* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);}; void SetContact(MCONTACT hContact); char* GetURL(){return m_URL;}; char* GetURLthumbnail(){return m_URLthumb;}; BYTE GetEnableItem() {return m_EnableItem;}; - TCHAR* GetErrorMsg() {return m_ErrorMsg;}; + wchar_t* GetErrorMsg() {return m_ErrorMsg;}; bool m_bDeleteAfterSend; protected: bool m_bAsync; bool m_bSilent; - TCHAR* m_pszFile; - TCHAR* m_pszFileDesc; + wchar_t* m_pszFile; + wchar_t* m_pszFileDesc; char* m_URL; char* m_URLthumb; static int OnSend(void *obj, WPARAM wParam, LPARAM lParam); - TCHAR* m_pszSendTyp; //hold string for error mess + wchar_t* m_pszSendTyp; //hold string for error mess char* m_pszProto; //Contact Proto Modul MCONTACT m_hContact; //Contact handle BYTE m_EnableItem; //hold flag for send type @@ -94,8 +94,8 @@ class CSend { HANDLE m_hOnSend; //HookEventObj on ME_PROTO_ACK MSGBOX m_box; - TCHAR* m_ErrorMsg; - TCHAR* m_ErrorTitle; + wchar_t* m_ErrorMsg; + wchar_t* m_ErrorTitle; void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = NULL;}} void DB_EventAdd(WORD EventType); diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp index 62203d6ccd..47b7f778e6 100644 --- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp +++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp @@ -60,7 +60,7 @@ void CSendDropbox::SendThread() if (CallService(MS_DROPBOX_UPLOAD, (WPARAM)&m_URL, (LPARAM)&ui)) { - Error(LPGENT("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0); + Error(LPGENW("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0); Exit(ACKRESULT_FAILED); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp index 99fa9304ea..dc91c4a867 100644 --- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp +++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp @@ -35,7 +35,7 @@ CSendEmail::CSendEmail(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_DELETEAFTERSSEND; // SS_DLG_AUTOSEND | ; - m_pszSendTyp = LPGENT("Email transfer"); + m_pszSendTyp = LPGENW("Email transfer"); m_pszFileA = NULL; m_pszFileName = NULL; m_Email = NULL; @@ -136,53 +136,53 @@ void CSendEmail::SendThread() int res = lpMAPISendMail(NULL, NULL, &Msg, MAPI_LOGON_UI | MAPI_DIALOG, 0); ::FreeLibrary(hMAPILib); - TCHAR* err; + wchar_t* err; switch (res) { case SUCCESS_SUCCESS: //The call succeeded and the message was sent. Exit(ACKRESULT_SUCCESS); return; // No message was sent case MAPI_E_AMBIGUOUS_RECIPIENT: - err = LPGENT("A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set"); + err = LPGENW("A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set"); break; case MAPI_E_ATTACHMENT_NOT_FOUND: - err = LPGENT("The specified attachment was not found"); + err = LPGENW("The specified attachment was not found"); break; case MAPI_E_ATTACHMENT_OPEN_FAILURE: - err = LPGENT("The specified attachment could not be opened"); + err = LPGENW("The specified attachment could not be opened"); break; case MAPI_E_BAD_RECIPTYPE: - err = LPGENT("The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC"); + err = LPGENW("The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC"); break; case MAPI_E_FAILURE: - err = LPGENT("One or more unspecified errors occurred"); + err = LPGENW("One or more unspecified errors occurred"); break; case MAPI_E_INSUFFICIENT_MEMORY: - err = LPGENT("There was insufficient memory to proceed"); + err = LPGENW("There was insufficient memory to proceed"); break; case MAPI_E_INVALID_RECIPS: - err = LPGENT("One or more recipients were invalid or did not resolve to any address"); + err = LPGENW("One or more recipients were invalid or did not resolve to any address"); break; case MAPI_E_LOGIN_FAILURE: - err = LPGENT("There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed"); + err = LPGENW("There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed"); break; case MAPI_E_TEXT_TOO_LARGE: - err = LPGENT("The text in the message was too large"); + err = LPGENW("The text in the message was too large"); break; case MAPI_E_TOO_MANY_FILES: - err = LPGENT("There were too many file attachments"); + err = LPGENW("There were too many file attachments"); break; case MAPI_E_TOO_MANY_RECIPIENTS: - err = LPGENT("There were too many recipients"); + err = LPGENW("There were too many recipients"); break; case MAPI_E_UNKNOWN_RECIPIENT: - err = LPGENT("A recipient did not appear in the address list"); + err = LPGENW("A recipient did not appear in the address list"); break; case MAPI_E_USER_ABORT: - err = LPGENT("The user canceled one of the dialog boxes"); + err = LPGENW("The user canceled one of the dialog boxes"); break; default: - err = LPGENT("Unknown Error"); + err = LPGENW("Unknown Error"); break; } Error(SS_ERR_MAPI, res, err); diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp index a6cd2dcc29..3267ecdd14 100644 --- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp @@ -35,7 +35,7 @@ CSendFTPFile::CSendFTPFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = 0; //SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("FTPFile transfer"); + m_pszSendTyp = LPGENW("FTPFile transfer"); m_pszFileName = NULL; } @@ -74,7 +74,7 @@ void CSendFTPFile::SendThread() INT_PTR ret = FTPFileUploadA(m_hContact, FNUM_DEFAULT, FMODE_RAWFILE, &m_pszFileName, 1); if (ret != 0) { - Error(LPGENT("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret); + Error(LPGENW("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret); Exit(ret); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendFile.cpp b/plugins/SendScreenshotPlus/src/CSendFile.cpp index 4c6ce014ee..d94aa4c5cf 100644 --- a/plugins/SendScreenshotPlus/src/CSendFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFile.cpp @@ -34,7 +34,7 @@ CSendFile::CSendFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND | SS_DLG_DESCRIPTION; - m_pszSendTyp = LPGENT("File transfer"); + m_pszSendTyp = LPGENW("File transfer"); } CSendFile::~CSendFile() diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index cea7ece543..636b49d1b3 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -38,7 +38,7 @@ CSendHTTPServer::CSendHTTPServer(HWND Owner, MCONTACT hContact, bool /*bAsync*/) : CSend(Owner, hContact, true) { m_EnableItem = SS_DLG_DESCRIPTION; //| SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("HTTPServer transfer"); + m_pszSendTyp = LPGENW("HTTPServer transfer"); m_pszFileName = NULL; m_fsi_pszSrvPath = NULL; m_fsi_pszRealPath = NULL; @@ -56,7 +56,7 @@ int CSendHTTPServer::Send() { if (!m_hContact) return 1; if (CallService(MS_HTTP_ACCEPT_CONNECTIONS, TRUE, 0) != 0) { - Error(LPGENT("Could not start the HTTP Server plugin.")); + Error(LPGENW("Could not start the HTTP Server plugin.")); Exit(ACKRESULT_FAILED); return !m_bAsync; } @@ -102,7 +102,7 @@ void CSendHTTPServer::SendThread() } if (ret != 0) { - Error(LPGENT("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret); + Error(LPGENW("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret); Exit(ret); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index cb5abc8e20..870ae89f82 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -34,7 +34,7 @@ CSendHost_ImageShack::CSendHost_ImageShack(HWND Owner, MCONTACT hContact, bool b : CSend(Owner, hContact, bAsync) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("Image upload"); + m_pszSendTyp = LPGENW("Image upload"); } CSendHost_ImageShack::~CSendHost_ImageShack() @@ -100,7 +100,7 @@ void CSendHost_ImageShack::SendThread() } else {/// check error mess from server url = GetHTMLContent(reply->pData, "<error ", "</error>"); - TCHAR* err = NULL; + wchar_t* err = NULL; if (url) err = mir_a2t(url); if (!err || !*err) {/// fallback to server response mess mir_free(err); diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index d3fe40ce74..a6eb7c6e57 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -19,7 +19,7 @@ CSendHost_Imgur::CSendHost_Imgur(HWND Owner, MCONTACT hContact, bool bAsync) : CSend(Owner, hContact, bAsync) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("Image upload"); + m_pszSendTyp = LPGENW("Image upload"); } CSendHost_Imgur::~CSendHost_Imgur() diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp index 6d210953b0..68232006ce 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp @@ -19,7 +19,7 @@ CSendHost_UploadPie::CSendHost_UploadPie(HWND Owner, MCONTACT hContact, bool bAs : m_expire(expire), CSend(Owner, hContact, bAsync) { m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; - m_pszSendTyp = LPGENT("Image upload"); + m_pszSendTyp = LPGENW("Image upload"); } CSendHost_UploadPie::~CSendHost_UploadPie() @@ -92,7 +92,7 @@ void CSendHost_UploadPie::SendThread(void* obj) } else {/// check error mess from server const char* err = GetHTMLContent(reply->pData, "<p id=\"error\"", "</p>"); - TCHAR* werr; + wchar_t* werr; if (err) werr = mir_a2t(err); else werr = mir_a2t(reply->pData); self->Error(L"%s", werr); diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index fa4d8277e4..c2db7bff90 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Main.h" // Prototypes /////////////////////////////////////////////////////////////////////////// -CLIST_INTERFACE *pcli;
+CLIST_INTERFACE *pcli; HINSTANCE g_hSendSS; MGLOBAL g_myGlobals; HANDLE g_hNetlibUser=0;//!< Netlib Register User @@ -68,11 +68,11 @@ IconItem ICONS_BTN[ICO_BTN_END_] = }; static HANDLE m_hFolderScreenshot = 0; -TCHAR* GetCustomPath() +wchar_t* GetCustomPath() { - TCHAR* pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\Screenshots"); + wchar_t* pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\Screenshots"); if (m_hFolderScreenshot) { - TCHAR szPath[1024] = { 0 }; + wchar_t szPath[1024] = { 0 }; FoldersGetCustomPathT(m_hFolderScreenshot, szPath, 1024, pszPath); mir_free(pszPath); pszPath = mir_tstrdup(szPath); @@ -83,7 +83,7 @@ TCHAR* GetCustomPath() } int result = CreateDirectoryTreeT(pszPath); if (result) { - TCHAR szError[MAX_PATH]; + wchar_t szError[MAX_PATH]; mir_sntprintf(szError, MAX_PATH, TranslateT("Could not create screenshot folder (error code: %d):\n%s\nDo you have write permissions?"), result, pszPath); MessageBox(NULL, szError, L"SendSS", MB_OK | MB_ICONERROR | MB_APPLMODAL); mir_free(pszPath); @@ -107,7 +107,7 @@ INT_PTR service_OpenCaptureDialog(WPARAM wParam, LPARAM lParam) MessageBox(NULL, TranslateT("Could not create main dialog."), TranslateT("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL); return -1; } - TCHAR* pszPath = GetCustomPath(); + wchar_t* pszPath = GetCustomPath(); if (!pszPath) { delete frmMain; return -1; @@ -135,7 +135,7 @@ INT_PTR service_SendDesktop(WPARAM wParam, LPARAM) MessageBox(NULL, TranslateT("Could not create main dialog."), TranslateT("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL); return -1; } - TCHAR* pszPath = GetCustomPath(); + wchar_t* pszPath = GetCustomPath(); if (!pszPath) { delete frmMain; return -1; @@ -289,19 +289,19 @@ DLL_EXPORT int Load(void) mi.hIcolibItem = GetIconHandle(ICO_MAINXS); SET_UID(mi, 0xa559a22e, 0xd0f9, 0x4553, 0x8e, 0x68, 0x55, 0xb3, 0xae, 0xc4, 0x5d, 0x93); - mi.name.t = LPGENT("Take a screenshot"); + mi.name.w = LPGENW("Take a screenshot"); mi.pszService = MS_SENDSS_OPENDIALOG; mi.position = 1000001; Menu_AddMainMenuItem(&mi); SET_UID(mi, 0xfea0a84, 0x1767, 0x4605, 0x99, 0xf0, 0xa9, 0x48, 0x1a, 0xa6, 0x6f, 0xce); - mi.name.t = LPGENT("Send screenshot"); + mi.name.w = LPGENW("Send screenshot"); mi.pszService = MS_SENDSS_OPENDIALOG; mi.position = 1000000; Menu_AddContactMenuItem(&mi); SET_UID(mi, 0x8d5b0d9a, 0x68d4, 0x4594, 0x9f, 0x41, 0x0, 0x64, 0x20, 0xe7, 0xf8, 0x9f); - mi.name.t = LPGENT("Send desktop screenshot"); + mi.name.w = LPGENW("Send desktop screenshot"); mi.pszService = MS_SENDSS_SENDDESKTOP; mi.position = 1000001; Menu_AddContactMenuItem(&mi); @@ -309,7 +309,7 @@ DLL_EXPORT int Load(void) /// hotkey's HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "Open SendSS+"; - hkd.ptszDescription = LPGENT("Open SendSS+"); + hkd.ptszDescription = LPGENW("Open SendSS+"); hkd.ptszSection = L"SendSS+"; hkd.pszService = MS_SENDSS_OPENDIALOG; //hkd.DefHotKey=HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL; @@ -329,6 +329,6 @@ DLL_EXPORT int Load(void) DLL_EXPORT int Unload(void) { if (g_clsTargetHighlighter) - UnregisterClass((TCHAR*)g_clsTargetHighlighter, g_hSendSS), g_clsTargetHighlighter = 0; + UnregisterClass((wchar_t*)g_clsTargetHighlighter, g_hSendSS), g_clsTargetHighlighter = 0; return 0; } diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index 6d7e0a57a6..7a468f99c4 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -93,7 +93,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) //License { - TCHAR* pszText = NULL; + wchar_t* pszText = NULL; mir_tstradd(pszText, _T(__COPYRIGHT)); mir_tstradd(pszText, L"\r\n\r\n"); @@ -102,7 +102,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) char* data = (char*)mir_alloc(size + 1); memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size); data[size] = '\0'; - TCHAR* pszCopyright = mir_a2t(data); + wchar_t* pszCopyright = mir_a2t(data); mir_free(data); mir_tstradd(pszText, pszCopyright); mir_free(pszCopyright); @@ -117,7 +117,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM) char* data = (char*)mir_alloc(size + 1); memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size); data[size] = '\0'; - TCHAR* pszText = mir_a2t(data); + wchar_t* pszText = mir_a2t(data); mir_free(data); SetDlgItemText(m_hWnd, IDC_CREDIT, pszText); mir_free(pszText); @@ -183,10 +183,10 @@ TfrmAbout::~TfrmAbout() void TfrmAbout::btnPageClick() { HWND hCtrl = GetDlgItem(m_hWnd, IDA_CONTRIBLINK); - const TCHAR* credits = TranslateT("Credits"); - const TCHAR* copyright = TranslateT("Copyright"); - const TCHAR* title; - const TCHAR* button; + const wchar_t* credits = TranslateT("Credits"); + const wchar_t* copyright = TranslateT("Copyright"); + const wchar_t* title; + const wchar_t* button; if (!m_Page) { ShowWindow(GetDlgItem(m_hWnd, IDC_CREDIT), SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_LICENSE), SW_SHOW); @@ -202,9 +202,9 @@ void TfrmAbout::btnPageClick() button = copyright; } SetWindowText(hCtrl, button); - TCHAR newTitle[128]; - TCHAR* pszPlug = mir_a2t(__PLUGIN_NAME); - TCHAR* pszVer = mir_a2t(__VERSION_STRING_DOTS); + wchar_t newTitle[128]; + wchar_t* pszPlug = mir_a2t(__PLUGIN_NAME); + wchar_t* pszVer = mir_a2t(__VERSION_STRING_DOTS); mir_sntprintf(newTitle, L"%s - %s\nv%s", pszPlug, title, pszVer); mir_free(pszPlug); mir_free(pszVer); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 92e894894c..bf8edb1658 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -71,7 +71,7 @@ INT_PTR CALLBACK TfrmMain::DlgProc_CaptureTabPage(HWND hDlg, UINT uMsg, WPARAM w case WM_COMMAND: if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == ID_btnExplore) { /// local file tab OPENFILENAME ofn = { sizeof(OPENFILENAME) }; - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; GetDlgItemText(hDlg, ID_edtSize, filename, _countof(filename)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hDlg; @@ -129,7 +129,7 @@ INT_PTR CALLBACK TfrmMain::DlgTfrmMain(HWND hWnd, UINT msg, WPARAM wParam, LPARA switch (msg) { case WM_DROPFILES:{ /// Drag&Drop of local files - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; if (!DragQueryFile((HDROP)wParam, 0, filename, MAX_PATH)) *filename = '\0'; DragFinish((HDROP)wParam); if (wnd->second->m_hwndTabPage) @@ -175,7 +175,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) /// Taskbar and Window icon Window_SetIcon_IcoLib(m_hWnd, GetIconHandle(ICO_MAIN)); - TCHAR *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); + wchar_t *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); if (pt && (m_hContact != 0)) { CMString string; string.AppendFormat(TranslateT("Send screenshot to %s"), pt); @@ -238,7 +238,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("<Entire Desktop>")), 0); ComboBox_SetCurSel(hCtrl, 0); if (m_MonitorCount > 1) { - TCHAR tszTemp[120]; + wchar_t tszTemp[120]; for (size_t mon = 0; mon < m_MonitorCount; ++mon) { /// @todo : fix format for non MSVC compilers mir_sntprintf(tszTemp, L"%Iu. %s%s", mon + 1, TranslateT("Monitor"), @@ -496,13 +496,13 @@ void TfrmMain::SetTargetWindow(HWND hwnd) } m_hTargetWindow = hwnd; int len = GetWindowTextLength(m_hTargetWindow) + 1; - TCHAR* lpTitle; + wchar_t* lpTitle; if (len > 1) { - lpTitle = (TCHAR*)mir_alloc(len*sizeof(TCHAR)); + lpTitle = (wchar_t*)mir_alloc(len*sizeof(wchar_t)); GetWindowText(m_hTargetWindow, lpTitle, len); } else {//no WindowText present, use WindowClass - lpTitle = (TCHAR*)mir_alloc(64 * sizeof(TCHAR)); + lpTitle = (wchar_t*)mir_alloc(64 * sizeof(wchar_t)); RealGetWindowClass(m_hTargetWindow, lpTitle, 64); } SetDlgItemText(m_hwndTabPage, ID_edtCaption, lpTitle); @@ -516,7 +516,7 @@ void TfrmMain::wmTimer(WPARAM wParam, LPARAM) static int primarymouse; if (!m_hTargetHighlighter) { primarymouse = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON; - m_hTargetHighlighter = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, (TCHAR*)g_clsTargetHighlighter, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hSendSS, NULL); + m_hTargetHighlighter = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, (wchar_t*)g_clsTargetHighlighter, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hSendSS, NULL); if (!m_hTargetHighlighter) return; SetLayeredWindowAttributes(m_hTargetHighlighter, 0, 123, LWA_ALPHA); SetSystemCursor(CopyCursor(GetIcon(ICO_TARGET)), OCR_IBEAM);//text cursor @@ -658,7 +658,7 @@ void TfrmMain::UMevent(WPARAM, LPARAM lParam) switch (lParam) { case EVT_CaptureDone: if (!m_Screenshot && m_opt_tabCapture != 2) { - TCHAR *err = TranslateT("Couldn't take a screenshot"); + wchar_t *err = TranslateT("Couldn't take a screenshot"); MessageBox(NULL, err, ERROR_TITLE, MB_OK | MB_ICONWARNING); Show(); return; @@ -781,7 +781,7 @@ void TfrmMain::SaveOptions(void) } //--------------------------------------------------------------------------- -void TfrmMain::Init(TCHAR* DestFolder, MCONTACT Contact) +void TfrmMain::Init(wchar_t* DestFolder, MCONTACT Contact) { m_FDestFolder = mir_tstrdup(DestFolder); m_hContact = Contact; @@ -801,11 +801,11 @@ void TfrmMain::btnCaptureClick() { if (m_opt_tabCapture == 1) m_hTargetWindow = GetDesktopWindow(); else if (m_opt_tabCapture == 2) { - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; GetDlgItemText(m_hwndTabPage, ID_edtSize, filename, _countof(filename)); FILE* fp = _wfopen(filename, L"rb"); if (!fp) { - TCHAR *err = TranslateT("Select a file"); + wchar_t *err = TranslateT("Select a file"); MessageBox(m_hWnd, err, ERROR_TITLE, MB_OK | MB_ICONWARNING); return; } @@ -813,7 +813,7 @@ void TfrmMain::btnCaptureClick() mir_free(m_pszFile); m_pszFile = mir_tstrdup(filename); } else if (!m_hTargetWindow) { - TCHAR *err = TranslateT("Select a target window."); + wchar_t *err = TranslateT("Select a target window."); MessageBox(m_hWnd, err, ERROR_TITLE, MB_OK | MB_ICONWARNING); return; } @@ -928,7 +928,7 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl // get window dimensions RECT rect = { 0 }; RECT cliRect = { 0 }; - TCHAR B[33], H[16]; + wchar_t B[33], H[16]; GetWindowRect(hWnd, &rect); if (ClientArea) { POINT pt = { 0 }; @@ -941,9 +941,9 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl rect = cliRect; } // _itot_s(rect.right - rect.left, B, 33, 10); - _itot(rect.right - rect.left, B, 10); + _itow(rect.right - rect.left, B, 10); // _itot_s(rect.bottom - rect.top, H, 16, 10); - _itot(rect.bottom - rect.top, H, 10); + _itow(rect.bottom - rect.top, H, 10); mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B)); mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B)); SetDlgItemText(hTarget, Ctrl, B); @@ -951,11 +951,11 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl void TfrmMain::edtSizeUpdate(RECT rect, HWND hTarget, UINT Ctrl) { - TCHAR B[33], H[16]; + wchar_t B[33], H[16]; // _itot_s(ABS(rect.right - rect.left), B, 33, 10); - _itot(ABS(rect.right - rect.left), B, 10); + _itow(ABS(rect.right - rect.left), B, 10); // _itot_s(ABS(rect.bottom - rect.top), H, 16, 10); - _itot(ABS(rect.bottom - rect.top), H, 10); + _itow(ABS(rect.bottom - rect.top), H, 10); mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B)); mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B)); SetDlgItemText(hTarget, Ctrl, B); @@ -966,25 +966,25 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { //generate File name FREE_IMAGE_FORMAT fif = FIF_UNKNOWN; - TCHAR* ret; - TCHAR* path = NULL; - TCHAR* pszFilename = NULL; - TCHAR* pszFileDesc = NULL; + wchar_t* ret; + wchar_t* path = NULL; + wchar_t* pszFilename = NULL; + wchar_t* pszFileDesc = NULL; if (!dib) return 1; //error unsigned FileNumber = db_get_dw(NULL, SZ_SENDSS, "FileNumber", 0) + 1; if (FileNumber > 99999) FileNumber = 1; //Generate FileName mir_tstradd(path, m_FDestFolder); - if (path[mir_tstrlen(path) - 1] != _T('\\')) mir_tstradd(path, L"\\"); + if (path[mir_tstrlen(path) - 1] != '\\') mir_tstradd(path, L"\\"); mir_tstradd(path, L"shot%.5u");//on format change, adapt "len" below size_t len = mir_tstrlen(path) + 2; - pszFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len)); + pszFilename = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len)); mir_sntprintf(pszFilename, len, path, FileNumber); mir_free(path); //Generate a description according to the screenshot - TCHAR winText[1024]; + wchar_t winText[1024]; GetDlgItemText(m_hwndTabPage, ID_edtCaption, winText, _countof(winText)); @@ -1064,7 +1064,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) case 3: //TIFF (miranda freeimage interface do not support save tiff, we udse GDI+) { - TCHAR* pszFile = NULL; + wchar_t* pszFile = NULL; mir_tstradd(pszFile, pszFilename); mir_tstradd(pszFile, L".tif"); @@ -1085,7 +1085,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) //dib24 = FIP->FI_ConvertTo8Bits(dib_new); //ret = SaveImage(FIF_GIF,dib24, pszFilename, L"gif"); //FIP->FI_Unload(dib24); - TCHAR* pszFile = NULL; + wchar_t* pszFile = NULL; mir_tstradd(pszFile, pszFilename); mir_tstradd(pszFile, L".gif"); HBITMAP hBmp = FIP->FI_CreateHBITMAPFromDIB(dib_new); @@ -1100,8 +1100,8 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) } /* //load PNG and save file in user format (if differ) //this get better result for transparent aereas - //TCHAR* pszFormat = (TCHAR*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo)); - TCHAR pszFormat[6]; + //wchar_t* pszFormat = (wchar_t*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo)); + wchar_t pszFormat[6]; ComboBox_GetText(hwndCombo, pszFormat, 6); if(ret && (mir_tstrcmpi (pszFormat,L"png") != 0)) { @@ -1148,7 +1148,7 @@ void TfrmMain::FormClose() { bool bCanDelete = m_opt_btnDeleteAfterSend; if (m_opt_tabCapture == 2) { /// existing file - TCHAR description[1024]; + wchar_t description[1024]; GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, _countof(description)); if (!IsWindowEnabled(GetDlgItem(m_hWnd, ID_chkDesc)) || !m_opt_btnDesc) *description = '\0'; diff --git a/plugins/SendScreenshotPlus/src/UMainForm.h b/plugins/SendScreenshotPlus/src/UMainForm.h index 2a715a52f2..f0595bbce1 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.h +++ b/plugins/SendScreenshotPlus/src/UMainForm.h @@ -74,7 +74,7 @@ class TfrmMain{ bool m_bOnExitSave; static void Unload(); - void Init(TCHAR* DestFolder, MCONTACT Contact); + void Init(wchar_t* DestFolder, MCONTACT Contact); void Close(){SendMessage(m_hWnd,WM_CLOSE,0,0);} void Show(){ShowWindow(m_hWnd,SW_SHOW);} void Hide(){ShowWindow(m_hWnd,SW_HIDE);} @@ -88,9 +88,9 @@ class TfrmMain{ bool m_bFormAbout; HWND m_hTargetWindow, m_hLastWin; HWND m_hTargetHighlighter; - TCHAR* m_FDestFolder; - TCHAR* m_pszFile; - TCHAR* m_pszFileDesc; + wchar_t* m_FDestFolder; + wchar_t* m_pszFile; + wchar_t* m_pszFileDesc; FIBITMAP* m_Screenshot;//Graphics::TBitmap *Screenshot; RGBQUAD m_AlphaColor; CSend* m_cSend; diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp index d36a4a9cc6..260631038f 100644 --- a/plugins/SendScreenshotPlus/src/Utils.cpp +++ b/plugins/SendScreenshotPlus/src/Utils.cpp @@ -142,7 +142,7 @@ FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture) return dib; } -FIBITMAP* CaptureMonitor(const TCHAR* szDevice, const RECT* cropRect/*=NULL*/) +FIBITMAP* CaptureMonitor(const wchar_t* szDevice, const RECT* cropRect/*=NULL*/) { HDC hScrDC; RECT rect; @@ -308,11 +308,11 @@ FIBITMAP* CreateDIBFromDC(HDC hDC, const RECT* rect, HWND hCapture/*=NULL*/) return dib; } -TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, const TCHAR* pszExt, int flag) +wchar_t* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const wchar_t* pszFilename, const wchar_t* pszExt, int flag) { int ret = 0; - TCHAR* pszFile = NULL; - TCHAR* FileExt = GetFileExt(pszFilename); + wchar_t* pszFile = NULL; + wchar_t* FileExt = GetFileExt(pszFilename); if (!FileExt) { if (!pszExt) return NULL; mir_tstradd(pszFile, pszFilename); @@ -338,35 +338,35 @@ TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, } //--------------------------------------------------------------------------- -TCHAR* GetFileNameW(const TCHAR* pszPath) +wchar_t* GetFileNameW(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('\\')); - if (!slash) slash = _tcsrchr(pszPath, _T('/')); + const wchar_t* slash = wcsrchr(pszPath, '\\'); + if (!slash) slash = wcsrchr(pszPath, '/'); if (slash) return mir_t2u(slash + 1); else return mir_t2u(pszPath); } -TCHAR* GetFileExtW(const TCHAR* pszPath) +wchar_t* GetFileExtW(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('.')); + const wchar_t* slash = wcsrchr(pszPath, '.'); if (slash) return mir_t2u(slash); return NULL; } -char* GetFileNameA(const TCHAR* pszPath) +char* GetFileNameA(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('\\')); - if (!slash) slash = _tcsrchr(pszPath, _T('/')); + const wchar_t* slash = wcsrchr(pszPath, '\\'); + if (!slash) slash = wcsrchr(pszPath, '/'); if (slash) return mir_t2a(slash + 1); else return mir_t2a(pszPath); } -char* GetFileExtA(const TCHAR* pszPath) +char* GetFileExtA(const wchar_t* pszPath) { - const TCHAR* slash = _tcsrchr(pszPath, _T('.')); + const wchar_t* slash = wcsrchr(pszPath, '.'); if (slash) return mir_t2a(slash); return NULL; @@ -395,7 +395,7 @@ BOOL GetEncoderClsid(wchar_t *wchMimeType, CLSID& clsidEncoder) return bOk; } -void SaveGIF(HBITMAP hBmp, TCHAR* szFilename) +void SaveGIF(HBITMAP hBmp, wchar_t* szFilename) { Gdiplus::GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; @@ -415,7 +415,7 @@ void SaveGIF(HBITMAP hBmp, TCHAR* szFilename) Gdiplus::GdiplusShutdown(gdiplusToken); } -void SaveTIF(HBITMAP hBmp, TCHAR* szFilename) +void SaveTIF(HBITMAP hBmp, wchar_t* szFilename) { //http://www.codeproject.com/Messages/1406708/How-to-reduce-the-size-of-an-Image-using-GDIplus.aspx ULONG_PTR gdiplusToken; diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h index 354244457f..5c22a17b7e 100644 --- a/plugins/SendScreenshotPlus/src/Utils.h +++ b/plugins/SendScreenshotPlus/src/Utils.h @@ -50,13 +50,13 @@ size_t MonitorInfoEnum(MONITORINFOEX* & myMonitors, RECT & virtualScreen); BOOL CALLBACK MonitorInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData); FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture); -FIBITMAP* CaptureMonitor(const TCHAR* szDevice,const RECT* cropRect=NULL); -TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, const TCHAR* pszExt, int flag=0); +FIBITMAP* CaptureMonitor(const wchar_t* szDevice,const RECT* cropRect=NULL); +wchar_t* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const wchar_t* pszFilename, const wchar_t* pszExt, int flag=0); -TCHAR* GetFileNameW(const TCHAR* pszPath); -TCHAR* GetFileExtW (const TCHAR* pszPath); -char* GetFileNameA(const TCHAR* pszPath); -char* GetFileExtA (const TCHAR* pszPath); +wchar_t* GetFileNameW(const wchar_t* pszPath); +wchar_t* GetFileExtW (const wchar_t* pszPath); +char* GetFileNameA(const wchar_t* pszPath); +char* GetFileExtA (const wchar_t* pszPath); #ifdef _UNICODE # define GetFileName GetFileNameW # define GetFileExt GetFileExtW @@ -66,9 +66,9 @@ char* GetFileExtA (const TCHAR* pszPath); #endif // _UNICODE BOOL GetEncoderClsid(wchar_t *wchMimeType, CLSID& clsidEncoder); -//void SavePNG(HBITMAP hBmp, TCHAR* szFilename); -void SaveGIF(HBITMAP hBmp, TCHAR* szFilename); -void SaveTIF(HBITMAP hBmp, TCHAR* szFilename); +//void SavePNG(HBITMAP hBmp, wchar_t* szFilename); +void SaveGIF(HBITMAP hBmp, wchar_t* szFilename); +void SaveTIF(HBITMAP hBmp, wchar_t* szFilename); //--------------------------------------------------------------------------- /* Old stuff from Borland C++ @@ -76,16 +76,16 @@ void SaveTIF(HBITMAP hBmp, TCHAR* szFilename); */ -class EventHandle
-{
- HANDLE _hEvent;
-public:
- inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); }
- inline ~EventHandle() { CloseHandle(_hEvent); }
- inline void Set() { SetEvent(_hEvent); }
- inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); }
- inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); }
- inline operator HANDLE() { return _hEvent; }
+class EventHandle +{ + HANDLE _hEvent; +public: + inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); } + inline ~EventHandle() { CloseHandle(_hEvent); } + inline void Set() { SetEvent(_hEvent); } + inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); } + inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); } + inline operator HANDLE() { return _hEvent; } }; #endif diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index 06fdadea88..d68cb3ed14 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -42,7 +42,7 @@ typedef struct TMBCtrl int stateId; // button state int defbutton; // default button int pbState; - TCHAR cHot; + wchar_t cHot; } BTNCTRL, *LPBTNCTRL; // External theme methods and properties @@ -258,7 +258,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient) { RECT rcText = { 0, 0, 0, 0 }; - TCHAR szText[MAX_PATH] = { 0 }; + wchar_t szText[MAX_PATH] = { 0 }; WORD ccText; // Draw the flat button @@ -416,7 +416,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L while (*tmp) { if (*tmp == '&' && *(tmp + 1)) { - bct->cHot = _totlower(*(tmp + 1)); + bct->cHot = towlower(*(tmp + 1)); break; } tmp++; @@ -426,7 +426,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break; case WM_SYSKEYUP: - if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == _totlower((TCHAR)wParam)) { + if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == towlower((wchar_t)wParam)) { if (bct->dwStyle & MBS_PUSHBUTTON) { if (bct->pbState) bct->pbState = 0; else bct->pbState = 1; @@ -564,7 +564,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break; case BUTTONTRANSLATE: - TCHAR szButton[MAX_PATH]; + wchar_t szButton[MAX_PATH]; GetWindowText(bct->hwnd, szButton, _countof(szButton)); SetWindowText(bct->hwnd, TranslateTS(szButton)); break; diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 5801dcd7fb..5562180bbb 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -334,9 +334,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_OKCANCEL: retOk = IDRETRY; - SetDlgItemText(hDlg, IDOK, LPGENT("OK")); + SetDlgItemText(hDlg, IDOK, LPGENW("OK")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel")); rcOk.left = dlgMid - okWidth - 10; rcOk.right = rcOk.left + okWidth; rcCancel.left = dlgMid + 10; @@ -347,9 +347,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_RETRYCANCEL: retOk = IDRETRY; - SetDlgItemText(hDlg, IDOK, LPGENT("Retry")); + SetDlgItemText(hDlg, IDOK, LPGENW("Retry")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel")); rcOk.left = dlgMid - okWidth - 10; rcOk.right = rcOk.left + okWidth; rcCancel.left = dlgMid + 10; @@ -360,9 +360,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESNO: retOk = IDYES; - SetDlgItemText(hDlg, IDOK, LPGENT("Yes")); + SetDlgItemText(hDlg, IDOK, LPGENW("Yes")); retCancel = IDNO; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("No")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("No")); rcOk.left = dlgMid - okWidth - 10; rcOk.right = rcOk.left + okWidth; rcCancel.left = dlgMid + 10; @@ -373,11 +373,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_ABORTRETRYIGNORE: retOk = IDABORT; - SetDlgItemText(hDlg, IDOK, LPGENT("Abort")); + SetDlgItemText(hDlg, IDOK, LPGENW("Abort")); retAll = IDABORT; - SetDlgItemText(hDlg, IDALL, LPGENT("Retry")); + SetDlgItemText(hDlg, IDALL, LPGENW("Retry")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Ignore")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Ignore")); rcAll.left = dlgMid - (allWidth / 2); rcAll.right = rcAll.left + allWidth; rcOk.left = rcAll.left - okWidth - 5; @@ -391,11 +391,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESNOCANCEL: retOk = IDYES; - SetDlgItemText(hDlg, IDOK, LPGENT("Yes")); + SetDlgItemText(hDlg, IDOK, LPGENW("Yes")); retAll = IDNO; - SetDlgItemText(hDlg, IDALL, LPGENT("No")); + SetDlgItemText(hDlg, IDALL, LPGENW("No")); retCancel = IDCANCEL; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel")); rcAll.left = dlgMid - (allWidth / 2); rcAll.right = rcAll.left + allWidth; rcOk.left = rcAll.left - okWidth - 5; @@ -409,13 +409,13 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l case MB_YESALLNO: retOk = IDYES; - SetDlgItemText(hDlg, IDOK, LPGENT("Yes")); + SetDlgItemText(hDlg, IDOK, LPGENW("Yes")); retAll = IDALL; - SetDlgItemText(hDlg, IDALL, LPGENT("All")); + SetDlgItemText(hDlg, IDALL, LPGENW("All")); //retNon = IDNONE; - SetDlgItemText(hDlg, IDNONE, LPGENT("None")); + SetDlgItemText(hDlg, IDNONE, LPGENW("None")); retCancel = IDNO; - SetDlgItemText(hDlg, IDCANCEL, LPGENT("No")); + SetDlgItemText(hDlg, IDCANCEL, LPGENW("No")); rcCancel.right = rcDlg.right - rcDlg.left - 10; rcCancel.left = rcCancel.right - caWidth; rcNone.right = rcCancel.left - 5; @@ -673,7 +673,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) **/ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszInfo, LPCTSTR pszFormat, ...) { - TCHAR tszMsg[MAX_SECONDLINE]; + wchar_t tszMsg[MAX_SECONDLINE]; va_list vl; va_start(vl, pszFormat); @@ -699,7 +699,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI **/ INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) { - TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; + wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; mir_sntprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error")); va_list vl; |