summaryrefslogtreecommitdiff
path: root/include/m_utils.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-05 22:41:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-05 22:41:06 +0000
commite3cefc7b6ca803e3f87dbadae54a110332778490 (patch)
tree0ee41f14f962f946c9e64fae4a11fbcb197af853 /include/m_utils.h
parentf0fb070eab8f276e66c0154363656045bc0dadb3 (diff)
- first of the /Core standard plugins;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@778 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_utils.h')
-rw-r--r--include/m_utils.h96
1 files changed, 48 insertions, 48 deletions
diff --git a/include/m_utils.h b/include/m_utils.h
index 57cde573e4..ddeb1d2b15 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -62,8 +62,8 @@ running, one will be opened to show the URL.
/* Resizes a dialog by calling a custom routine to move the individual
controls v0.1.0.1+
-wParam=0
-lParam=(LPARAM)(UTILRESIZEDIALOG*)&urd
+wParam = 0
+lParam = (LPARAM)(UTILRESIZEDIALOG*)&urd
Returns 0 on success, or nonzero on failure
Does not support dialogtemplateex dialog boxes, and will return failure if you
try to resize one
@@ -102,16 +102,16 @@ typedef struct {
#define MS_UTILS_RESIZEDIALOG "Utils/ResizeDialog"
/* Gets the name of a country given its number v0.1.2.0+
-wParam=countryId
-lParam=0
+wParam = countryId
+lParam = 0
Returns a pointer to the string containing the country name on success,
or NULL on failure
*/
#define MS_UTILS_GETCOUNTRYBYNUMBER "Utils/GetCountryByNumber"
/* Gets the full list of country IDs v0.1.2.0+
-wParam=(WPARAM)(int*)piCount
-lParam=(LPARAM)(struct CountryListEntry**)ppList
+wParam = (WPARAM)(int*)piCount
+lParam = (LPARAM)(struct CountryListEntry**)ppList
Returns 0 always
Neither wParam nor lParam can be NULL.
The list is sorted alphabetically by country name, on the assumption that it's
@@ -126,13 +126,13 @@ struct CountryListEntry {
/******************************* Window lists *******************************/
//allocate a window list v0.1.0.1+
-//wParam=lParam=0
+//wParam = lParam = 0
//returns a handle to the new window list
#define MS_UTILS_ALLOCWINDOWLIST "Utils/AllocWindowList"
//adds a window to the specified window list v0.1.0.1+
-//wParam=0
-//lParam=(LPARAM)(WINDOWLISTENTRY*)&wle
+//wParam = 0
+//lParam = (LPARAM)(WINDOWLISTENTRY*)&wle
//returns 0 on success, nonzero on failure
typedef struct {
HANDLE hList;
@@ -142,12 +142,12 @@ typedef struct {
#define MS_UTILS_ADDTOWINDOWLIST "Utils/AddToWindowList"
__inline static INT_PTR WindowList_Add(HANDLE hList, HWND hwnd, HANDLE hContact) {
WINDOWLISTENTRY wle;
- wle.hList=hList; wle.hwnd=hwnd; wle.hContact=hContact;
+ wle.hList = hList; wle.hwnd = hwnd; wle.hContact = hContact;
return CallService(MS_UTILS_ADDTOWINDOWLIST, 0, (LPARAM)&wle);
}
//removes a window from the specified window list v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hList
-//lParam=(LPARAM)(HWND)hwnd
+//wParam = (WPARAM)(HANDLE)hList
+//lParam = (LPARAM)(HWND)hwnd
//returns 0 on success, nonzero on failure
#define MS_UTILS_REMOVEFROMWINDOWLIST "Utils/RemoveFromWindowList"
__inline static INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
@@ -155,8 +155,8 @@ __inline static INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
}
//finds a window given the hContact v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hList
-//lParam=(WPARAM)(HANDLE)hContact
+//wParam = (WPARAM)(HANDLE)hList
+//lParam = (WPARAM)(HANDLE)hContact
//returns the window handle on success, or NULL on failure
#define MS_UTILS_FINDWINDOWINLIST "Utils/FindWindowInList"
__inline static HWND WindowList_Find(HANDLE hList, HANDLE hContact) {
@@ -164,14 +164,14 @@ __inline static HWND WindowList_Find(HANDLE hList, HANDLE hContact) {
}
//broadcasts a message to all windows in a list v0.1.0.1+
-//wParam=(WPARAM)(HANDLE)hList
-//lParam=(LPARAM)(MSG*)&msg
+//wParam = (WPARAM)(HANDLE)hList
+//lParam = (LPARAM)(MSG*)&msg
//returns 0 on success, nonzero on failure
//Only msg.message, msg.wParam and msg.lParam are used
#define MS_UTILS_BROADCASTTOWINDOWLIST "Utils/BroadcastToWindowList"
__inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
MSG msg;
- msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
+ msg.message = message; msg.wParam = wParam; msg.lParam = lParam;
return CallService(MS_UTILS_BROADCASTTOWINDOWLIST, (WPARAM)hList, (LPARAM)&msg);
}
@@ -180,8 +180,8 @@ __inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM
Version: 0.3.0.0+
Inline helper: WindowList_BroadcastAsync
- wParam=(WPARAM)(HANDLE)hList
- lParam=(LPARAM)(MSG*)&msg
+ wParam = (WPARAM)(HANDLE)hList
+ lParam = (LPARAM)(MSG*)&msg
Returns 0 on success, nonzero on failure, this service does not fail, even if PostMessage() fails for whatever reason
@@ -190,7 +190,7 @@ __inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM
__inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
MSG msg;
- msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
+ msg.message = message; msg.wParam = wParam; msg.lParam = lParam;
return CallService(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, (WPARAM)hList, (LPARAM)&msg);
}
@@ -202,19 +202,19 @@ __inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WP
//the control will send STN_CLICKED via WM_COMMAND when the link itself is clicked
// Use this in a SendMessage to set the color of the url when control is enabled
-// wParam=DWORD color
-// lParam=not used
+// wParam = DWORD color
+// lParam = not used
#define HLK_SETENABLECOLOUR (WM_USER+101) // added in 0.3.1
// Use this in a SendMessage to set the color of the url when control is disabled
-// wParam=DWORD color
-// lParam=not used
+// wParam = DWORD color
+// lParam = not used
#define HLK_SETDISABLECOLOUR (WM_USER+102) // added in 0.3.1
/***************************** Window Position Saving ***************************/
//saves the position of a window in the database v0.1.1.0+
-//wParam=0
-//lParam=(LPARAM)(SAVEWINDOWPOS*)&swp
+//wParam = 0
+//lParam = (LPARAM)(SAVEWINDOWPOS*)&swp
//returns 0 on success, nonzero on failure
typedef struct {
HWND hwnd;
@@ -225,13 +225,13 @@ typedef struct {
#define MS_UTILS_SAVEWINDOWPOSITION "Utils/SaveWindowPos"
__inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
- swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
+ swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
return CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&swp);
}
//restores the position of a window from the database v0.1.1.0+
-//wParam=flags
-//lParam=(LPARAM)(SAVEWINDOWPOS*)&swp
+//wParam = flags
+//lParam = (LPARAM)(SAVEWINDOWPOS*)&swp
//returns 0 on success, nonzero on failure
//if no position was found in the database, the function returns 1 and does
//nothing
@@ -244,7 +244,7 @@ __inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, con
#define MS_UTILS_RESTOREWINDOWPOSITION "Utils/RestoreWindowPos"
__inline static INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd, int flags, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
- swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
+ swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
return CallService(MS_UTILS_RESTOREWINDOWPOSITION, flags, (LPARAM)&swp);
}
__inline static INT_PTR Utils_RestoreWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
@@ -258,8 +258,8 @@ __inline static INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd, HANDLE hCon
}
//Moves a RECT inside screen if it is outside.It works with multiple monitors v0.9.0.4+
-//wParam=RECT *
-//lParam=0
+//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"
__inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
@@ -270,17 +270,17 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#define WNDCLASS_COLOURPICKER _T("ColourPicker")
-#define CPM_SETCOLOUR 0x1000 //lParam=new colour
+#define CPM_SETCOLOUR 0x1000 //lParam = new colour
#define CPM_GETCOLOUR 0x1001 //returns colour
-#define CPM_SETDEFAULTCOLOUR 0x1002 //lParam=default, used as first custom colour
+#define CPM_SETDEFAULTCOLOUR 0x1002 //lParam = default, used as first custom colour
#define CPM_GETDEFAULTCOLOUR 0x1003 //returns colour
#define CPN_COLOURCHANGED 1 //sent through WM_COMMAND
/***************************** Bitmap Filter (0.1.2.1+) *************************/
//Loads a bitmap v0.1.2.1+
-//wParam=0
-//lParam=(LPARAM)(const char*)filename
+//wParam = 0
+//lParam = (LPARAM)(const char*)filename
//returns HBITMAP on success, NULL on failure
//This function uses OleLoadPicturePath() so supports BMP, JPEG and GIF. It may
//support PNG on future versions of Windows (or XP for that matter)
@@ -297,8 +297,8 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#endif
//Gets the filter strings for use in the open file dialog v0.1.2.1+
-//wParam=cbLengthOfBuffer
-//lParam=(LPARAM)(char*)pszBuffer
+//wParam = cbLengthOfBuffer
+//lParam = (LPARAM)(char*)pszBuffer
//Returns 0 on success, nonzero on failure
//See the MSDN under OPENFILENAME.lpstrFilter for the formatting
//An 'All Bitmaps' item is always first and 'All Files' is last.
@@ -308,8 +308,8 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
//Saves a path to a relative path (from the miranda directory)
//Only saves as a relative path if the file is in the miranda directory (or
//sub directory)
-//wParam=(WPARAM)(char*)pszPath
-//lParam=(LPARAM)(char*)pszNewPath
+//wParam = (WPARAM)(char*)pszPath
+//lParam = (LPARAM)(char*)pszNewPath
//pszPath is the path to convert and pszNewPath is the buffer that
//the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
//Returns numbers of chars copied.
@@ -317,8 +317,8 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative"
//Saves a path to a absolute path (from the miranda directory)
-//wParam=(WPARAM)(char*)pszPath
-//lParam=(LPARAM)(char*)pszNewPath
+//wParam = (WPARAM)(char*)pszPath
+//lParam = (LPARAM)(char*)pszNewPath
//pszPath is the path to convert and pszNewPath is the buffer that
//the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
//Returns numbers of chars copied.
@@ -326,21 +326,21 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
#define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute"
//Creates a directory tree (even more than one directories levels are missing) 0.7.0+
-//wParam=0 (unused)
-//lParam=(LPARAM)(char*)pszPath - directory to be created
+//wParam = 0 (unused)
+//lParam = (LPARAM)(char*)pszPath - directory to be created
//Returns 0 on success error code otherwise
//Unicode version is available since 0.7.0
#define MS_UTILS_CREATEDIRTREE "Utils/CreateDirTree"
// Generates Random number of any length
-//wParam=size - length of the random number to generate
-//lParam=(LPARAM)(char*)pszArray - pointer to array to fill with random number
+//wParam = size - length of the random number to generate
+//lParam = (LPARAM)(char*)pszArray - pointer to array to fill with random number
//Always returns 0
#define MS_UTILS_GETRANDOM "Utils/GetRandom"
//Replace variables in text
-//wParam=(char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag)
-//lParam=(REPLACEVARSDATA *) data about variables, item with key=0 terminates the list
+//wParam = (char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag)
+//lParam = (REPLACEVARSDATA *) data about variables, item with key = 0 terminates the list
//returns new string, use mir_free to destroy
// variables known by the core: