summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus
diff options
context:
space:
mode:
authorRené Schümann <white06tiger@gmail.com>2014-04-10 23:34:27 +0000
committerRené Schümann <white06tiger@gmail.com>2014-04-10 23:34:27 +0000
commit9a4d6d236bcd294d77884441494c2e32f3817b11 (patch)
tree60a7e4bb2caed036999c37e55a41db6c8c4b71ce /plugins/SendScreenshotPlus
parentab05a30ab1f725e421287bf8158508c3ba3eddd3 (diff)
SendSS:
* improved GetFileName() to also handle Unix paths (Utils) !* improved and fixed dialog, caused graphical issues before, also improved tab order (UMainForm, resource) * improved resource.rc a bit. Now use defines for UInfoButtonClass styles * replaced some mir_freeAndNil() calls with mir_free() where appreciated (UMainForm, UAboutForm) * minor update to Dropbox support. no real change git-svn-id: http://svn.miranda-ng.org/main/trunk@8939 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus')
-rw-r--r--plugins/SendScreenshotPlus/res/resource.rc32
-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
11 files changed, 50 insertions, 90 deletions
diff --git a/plugins/SendScreenshotPlus/res/resource.rc b/plugins/SendScreenshotPlus/res/resource.rc
index acf31272e1..2668b70c27 100644
--- a/plugins/SendScreenshotPlus/res/resource.rc
+++ b/plugins/SendScreenshotPlus/res/resource.rc
@@ -2,6 +2,11 @@
//
#include "..\src\resource.h"
+#define MBS_DEFBUTTON 0x00001000L // default button
+#define MBS_PUSHBUTTON 0x00002000L // toggle button
+#define MBS_FLAT 0x00004000L // flat button
+#define MBS_DOWNARROW 0x00008000L // has arrow on the right
+
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
@@ -52,7 +57,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "Send screenshot to\n<unknown>",IDC_HEADERBAR,
"MHeaderbarCtrl",0x0,0,0,231,25
- CONTROL "",IDC_CAPTURETAB,"SysTabControl32",TCS_RAGGEDRIGHT | WS_TABSTOP,8,36,218,68,WS_EX_TRANSPARENT
+ CONTROL "",IDC_CAPTURETAB,"SysTabControl32",TCS_RAGGEDRIGHT | WS_TABSTOP,8,36,218,68
CONTROL "Ti&med capture",ID_chkTimed,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,106,85,10
RTEXT "Time (secs):",ID_edtTimedLabel,9,119,49,8
EDITTEXT ID_edtTimed,62,117,31,13,ES_AUTOHSCROLL | ES_NUMBER
@@ -61,13 +66,13 @@ BEGIN
COMBOBOX ID_cboxFormat,100,117,41,84,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_HASSTRINGS | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
LTEXT "Send B&y:",ID_lblSendBy,148,107,75,8
COMBOBOX ID_cboxSendBy,148,117,75,84,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_HASSTRINGS | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- CONTROL "?",ID_btnAbout,"UInfoButtonClass",WS_TABSTOP | 0x4000,3,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "E&xplore",ID_btnExplore,"UInfoButtonClass",WS_TABSTOP | 0x4000,21,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Fill description textbox.",ID_btnDesc,"UInfoButtonClass",WS_TABSTOP | 0x6000,39,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "?",ID_btnAbout,"UInfoButtonClass",WS_TABSTOP | MBS_FLAT,3,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "E&xplore",ID_btnExplore,"UInfoButtonClass",WS_TABSTOP | MBS_FLAT,21,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Fill description textbox.",ID_btnDesc,"UInfoButtonClass",WS_TABSTOP | MBS_PUSHBUTTON|MBS_FLAT,39,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
CONTROL "Delete &after send",ID_btnDeleteAfterSend,
- "UInfoButtonClass",WS_TABSTOP | 0x6000,57,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
+ "UInfoButtonClass",WS_TABSTOP | MBS_PUSHBUTTON|MBS_FLAT,57,145,16,14,WS_EX_NOACTIVATE | 0x10000000L
CONTROL "Open again",ID_chkOpenAgain,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,147,57,9
- CONTROL "&Capture",ID_btnCapture,"UInfoButtonClass",WS_GROUP | WS_TABSTOP | 0x1000,169,145,54,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Capture",ID_btnCapture,"UInfoButtonClass",WS_TABSTOP | MBS_DEFBUTTON,169,145,54,14,WS_EX_NOACTIVATE | 0x10000000L
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,139,231,1
END
@@ -78,9 +83,8 @@ CAPTION "About"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "%s\nv%s",IDC_HEADERBAR,"MHeaderbarCtrl",0x0,0,0,214,25
- CONTROL "Credits >",IDA_CONTRIBLINK,"UInfoButtonClass",WS_GROUP | WS_TABSTOP,5,166,61,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "Credits >",IDA_CONTRIBLINK,"UInfoButtonClass",WS_TABSTOP,5,166,61,14,WS_EX_NOACTIVATE | 0x10000000L
PUSHBUTTON "&Close",IDA_btnClose,149,166,60,14
- LTEXT "",IDC_WHITERECT,0,25,213,135,NOT WS_GROUP
EDITTEXT IDC_LICENSE,5,27,204,131,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
EDITTEXT IDC_CREDIT,5,27,204,131,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,160,213,1
@@ -101,28 +105,24 @@ IDD_UMain_CaptureWindow DIALOGEX 0, 0, 214, 48
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "",IDC_WHITERECT,0,0,214,48
- CONTROL "C&lient Area",ID_chkClientArea,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,100,30,62,8,WS_EX_RIGHT
LTEXT "Caption:",ID_edtCaptionLabel,4,1,158,8
EDITTEXT ID_edtCaption,4,12,158,13,ES_AUTOHSCROLL | ES_READONLY
RTEXT "Size (HxW):",ID_edtSizeLabel,0,30,50,8
EDITTEXT ID_edtSize,52,28,43,13,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY
+ CONTROL "C&lient Area",ID_chkClientArea,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,100,30,62,8,WS_EX_RIGHT
CTEXT "Target Tool",ID_lblDropInfo,162,1,51,8
- LTEXT "",ID_bvlTarget,174,12,29,29,SS_NOTIFY | SS_SUNKEN
- ICON IDI_ICON2,ID_imgTarget,178,16,20,20,SS_NOTIFY | SS_CENTERIMAGE | WS_GROUP
+ ICON IDI_ICON2,ID_imgTarget,174,12,29,29,SS_NOTIFY | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP
END
IDD_UMain_CaptureDesktop DIALOGEX 0, 0, 214, 48
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "",IDC_WHITERECT,0,0,214,48
LTEXT "Caption:",ID_edtCaptionLabel,4,1,158,8
+ COMBOBOX ID_edtCaption,4,12,158,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_TABSTOP
RTEXT "Size (HxW):",ID_edtSizeLabel,0,30,50,8
EDITTEXT ID_edtSize,52,28,43,13,ES_AUTOHSCROLL | ES_READONLY
- LTEXT "",ID_bvlTarget,174,12,29,29,SS_NOTIFY | SS_SUNKEN
- ICON "",ID_imgTarget,178,16,20,20,SS_NOTIFY | SS_CENTERIMAGE | WS_GROUP
- COMBOBOX ID_edtCaption,4,12,158,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_TABSTOP
+ ICON IDI_ICON3,ID_imgTarget,174,12,29,29,SS_NOTIFY | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP
END
IDD_UResultForm DIALOGEX 0, 0, 300, 87
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