mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 05:45:00 +02:00
clean up.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@313 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
6a73e62487
commit
c2acd30423
@ -18,6 +18,7 @@
|
|||||||
//#include "Common.h" //use force include
|
//#include "Common.h" //use force include
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor;
|
WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor;
|
||||||
|
|
||||||
@ -57,6 +58,87 @@ void writeLog(const TCHAR *logFileName, const TCHAR *log2write)
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void folderBrowser(HWND parent, int outputCtrlID)
|
||||||
|
{
|
||||||
|
// This code was copied and slightly modifed from:
|
||||||
|
// http://www.bcbdev.com/faqs/faq62.htm
|
||||||
|
|
||||||
|
// SHBrowseForFolder returns a PIDL. The memory for the PIDL is
|
||||||
|
// allocated by the shell. Eventually, we will need to free this
|
||||||
|
// memory, so we need to get a pointer to the shell malloc COM
|
||||||
|
// object that will free the PIDL later on.
|
||||||
|
LPMALLOC pShellMalloc = 0;
|
||||||
|
if (::SHGetMalloc(&pShellMalloc) == NO_ERROR)
|
||||||
|
{
|
||||||
|
// If we were able to get the shell malloc object,
|
||||||
|
// then proceed by initializing the BROWSEINFO stuct
|
||||||
|
BROWSEINFO info;
|
||||||
|
memset(&info, 0, sizeof(info));
|
||||||
|
info.hwndOwner = parent;
|
||||||
|
info.pidlRoot = NULL;
|
||||||
|
TCHAR szDisplayName[MAX_PATH];
|
||||||
|
info.pszDisplayName = szDisplayName;
|
||||||
|
info.lpszTitle = TEXT("Select a folder to search from");
|
||||||
|
info.ulFlags = 0;
|
||||||
|
info.lpfn = BrowseCallbackProc;
|
||||||
|
TCHAR directory[MAX_PATH];
|
||||||
|
::GetDlgItemText(parent, outputCtrlID, directory, sizeof(directory));
|
||||||
|
info.lParam = reinterpret_cast<LPARAM>(directory);
|
||||||
|
|
||||||
|
// Execute the browsing dialog.
|
||||||
|
LPITEMIDLIST pidl = ::SHBrowseForFolder(&info);
|
||||||
|
|
||||||
|
// pidl will be null if they cancel the browse dialog.
|
||||||
|
// pidl will be not null when they select a folder.
|
||||||
|
if (pidl)
|
||||||
|
{
|
||||||
|
// Try to convert the pidl to a display generic_string.
|
||||||
|
// Return is true if success.
|
||||||
|
TCHAR szDir[MAX_PATH];
|
||||||
|
if (::SHGetPathFromIDList(pidl, szDir))
|
||||||
|
// Set edit control to the directory path.
|
||||||
|
::SetDlgItemText(parent, outputCtrlID, szDir);
|
||||||
|
pShellMalloc->Free(pidl);
|
||||||
|
}
|
||||||
|
pShellMalloc->Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientRectToScreenRect(HWND hWnd, RECT* rect)
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
|
||||||
|
pt.x = rect->left;
|
||||||
|
pt.y = rect->top;
|
||||||
|
::ClientToScreen( hWnd, &pt );
|
||||||
|
rect->left = pt.x;
|
||||||
|
rect->top = pt.y;
|
||||||
|
|
||||||
|
pt.x = rect->right;
|
||||||
|
pt.y = rect->bottom;
|
||||||
|
::ClientToScreen( hWnd, &pt );
|
||||||
|
rect->right = pt.x;
|
||||||
|
rect->bottom = pt.y;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void ScreenRectToClientRect(HWND hWnd, RECT* rect)
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
|
||||||
|
pt.x = rect->left;
|
||||||
|
pt.y = rect->top;
|
||||||
|
::ScreenToClient( hWnd, &pt );
|
||||||
|
rect->left = pt.x;
|
||||||
|
rect->top = pt.y;
|
||||||
|
|
||||||
|
pt.x = rect->right;
|
||||||
|
pt.y = rect->bottom;
|
||||||
|
::ScreenToClient( hWnd, &pt );
|
||||||
|
rect->right = pt.x;
|
||||||
|
rect->bottom = pt.y;
|
||||||
|
};
|
||||||
|
|
||||||
int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
|
int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
|
||||||
{
|
{
|
||||||
if (code == EXCEPTION_ACCESS_VIOLATION)
|
if (code == EXCEPTION_ACCESS_VIOLATION)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <Shlobj.h>
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
@ -72,6 +73,17 @@
|
|||||||
#define COPYDATA_FILENAMES COPYDATA_FILENAMESA
|
#define COPYDATA_FILENAMES COPYDATA_FILENAMESA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void folderBrowser(HWND parent, int outputCtrlID);
|
||||||
|
|
||||||
|
// Set a call back with the handle after init to set the path.
|
||||||
|
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/callbackfunctions/browsecallbackproc.asp
|
||||||
|
static int __stdcall BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM pData)
|
||||||
|
{
|
||||||
|
if (uMsg == BFFM_INITIALIZED)
|
||||||
|
::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
void systemMessage(const TCHAR *title);
|
void systemMessage(const TCHAR *title);
|
||||||
//DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer);
|
//DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer);
|
||||||
void printInt(int int2print);
|
void printInt(int int2print);
|
||||||
@ -81,8 +93,9 @@ int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep);
|
|||||||
int getCpFromStringValue(const TCHAR * encodingStr);
|
int getCpFromStringValue(const TCHAR * encodingStr);
|
||||||
std::generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false);
|
std::generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false);
|
||||||
|
|
||||||
//void char2wchar(const char* pszCHAR, wchar_t* pszWCHAR, UINT codepage);
|
void ClientRectToScreenRect(HWND hWnd, RECT* rect);
|
||||||
//void wchar2char(const wchar_t* pszWCHAR, char* pszCHAR, UINT codepage);
|
void ScreenRectToClientRect(HWND hWnd, RECT* rect);
|
||||||
|
|
||||||
std::wstring string2wstring(const std::string & rString, UINT codepage);
|
std::wstring string2wstring(const std::string & rString, UINT codepage);
|
||||||
std::string wstring2string(const std::wstring & rwString, UINT codepage);
|
std::string wstring2string(const std::wstring & rwString, UINT codepage);
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
enum progType {WIN32_PROG, CONSOLE_PROG};
|
enum progType {WIN32_PROG, CONSOLE_PROG};
|
||||||
|
@ -19,6 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "regExtDlg.h"
|
#include "regExtDlg.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
const TCHAR *nppName = TEXT("Notepad++_file");
|
const TCHAR *nppName = TEXT("Notepad++_file");
|
||||||
const TCHAR *nppBackup = TEXT("Notepad++_backup");
|
const TCHAR *nppBackup = TEXT("Notepad++_backup");
|
||||||
|
@ -4841,7 +4841,7 @@ bool Notepad_plus::activateBuffer(BufferID id, int whichOne)
|
|||||||
SCNotification scnN;
|
SCNotification scnN;
|
||||||
scnN.nmhdr.code = NPPN_DOCSWITCHINGOFF;
|
scnN.nmhdr.code = NPPN_DOCSWITCHINGOFF;
|
||||||
scnN.nmhdr.hwndFrom = _hSelf;
|
scnN.nmhdr.hwndFrom = _hSelf;
|
||||||
scnN.nmhdr.idFrom = oldBuf;
|
scnN.nmhdr.idFrom = (uptr_t)oldBuf;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
Buffer * pBuf = MainFileManager->getBufferByID(id);
|
Buffer * pBuf = MainFileManager->getBufferByID(id);
|
||||||
@ -4872,8 +4872,8 @@ bool Notepad_plus::activateBuffer(BufferID id, int whichOne)
|
|||||||
}
|
}
|
||||||
notifyBufferActivated(id, whichOne);
|
notifyBufferActivated(id, whichOne);
|
||||||
scnN.nmhdr.code = NPPN_DOCSWITCHINGIN;
|
scnN.nmhdr.code = NPPN_DOCSWITCHINGIN;
|
||||||
scnN.nmhdr.hwndFrom = _hSelf;
|
//scnN.nmhdr.hwndFrom = _hSelf;
|
||||||
scnN.nmhdr.idFrom = id;
|
scnN.nmhdr.idFrom = (uptr_t)id;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "ScintillaEditView.h"
|
#include "ScintillaEditView.h"
|
||||||
#include "Notepad_plus_msgs.h"
|
#include "Notepad_plus_msgs.h"
|
||||||
#include "constant.h"
|
#include "constant.h"
|
||||||
#include "common_func.h"
|
|
||||||
#include "UniConversion.h"
|
#include "UniConversion.h"
|
||||||
|
|
||||||
int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int length) { //query may equal to result, since it always gets smaller
|
int Searching::convertExtendedToString(const TCHAR * query, TCHAR * result, int length) { //query may equal to result, since it always gets smaller
|
||||||
|
@ -36,8 +36,8 @@ distribution.
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
// Help out windows:
|
// Help out windows:
|
||||||
#if defined( _DEBUG ) && !defined( DEBUG )
|
#if defined( _DEBUG ) && !defined( DEBUG )
|
||||||
|
@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ColourPicker.h"
|
#include "ColourPicker.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
|
|
||||||
void ColourPicker::init(HINSTANCE hInst, HWND parent)
|
void ColourPicker::init(HINSTANCE hInst, HWND parent)
|
||||||
|
@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ColourPopup.h"
|
#include "ColourPopup.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
DWORD colourItems[] = {
|
DWORD colourItems[] = {
|
||||||
RGB( 0, 0, 0), RGB( 64, 0, 0), RGB(128, 0, 0), RGB(128, 64, 64), RGB(255, 0, 0), RGB(255, 128, 128),
|
RGB( 0, 0, 0), RGB( 64, 0, 0), RGB(128, 0, 0), RGB(128, 64, 64), RGB(255, 0, 0), RGB(255, 128, 128),
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include "WindowInterface.h"
|
#include "WindowInterface.h"
|
||||||
#include "ToolTip.h"
|
#include "ToolTip.h"
|
||||||
#include <Commctrl.h>
|
#include <Commctrl.h>
|
||||||
#include <shlobj.h>
|
//#include <shlobj.h>
|
||||||
#include "common_func.h"
|
#include "Common.h"
|
||||||
|
|
||||||
#ifndef WH_MOUSE_LL
|
#ifndef WH_MOUSE_LL
|
||||||
#define WH_MOUSE_LL 14
|
#define WH_MOUSE_LL 14
|
||||||
@ -427,7 +427,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
|||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
{
|
{
|
||||||
::GetWindowRect(hwnd, &_rcCaption);
|
::GetWindowRect(hwnd, &_rcCaption);
|
||||||
ScreenToClient(hwnd, &_rcCaption);
|
ScreenRectToClientRect(hwnd, &_rcCaption);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_SETTEXT:
|
case WM_SETTEXT:
|
||||||
@ -601,7 +601,7 @@ eMousePos DockingCont::isInRect(HWND hwnd, INT x, INT y)
|
|||||||
eMousePos ret = posOutside;
|
eMousePos ret = posOutside;
|
||||||
|
|
||||||
::GetWindowRect(hwnd, &rc);
|
::GetWindowRect(hwnd, &rc);
|
||||||
ScreenToClient(hwnd, &rc);
|
ScreenRectToClientRect(hwnd, &rc);
|
||||||
|
|
||||||
if (_isTopCaption == TRUE)
|
if (_isTopCaption == TRUE)
|
||||||
{
|
{
|
||||||
@ -951,7 +951,7 @@ BOOL CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
|
|
||||||
getWindowRect(rcWnd);
|
getWindowRect(rcWnd);
|
||||||
getClientRect(rcClient);
|
getClientRect(rcClient);
|
||||||
ClientToScreen(_hSelf, &rcClient);
|
ClientRectToScreenRect(_hSelf, &rcClient);
|
||||||
rcWnd.bottom = rcClient.top;
|
rcWnd.bottom = rcClient.top;
|
||||||
|
|
||||||
/* if in caption */
|
/* if in caption */
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "DockingSplitter.h"
|
#include "DockingSplitter.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
BOOL DockingSplitter::_isVertReg = FALSE;
|
BOOL DockingSplitter::_isVertReg = FALSE;
|
||||||
BOOL DockingSplitter::_isHoriReg = FALSE;
|
BOOL DockingSplitter::_isHoriReg = FALSE;
|
||||||
|
@ -460,7 +460,7 @@ void Gripper::doTabReordering(POINT pt)
|
|||||||
{
|
{
|
||||||
/* prevent flickering of tabs with different sizes */
|
/* prevent flickering of tabs with different sizes */
|
||||||
::SendMessage(hTab, TCM_GETITEMRECT, iItem, (LPARAM)&rc);
|
::SendMessage(hTab, TCM_GETITEMRECT, iItem, (LPARAM)&rc);
|
||||||
ClientToScreen(hTab, &rc);
|
ClientRectToScreenRect(hTab, &rc);
|
||||||
|
|
||||||
if ((rc.left + (_rcItem.right - _rcItem.left)) < pt.x)
|
if ((rc.left + (_rcItem.right - _rcItem.left)) < pt.x)
|
||||||
{
|
{
|
||||||
@ -749,13 +749,13 @@ DockingCont* Gripper::workHitTest(POINT pt, RECT *rc)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ClientToScreen(_dockData.hWnd, &rcCont);
|
ClientRectToScreenRect(_dockData.hWnd, &rcCont);
|
||||||
|
|
||||||
if (::PtInRect(&rcCont, pt) == TRUE)
|
if (::PtInRect(&rcCont, pt) == TRUE)
|
||||||
{
|
{
|
||||||
if (rc != NULL)
|
if (rc != NULL)
|
||||||
{
|
{
|
||||||
ClientToScreen(_dockData.hWnd, rc);
|
ClientRectToScreenRect(_dockData.hWnd, rc);
|
||||||
rc->right -= rc->left;
|
rc->right -= rc->left;
|
||||||
rc->bottom -= rc->top;
|
rc->bottom -= rc->top;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "DockingCont.h"
|
#include "DockingCont.h"
|
||||||
#include "DockingManager.h"
|
#include "DockingManager.h"
|
||||||
#include "commctrl.h"
|
#include "commctrl.h"
|
||||||
#include "common_func.h"
|
|
||||||
|
|
||||||
|
|
||||||
// Used by getRectAndStyle() to draw the drag rectangle
|
// Used by getRectAndStyle() to draw the drag rectangle
|
||||||
@ -79,11 +78,11 @@ protected :
|
|||||||
void initTabInformation(POINT pt);
|
void initTabInformation(POINT pt);
|
||||||
|
|
||||||
void CalcRectToScreen(HWND hWnd, RECT *rc) {
|
void CalcRectToScreen(HWND hWnd, RECT *rc) {
|
||||||
ClientToScreen(hWnd, rc);
|
ClientRectToScreenRect(hWnd, rc);
|
||||||
ShrinkRcToSize(rc);
|
ShrinkRcToSize(rc);
|
||||||
};
|
};
|
||||||
void CalcRectToClient(HWND hWnd, RECT *rc) {
|
void CalcRectToClient(HWND hWnd, RECT *rc) {
|
||||||
ScreenToClient(hWnd, rc);
|
ScreenRectToClientRect(hWnd, rc);
|
||||||
ShrinkRcToSize(rc);
|
ShrinkRcToSize(rc);
|
||||||
};
|
};
|
||||||
void ShrinkRcToSize(RECT *rc) {
|
void ShrinkRcToSize(RECT *rc) {
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
#include "common_func.h"
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
void ClientToScreen(HWND hWnd, RECT* rect)
|
|
||||||
{
|
|
||||||
POINT pt;
|
|
||||||
|
|
||||||
pt.x = rect->left;
|
|
||||||
pt.y = rect->top;
|
|
||||||
::ClientToScreen( hWnd, &pt );
|
|
||||||
rect->left = pt.x;
|
|
||||||
rect->top = pt.y;
|
|
||||||
|
|
||||||
pt.x = rect->right;
|
|
||||||
pt.y = rect->bottom;
|
|
||||||
::ClientToScreen( hWnd, &pt );
|
|
||||||
rect->right = pt.x;
|
|
||||||
rect->bottom = pt.y;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void ScreenToClient(HWND hWnd, RECT* rect)
|
|
||||||
{
|
|
||||||
POINT pt;
|
|
||||||
|
|
||||||
pt.x = rect->left;
|
|
||||||
pt.y = rect->top;
|
|
||||||
::ScreenToClient( hWnd, &pt );
|
|
||||||
rect->left = pt.x;
|
|
||||||
rect->top = pt.y;
|
|
||||||
|
|
||||||
pt.x = rect->right;
|
|
||||||
pt.y = rect->bottom;
|
|
||||||
::ScreenToClient( hWnd, &pt );
|
|
||||||
rect->right = pt.x;
|
|
||||||
rect->bottom = pt.y;
|
|
||||||
};
|
|
||||||
|
|
||||||
void folderBrowser(HWND parent, int outputCtrlID)
|
|
||||||
{
|
|
||||||
// This code was copied and slightly modifed from:
|
|
||||||
// http://www.bcbdev.com/faqs/faq62.htm
|
|
||||||
|
|
||||||
// SHBrowseForFolder returns a PIDL. The memory for the PIDL is
|
|
||||||
// allocated by the shell. Eventually, we will need to free this
|
|
||||||
// memory, so we need to get a pointer to the shell malloc COM
|
|
||||||
// object that will free the PIDL later on.
|
|
||||||
LPMALLOC pShellMalloc = 0;
|
|
||||||
if (::SHGetMalloc(&pShellMalloc) == NO_ERROR)
|
|
||||||
{
|
|
||||||
// If we were able to get the shell malloc object,
|
|
||||||
// then proceed by initializing the BROWSEINFO stuct
|
|
||||||
BROWSEINFO info;
|
|
||||||
memset(&info, 0, sizeof(info));
|
|
||||||
info.hwndOwner = parent;
|
|
||||||
info.pidlRoot = NULL;
|
|
||||||
TCHAR szDisplayName[MAX_PATH];
|
|
||||||
info.pszDisplayName = szDisplayName;
|
|
||||||
generic_string title = TEXT("Select a folder to search from");
|
|
||||||
info.lpszTitle = title.c_str();
|
|
||||||
info.ulFlags = 0;
|
|
||||||
info.lpfn = BrowseCallbackProc;
|
|
||||||
TCHAR directory[MAX_PATH];
|
|
||||||
::GetDlgItemText(parent, outputCtrlID, directory, sizeof(directory));
|
|
||||||
info.lParam = reinterpret_cast<LPARAM>(directory);
|
|
||||||
|
|
||||||
// Execute the browsing dialog.
|
|
||||||
LPITEMIDLIST pidl = ::SHBrowseForFolder(&info);
|
|
||||||
|
|
||||||
// pidl will be null if they cancel the browse dialog.
|
|
||||||
// pidl will be not null when they select a folder.
|
|
||||||
if (pidl)
|
|
||||||
{
|
|
||||||
// Try to convert the pidl to a display generic_string.
|
|
||||||
// Return is true if success.
|
|
||||||
TCHAR szDir[MAX_PATH];
|
|
||||||
if (::SHGetPathFromIDList(pidl, szDir))
|
|
||||||
// Set edit control to the directory path.
|
|
||||||
::SetDlgItemText(parent, outputCtrlID, szDir);
|
|
||||||
pShellMalloc->Free(pidl);
|
|
||||||
}
|
|
||||||
pShellMalloc->Release();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
#ifndef COMMON_FUNC_H
|
|
||||||
#define COMMON_FUNC_H
|
|
||||||
|
|
||||||
#include "windows.h"
|
|
||||||
// need this header for SHBrowseForFolder
|
|
||||||
#include <Shlobj.h>
|
|
||||||
|
|
||||||
void ClientToScreen(HWND hWnd, RECT* rect);
|
|
||||||
void ScreenToClient(HWND hWnd, RECT* rect);
|
|
||||||
void folderBrowser(HWND parent, int outputCtrlID);
|
|
||||||
|
|
||||||
// Set a call back with the handle after init to set the path.
|
|
||||||
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/callbackfunctions/browsecallbackproc.asp
|
|
||||||
static int __stdcall BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM pData)
|
|
||||||
{
|
|
||||||
if (uMsg == BFFM_INITIALIZED)
|
|
||||||
::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
#endif //COMMON_FUNC_H
|
|
@ -11,6 +11,7 @@ Modified by Don HO <don.h@free.fr>
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "babygrid.h"
|
#include "babygrid.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
#define MAX_GRIDS 20
|
#define MAX_GRIDS 20
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "preferenceDlg.h"
|
#include "preferenceDlg.h"
|
||||||
#include "common_func.h"
|
|
||||||
|
|
||||||
BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Splitter.h"
|
#include "Splitter.h"
|
||||||
//#include "resource.h"
|
#include "Common.h"
|
||||||
|
|
||||||
bool Splitter::_isHorizontalRegistered = false;
|
bool Splitter::_isHorizontalRegistered = false;
|
||||||
bool Splitter::_isVerticalRegistered = false;
|
bool Splitter::_isVerticalRegistered = false;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
#include "SplitterContainer.h"
|
#include "SplitterContainer.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
bool SplitterContainer::_isRegistered = false;
|
bool SplitterContainer::_isRegistered = false;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "StaticDialog.h"
|
#include "StaticDialog.h"
|
||||||
#include "RunDlg_rc.h"
|
#include "RunDlg_rc.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
//static void extractArgs(TCHAR *cmd2Exec, TCHAR *args, const TCHAR *cmdEntier);
|
//static void extractArgs(TCHAR *cmd2Exec, TCHAR *args, const TCHAR *cmdEntier);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
#include "StaticDialog.h"
|
#include "StaticDialog.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
void StaticDialog::goToCenter()
|
void StaticDialog::goToCenter()
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
#include "StatusBar.h"
|
#include "StatusBar.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
//#define IDC_STATUSBAR 789
|
//#define IDC_STATUSBAR 789
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
#include "TabBar.h"
|
#include "TabBar.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
const COLORREF blue = RGB(0, 0, 0xFF);
|
const COLORREF blue = RGB(0, 0, 0xFF);
|
||||||
const COLORREF black = RGB(0, 0, 0);
|
const COLORREF black = RGB(0, 0, 0);
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "TaskList.h"
|
#include "TaskList.h"
|
||||||
#include "TaskListDlg_rc.h"
|
#include "TaskListDlg_rc.h"
|
||||||
#include "colors.h"
|
#include "colors.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
void TaskList::init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst, int nbItem, int index2set)
|
void TaskList::init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst, int nbItem, int index2set)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "shortcutRc.h"
|
#include "shortcutRc.h"
|
||||||
#include "StaticDialog.h"
|
#include "StaticDialog.h"
|
||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
|
#include "Common.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
FavorSizeOrSpeed="2"
|
FavorSizeOrSpeed="2"
|
||||||
OmitFramePointers="false"
|
OmitFramePointers="false"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories="..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception"
|
AdditionalIncludeDirectories="..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="2"
|
ExceptionHandling="2"
|
||||||
@ -239,7 +239,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\DockingWnd\common_func.cpp"
|
RelativePath="..\src\MISC\Common\Common.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@ -362,10 +362,6 @@
|
|||||||
RelativePath="..\src\WinControls\StatusBar\StatusBar.cpp"
|
RelativePath="..\src\WinControls\StatusBar\StatusBar.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\src\MISC\SysMsg\SysMsg.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\TabBar\TabBar.cpp"
|
RelativePath="..\src\WinControls\TabBar\TabBar.cpp"
|
||||||
>
|
>
|
||||||
@ -488,7 +484,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\DockingWnd\common_func.h"
|
RelativePath="..\src\MISC\Common\Common.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@ -667,10 +663,6 @@
|
|||||||
RelativePath="..\src\WinControls\StatusBar\StatusBar.h"
|
RelativePath="..\src\WinControls\StatusBar\StatusBar.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\src\MISC\SysMsg\SysMsg.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\TabBar\TabBar.h"
|
RelativePath="..\src\WinControls\TabBar\TabBar.h"
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user