diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-17 17:03:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-17 17:03:45 +0000 |
commit | a75ce08f5ea46237b73e5052a956829c0e272678 (patch) | |
tree | 60a238c3b4c0487317f3836d83acbe022c865115 /include/m_utils.h | |
parent | d6964f7bb1c2afc8d67905fa38ac9a3df766b807 (diff) |
minus MS_UTILS_SAVEWINDOWPOSITION & MS_UTILS_RESTOREWINDOWPOSITION
git-svn-id: http://svn.miranda-ng.org/main/trunk@14238 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_utils.h')
-rw-r--r-- | include/m_utils.h | 54 |
1 files changed, 16 insertions, 38 deletions
diff --git a/include/m_utils.h b/include/m_utils.h index 9d9d689e3a..72508724ee 100644 --- a/include/m_utils.h +++ b/include/m_utils.h @@ -207,25 +207,14 @@ EXTERN_C MIR_CORE_DLL(int) WindowList_BroadcastAsync(MWindowList hList, UINT mes // lParam = not used
#define HLK_SETDISABLECOLOUR (WM_USER+102) // added in 0.3.1
-/***************************** Window Position Saving ***************************/
+/////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////// Window Position Saving ////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
-// saves the position of a window in the database v0.1.1.0+
-// wParam = 0
-// lParam = (LPARAM)(SAVEWINDOWPOS*)&swp
+// saves the position of a window in the database
// returns 0 on success, nonzero on failure
-typedef struct {
- HWND hwnd;
- MCONTACT hContact;
- const char *szModule; //module name to store the setting in
- const char *szNamePrefix; //text to prefix on "x", "width", etc, to form setting names
-} SAVEWINDOWPOS;
-#define MS_UTILS_SAVEWINDOWPOSITION "Utils/SaveWindowPos"
-__forceinline INT_PTR Utils_SaveWindowPosition(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix) {
- SAVEWINDOWPOS swp;
- swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
- return CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&swp);
-}
+
+EXTERN_C MIR_CORE_DLL(int) Utils_SaveWindowPosition(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix);
/////////////////////////////////////////////////////////////////////////////////////////
// restores the position of a window from the database v0.1.1.0+
@@ -240,32 +229,21 @@ __forceinline INT_PTR Utils_SaveWindowPosition(HWND hwnd, MCONTACT hContact, con #define RWPF_NOMOVE 2 //don't use stored position
#define RWPF_NOACTIVATE 4 //show but don't activate v0.3.3.0+
#define RWPF_HIDDEN 8 //make it hidden
-#define MS_UTILS_RESTOREWINDOWPOSITION "Utils/RestoreWindowPos"
-__forceinline INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd, int flags, MCONTACT hContact, const char *szModule, const char *szNamePrefix) {
- SAVEWINDOWPOS swp;
- swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
- return CallService(MS_UTILS_RESTOREWINDOWPOSITION, flags, (LPARAM)&swp);
-}
-__forceinline INT_PTR Utils_RestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix) {
- return Utils_RestoreWindowPositionEx(hwnd, 0, hContact, szModule, szNamePrefix);
-}
-__forceinline INT_PTR Utils_RestoreWindowPositionNoSize(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix) {
- return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOSIZE, hContact, szModule, szNamePrefix);
+
+EXTERN_C MIR_CORE_DLL(int) Utils_RestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix, int flags = 0);
+
+__forceinline int Utils_RestoreWindowPositionNoSize(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix)
+{ return Utils_RestoreWindowPosition(hwnd, hContact, szModule, szNamePrefix, RWPF_NOSIZE);
}
-__forceinline INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix) {
- return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOMOVE, hContact, szModule, szNamePrefix);
+__forceinline int Utils_RestoreWindowPositionNoMove(HWND hwnd, MCONTACT hContact, const char *szModule, const char *szNamePrefix)
+{ return Utils_RestoreWindowPosition(hwnd, hContact, szModule, szNamePrefix, RWPF_NOMOVE);
}
/////////////////////////////////////////////////////////////////////////////////////////
-// Moves a RECT inside screen if it is outside.It works with multiple monitors v0.9.0.4+
-// wParam = RECT *
-// lParam = 0
-// returns <0 on error, 0 if not changed the rect, 1 if changed the rect
-
-#define MS_UTILS_ASSERTINSIDESCREEN "Utils/AssertInsideScreen"
-__forceinline INT_PTR Utils_AssertInsideScreen(RECT *rc) {
- return CallService(MS_UTILS_ASSERTINSIDESCREEN, (WPARAM)rc, 0);
-}
+// Moves a RECT inside screen if it is outside. It works with multiple monitors
+// returns < 0 on error, 0 if not changed the rect, 1 if changed the rect
+
+EXTERN_C MIR_CORE_DLL(int) Utils_AssertInsideScreen(RECT *rc);
/************************ Colour Picker Control (0.1.2.1+) **********************/
|