summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendDropbox.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/CSendDropbox.h2
-rw-r--r--plugins/SendScreenshotPlus/src/CSendEmail.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/CSendFTPFile.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/Main.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/UAboutForm.cpp12
-rw-r--r--plugins/SendScreenshotPlus/src/UMainForm.cpp68
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp10
-rw-r--r--plugins/SendScreenshotPlus/src/resource.h2
10 files changed, 34 insertions, 74 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
index c2debbdb85..22d85117e8 100644
--- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
@@ -59,7 +59,7 @@ void CSendDropbox::SendThread() {
if(m_hContact)
ret = CallService(MS_DROPBOX_SEND_FILE, (WPARAM)m_hContact, (LPARAM)m_pszFile);
if(!ret) {
- Error(TranslateT("%s (%i):\nCould not add a share to the Dropbox plugin."),TranslateTS(m_pszSendTyp),ret);
+ Error(LPGENT("%s (%i):\nCould not add a share to the Dropbox plugin."),TranslateTS(m_pszSendTyp),ret);
Exit(ACKRESULT_FAILED); return;
}
Exit(ACKRESULT_SUCCESS);
diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.h b/plugins/SendScreenshotPlus/src/CSendDropbox.h
index 33a6985d59..57615f3fac 100644
--- a/plugins/SendScreenshotPlus/src/CSendDropbox.h
+++ b/plugins/SendScreenshotPlus/src/CSendDropbox.h
@@ -38,8 +38,6 @@ class CSendDropbox : public CSend {
int Send();
protected:
- char* m_pszFileName;
- char* m_URL;
void SendThread();
static void SendThreadWrapper(void *Obj);
};
diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp
index 77d21ad332..968dcb0d5c 100644
--- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp
@@ -53,10 +53,10 @@ CSendEmail::~CSendEmail(){
int CSendEmail::Send()
{
if(!m_hContact) return 1;
- mir_freeAndNil(m_pszFileName);
+ mir_free(m_pszFileName);
m_pszFileName = GetFileNameA(m_pszFile);
- mir_freeAndNil(m_pszFileA);
+ mir_free(m_pszFileA);
m_pszFileA = mir_t2a(m_pszFile);
diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp
index 57fc704501..9ec7a21efa 100644
--- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp
@@ -58,7 +58,7 @@ int CSendFTPFile::Send()
* Returns 0 on success or nonzero on failure
* if (!wParam || !lParam) return 1
********************************************************************************************/
- mir_freeAndNil(m_pszFileName);
+ mir_free(m_pszFileName);
m_pszFileName = GetFileNameA(m_pszFile);
size_t size = sizeof(char)*(strlen(m_pszFileName)+2);
m_pszFileName = (char*)mir_realloc(m_pszFileName, size);
diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp
index cb6893cd86..4b9b7d9e00 100644
--- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp
@@ -67,7 +67,7 @@ int CSendHTTPServer::Send()
mir_stradd(m_fsi_pszSrvPath, "/");
mir_stradd(m_fsi_pszSrvPath, m_pszFileName);
- mir_freeAndNil(m_fsi_pszRealPath);
+ mir_free(m_fsi_pszRealPath);
m_fsi_pszRealPath = mir_t2a(m_pszFile);
ZeroMemory(&m_fsi, sizeof(m_fsi));
@@ -115,7 +115,7 @@ void CSendHTTPServer::SendThread() {
Exit(ACKRESULT_FAILED);
}
-void CSendHTTPServer::SendThreadWrapper(void * Obj) {
+void CSendHTTPServer::SendThreadWrapper(void * Obj) {
reinterpret_cast<CSendHTTPServer*>(Obj)->SendThread();
}
diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp
index fd7a895090..51e51a9f92 100644
--- a/plugins/SendScreenshotPlus/src/Main.cpp
+++ b/plugins/SendScreenshotPlus/src/Main.cpp
@@ -362,7 +362,7 @@ TCHAR* GetCustomPath() {
if(hFolderScreenshot){
TCHAR szPath[1024]={0};
FoldersGetCustomPathT(hFolderScreenshot, szPath, 1024, pszPath);
- mir_freeAndNil(pszPath);
+ mir_free(pszPath);
pszPath = mir_tstrdup(szPath);
}
if(!pszPath){
diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp
index 65225104dd..1ce8c14b62 100644
--- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp
+++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp
@@ -47,7 +47,6 @@ INT_PTR CALLBACK TfrmAbout::DlgTfrmAbout(HWND hWnd, UINT msg, WPARAM wParam, LPA
{
if (msg == WM_CTLCOLOREDIT || msg == WM_CTLCOLORSTATIC) {
switch ( GetWindowLongPtr(( HWND )lParam, GWL_ID )) {
- case IDC_WHITERECT:
case IDC_CREDIT:
case IDC_LICENSE:
SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
@@ -55,7 +54,6 @@ INT_PTR CALLBACK TfrmAbout::DlgTfrmAbout(HWND hWnd, UINT msg, WPARAM wParam, LPA
default:
return FALSE;
}
- SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
return (LRESULT)GetStockObject(WHITE_BRUSH); //GetSysColorBrush(COLOR_WINDOW);
}
@@ -93,15 +91,15 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM wParam, LPARAM lParam) {
HRSRC hResInfo;
DWORD ResSize;
TCHAR oldTitle[256], newTitle[256];
- TCHAR* temp = NULL;
+ TCHAR* temp;
TCHAR* pszTitle = NULL;
// Headerbar
TCHAR* pszPlug = mir_a2t(__PLUGIN_NAME);
TCHAR* pszVer = mir_a2t(__VERSION_STRING_DOTS);
GetDlgItemText( m_hWnd, IDC_HEADERBAR, oldTitle, SIZEOF( oldTitle ));
mir_sntprintf( newTitle, SIZEOF(newTitle), oldTitle, pszPlug, pszVer );
- mir_freeAndNil(pszPlug);
- mir_freeAndNil(pszVer);
+ mir_free(pszPlug);
+ mir_free(pszVer);
SetDlgItemText( m_hWnd, IDC_HEADERBAR, newTitle );
SendMessage(GetDlgItem(m_hWnd, IDC_HEADERBAR), WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW1,1));
@@ -115,7 +113,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM wParam, LPARAM lParam) {
temp = mir_a2t(pszMsg);
temp [ResSize] = 0; //LockResource is not NULL terminatet !!
mir_tcsadd(pszTitle ,temp);
- mir_freeAndNil(temp);
+ mir_free(temp);
SetDlgItemText(m_hWnd,IDC_LICENSE, pszTitle);
mir_freeAndNil(pszTitle);
}
@@ -128,7 +126,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM wParam, LPARAM lParam) {
temp = mir_a2t(pszMsg);
temp [ResSize] = 0; //LockResource is not NULL terminatet !!
mir_tcsadd(pszTitle ,temp);
- mir_freeAndNil(temp);
+ mir_free(temp);
SetDlgItemText(m_hWnd,IDC_CREDIT, pszTitle);
mir_freeAndNil(pszTitle);
}
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp
index 0356361da0..71051af96d 100644
--- a/plugins/SendScreenshotPlus/src/UMainForm.cpp
+++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp
@@ -47,32 +47,12 @@ INT_PTR CALLBACK TfrmMain::DlgProc_CaptureWindow(HWND hDlg, UINT uMsg, WPARAM wP
case WM_INITDIALOG:
Static_SetIcon(GetDlgItem(hDlg, ID_imgTarget), Skin_GetIcon(ICO_COMMON_SSTARGET));
SetDlgItemText(hDlg, ID_edtCaption, TranslateT("Drag&Drop the target on the desired window."));
- TranslateDialogDefault(hDlg);
break;
- case WM_CTLCOLOREDIT: //ctrl is NOT read-only or disabled
- case WM_CTLCOLORSTATIC: //ctrl is read-only or disabled
- // make the rectangle on the top white
- switch (GetWindowLongPtr((HWND)lParam, GWL_ID)) {
- case IDC_WHITERECT:
- case ID_chkClientArea:
- case ID_lblDropInfo:
- case ID_edtCaption:
- case ID_edtCaptionLabel:
- case ID_edtSize:
- case ID_edtSizeLabel:
- case ID_bvlTarget:
- case ID_imgTarget:
- SetBkColor((HDC)wParam,GetSysColor(COLOR_WINDOW));
- SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
-
- //SetBkMode((HDC)wParam,OPAQUE);
- //return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
- return (LRESULT)GetStockObject(WHITE_BRUSH);
- default:
- SetBkMode((HDC)wParam, TRANSPARENT);
- return (LRESULT)GetStockObject(NULL_BRUSH);
- }
- break; //this return false
+ case WM_CTLCOLORDLG:
+ case WM_CTLCOLOREDIT:
+ case WM_CTLCOLORSTATIC:
+ SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
case WM_COMMAND:
SendMessage(GetParent(hDlg), uMsg, wParam, lParam);
break;
@@ -92,26 +72,11 @@ INT_PTR CALLBACK TfrmMain::DlgProc_CaptureDesktop(HWND hDlg, UINT uMsg, WPARAM w
case WM_INITDIALOG:
Static_SetIcon(GetDlgItem(hDlg, ID_imgTarget), Skin_GetIcon(ICO_COMMON_SSMONITOR));
break;
+ case WM_CTLCOLORDLG:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORSTATIC:
- // make the rectangle on the top white
- switch (GetWindowLongPtr((HWND)lParam, GWL_ID)) {
- case IDC_WHITERECT:
- case ID_lblDropInfo:
- case ID_edtCaption:
- case ID_edtCaptionLabel:
- case ID_edtSize:
- case ID_edtSizeLabel:
- case ID_bvlTarget:
- case ID_imgTarget:
- SetBkColor((HDC)wParam,GetSysColor(COLOR_WINDOW));
- SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
- return (LRESULT)GetStockObject(WHITE_BRUSH);
- default:
- SetBkMode((HDC)wParam, TRANSPARENT);
- return (LRESULT)GetStockObject(NULL_BRUSH);
- }
- break;
+ SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
case WM_COMMAND:
SendMessage(GetParent(hDlg), uMsg, wParam, lParam);
break;
@@ -132,7 +97,6 @@ INT_PTR CALLBACK TfrmMain::DlgTfrmMain(HWND hWnd, UINT msg, WPARAM wParam, LPARA
{
if (msg == WM_CTLCOLOREDIT || msg == WM_CTLCOLORSTATIC) {
switch ( GetWindowLongPtr(( HWND )lParam, GWL_ID )) {
- /* case IDC_WHITERECT:*/
case IDC_HEADERBAR:
SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
break;
@@ -190,7 +154,7 @@ void TfrmMain::wmInitdialog(WPARAM wParam, LPARAM lParam) {
SendMessage(m_hWnd, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW2));
TCHAR* pt = mir_a2t(__PLUGIN_NAME);
SetWindowText(m_hWnd, pt);
- mir_freeAndNil(pt);
+ mir_free(pt);
// Headerbar
pt = mir_tstrdup((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)m_hContact, (LPARAM)GCDNF_TCHAR));
@@ -201,7 +165,7 @@ void TfrmMain::wmInitdialog(WPARAM wParam, LPARAM lParam) {
SetDlgItemText(m_hWnd, IDC_HEADERBAR, lptString);
mir_free(lptString);
}
- mir_freeAndNil(pt);
+ mir_free(pt);
SendMessage(GetDlgItem(m_hWnd, IDC_HEADERBAR), WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW1,1));
@@ -391,8 +355,8 @@ void TfrmMain::wmCommand(WPARAM wParam, LPARAM lParam) {
m_opt_chkEditor = (BYTE)Button_GetCheck((HWND)lParam);
break;
- case ID_bvlTarget:
- if(m_opt_tabCapture==0) SetTimer(m_hWnd,ID_bvlTarget,BUTTON_POLLDELAY,NULL);
+ case ID_imgTarget:
+ if(m_opt_tabCapture==0) SetTimer(m_hWnd,ID_imgTarget,BUTTON_POLLDELAY,NULL);
break;
case ID_btnAbout:
@@ -493,7 +457,7 @@ void TfrmMain::SetTargetWindow(HWND hwnd){
edtSizeUpdate(m_hTargetWindow,m_opt_chkClientArea,m_hwndTabPage,ID_edtSize);
}
void TfrmMain::wmTimer(WPARAM wParam, LPARAM lParam){
- if (wParam == ID_bvlTarget){// Timer for Target selector
+ if (wParam == ID_imgTarget){// Timer for Target selector
static int primarymouse;
if(!m_hTargetHighlighter){
primarymouse=GetSystemMetrics(SM_SWAPBUTTON)?VK_RBUTTON:VK_LBUTTON;
@@ -504,7 +468,7 @@ void TfrmMain::wmTimer(WPARAM wParam, LPARAM lParam){
Hide();
}
if(!(GetAsyncKeyState(primarymouse)&0x8000)){
- KillTimer(m_hWnd,ID_bvlTarget);
+ KillTimer(m_hWnd,ID_imgTarget);
SystemParametersInfo(SPI_SETCURSORS,0,NULL,0);
DestroyWindow(m_hTargetHighlighter),m_hTargetHighlighter=NULL;
SetTargetWindow(m_hTargetWindow);
@@ -1058,7 +1022,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) {
if(dib_new) {
DeleteFile(ret);
- mir_freeAndNil(ret);
+ mir_free(ret);
FIBITMAP *dib_save = FIP->FI_ConvertTo24Bits(dib_new);
ret = SaveImage(FIF_UNKNOWN,dib_save, pszFilename, pszFormat);
FIP->FI_Unload(dib_new); dib_new = NULL;
@@ -1066,7 +1030,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) {
}
}*/
FIP->FI_Unload(dib_new);
- mir_freeAndNil(pszFilename);
+ mir_free(pszFilename);
if(ret){
db_set_dw(NULL,SZ_SENDSS,"FileNumber",FileNumber);
diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp
index 1da14993b2..19071611a8 100644
--- a/plugins/SendScreenshotPlus/src/Utils.cpp
+++ b/plugins/SendScreenshotPlus/src/Utils.cpp
@@ -329,28 +329,30 @@ TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, TCHAR* pszFilename, TCHAR
//---------------------------------------------------------------------------
TCHAR* GetFileNameW(TCHAR* pszPath) {
- TCHAR* slash = _tcsrchr(pszPath,_T('\\'));
+ TCHAR* slash=_tcsrchr(pszPath,_T('\\'));
+ if(!slash) slash=_tcsrchr(pszPath,_T('/'));
if(slash)
return mir_t2u(slash+1);
else
return mir_t2u(pszPath);
}
TCHAR* GetFileExtW(TCHAR* pszPath) {
- TCHAR* slash = _tcsrchr(pszPath,_T('.'));
+ TCHAR* slash=_tcsrchr(pszPath,_T('.'));
if(slash)
return mir_t2u(slash);
return NULL;
}
char* GetFileNameA(TCHAR* pszPath) {
- TCHAR* slash = _tcsrchr(pszPath,_T('\\'));
+ TCHAR* slash=_tcsrchr(pszPath,_T('\\'));
+ if(!slash) slash=_tcsrchr(pszPath,_T('/'));
if(slash)
return mir_t2a(slash+1);
else
return mir_t2a(pszPath);
}
char* GetFileExtA(TCHAR* pszPath) {
- TCHAR* slash = _tcsrchr(pszPath,_T('.'));
+ TCHAR* slash=_tcsrchr(pszPath,_T('.'));
if(slash)
return mir_t2a(slash);
return NULL;
diff --git a/plugins/SendScreenshotPlus/src/resource.h b/plugins/SendScreenshotPlus/src/resource.h
index baa47eb668..a788ba559f 100644
--- a/plugins/SendScreenshotPlus/src/resource.h
+++ b/plugins/SendScreenshotPlus/src/resource.h
@@ -62,14 +62,12 @@
#define ID_upQuality 1204
#define ID_edtTimed 1205
#define ID_upTimed 1206
-#define IDC_WHITERECT 1221
#define ID_cboxFormat 1301
#define ID_cboxSendBy 1302
#define ID_lblFmtInfo 1501
#define IDE_Image 1501
#define ID_lblSendBy 1502
#define IDE_imgSelection 1502
-#define ID_bvlTarget 1503
#define IDC_COPYRIGHT 1503
#define ID_lblDropInfo 1504
#define ID_imgTarget 1505