diff options
30 files changed, 273 insertions, 278 deletions
diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h index 2d2addf8c6..cc200c4791 100644 --- a/include/m_cluiframes.h +++ b/include/m_cluiframes.h @@ -31,110 +31,101 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* CLUI Frames Support */
/************************************************************************/
-
-// Constants used below
-typedef struct tagCLISTFrame {
+// frame alignment
+#define alTop 0x00001
+#define alBottom 0x00002
+#define alClient 0x00004 // only one alClient frame
+
+#define alLeft 0x00011 // frame is vertical
+#define alRight 0x00012
+
+#define alVertFrameMask 0x00010
+
+// frame flags
+#define F_VISIBLE 0x00001 // Frame visible
+#define F_SHOWTB 0x00002 // Show TitleBar
+#define F_UNCOLLAPSED 0x00004 // UnCollapse frame
+#define F_LOCKED 0x00008 // Lock Frame
+#define F_NOBORDER 0x00010 // Dont apply WS_BORDER style for window
+#define F_SHOWTBTIP 0x00020 // Show titlebar tooltip
+#define F_CANBEVERTICAL 0x00040 // frames can be vertical
+#define F_CANNOTBEHORIZONTAL 0x00080 // frames can NOT be horizontal F_CANBEVERTICAL have to be set
+#define F_NO_SUBCONTAINER 0x00400 // Support skining no subcontainer needed
+#define F_SKINNED 0x00800 // skinned frame (for owned subframe only)
+#define F_UNICODE 0x08000 // Use unicode text
+
+struct CLISTFrame
+{
DWORD cbSize;
- HWND hWnd ;
+ HWND hWnd;
HICON hIcon;
- int align; //al flags below
+ int align; // al flags below
union {
int height;
- int minSize; //the actual meaning depends from type of frame
- };
- int Flags; //F_flags below
- union {
- char *name; //frame window name indentifier (DO NOT TRANSLATE)
- wchar_t *wname;
- LPTSTR tname;
- };
- union {
- char *TBname; //titlebar & menu caption
- wchar_t *TBwname;
- LPTSTR TBtname;
+ int minSize; // the actual meaning depends from type of frame
};
-} CLISTFrame;
-
-#define F_VISIBLE 1 //Frame visible
-#define F_SHOWTB 2 //Show TitleBar
-#define F_UNCOLLAPSED 4 //UnCollapse frame
-#define F_LOCKED 8 //Lock Frame
-#define F_NOBORDER 16 //Dont apply WS_BORDER style for window
-#define F_SHOWTBTIP 32 //Show titlebar tooltip
-#define F_CANBEVERTICAL 64 //frames can be vertical
-#define F_CANNOTBEHORIZONTAL 128 //frames can NOT be horizontal F_CANBEVERTICAL have to be set
-#define F_NO_SUBCONTAINER 1024 //Support skining no subcontainer needed
-#define F_SKINNED 2048 // skinned frame (for owned subframe only)
-#define F_UNICODE 32768 //Use unicode text
+ int Flags; // F_flags below
+ MAllStrings szName; // frame window name indentifier (DO NOT TRANSLATE)
+ MAllStrings szTBname; // titlebar & menu caption
+};
-// frame alignment
-#define alTop 0x00000001
-#define alBottom 0x00000002
-#define alClient 0x00000004 //only one alClient frame
-
-// since 0.7.0.20
-#define alLeft 0x00000011 // frame is vertical
-#define alRight 0x00000012
-
-#define alVertFrameMask 0x00000010
+#define FU_TBREDRAW 1 // redraw titlebar
+#define FU_FMREDRAW 2 // redraw Frame
+#define FU_FMPOS 4 // update Frame position
-#define FU_TBREDRAW 1 //redraw titlebar
-#define FU_FMREDRAW 2 //redraw Frame
-#define FU_FMPOS 4 //update Frame position
+#define FO_FLAGS 0x0001 // return set of F_VISIBLE,F_SHOWTB,F_UNCOLLAPSED,F_LOCKED,F_NOBORDER,F_SHOWTBTIP
+#define FO_NAME 0x0002 // Change m_cacheTName
+#define FO_TBNAME 0x0003 // Change TB caption
+#define FO_TBSTYLE 0x0004 // Change TB style
+#define FO_TBEXSTYLE 0x0005 // Change TB exstyle
+#define FO_ICON 0x0006 // Change icon
+#define FO_HEIGHT 0x0007 // Change height
+#define FO_ALIGN 0x0008 // Change align
+#define FO_TBTIPNAME 0x0009 // Change TB tooltip
+#define FO_FLOATING 0x000a // Change floating mode
-#define FO_FLAGS 0x0001 //return set of F_VISIBLE,F_SHOWTB,F_UNCOLLAPSED,F_LOCKED,F_NOBORDER,F_SHOWTBTIP
-#define FO_NAME 0x0002 //Change m_cacheTName
-#define FO_TBNAME 0x0003 //Change TB caption
-#define FO_TBSTYLE 0x0004 //Change TB style
-#define FO_TBEXSTYLE 0x0005 //Change TB exstyle
-#define FO_ICON 0x0006 //Change icon
-#define FO_HEIGHT 0x0007 //Change height
-#define FO_ALIGN 0x0008 //Change align
-#define FO_TBTIPNAME 0x0009 //Change TB tooltip
-#define FO_FLOATING 0x000a //Change floating mode
-
-#define FO_UNICODETEXT 0x8000 // flag for FO_NAME,FO_TBNAME, FO_TBTIPNAME set/get lPAram as unicode wchar_t
+#define FO_UNICODETEXT 0x8000 // flag for FO_NAME,FO_TBNAME, FO_TBTIPNAME set/get lPAram as unicode wchar_t
//////////////////////////////////////////////////////////////////////////
-//want show tooltip for statusbar
-//wparam=(char *)protocolname
-//lparam=0
-#define ME_CLIST_FRAMES_SB_SHOW_TOOLTIP "CListFrames/StatusBarShowToolTip"
+// want show tooltip for statusbar
+// wparam=(char *)protocolname
+// lparam=0
+#define ME_CLIST_FRAMES_SB_SHOW_TOOLTIP "CListFrames/StatusBarShowToolTip"
//////////////////////////////////////////////////////////////////////////
//want hide tooltip for statusbar
//wparam=lparam=0
-#define ME_CLIST_FRAMES_SB_HIDE_TOOLTIP "CListFrames/StatusBarHideToolTip"
+#define ME_CLIST_FRAMES_SB_HIDE_TOOLTIP "CListFrames/StatusBarHideToolTip"
//////////////////////////////////////////////////////////////////////////
-//adds a frame window
-//wParam=(CLISTFrame*)
-//lParam=0
-//returns an integer, the frame id.
-#define MS_CLIST_FRAMES_ADDFRAME "CListFrames/AddFrame"
+// adds a frame window
+// wParam=(CLISTFrame*)
+// lParam=0
+// returns an integer, the frame id.
+#define MS_CLIST_FRAMES_ADDFRAME "CListFrames/AddFrame"
//////////////////////////////////////////////////////////////////////////
// remove frame. It destroy your window
//
-#define MS_CLIST_FRAMES_REMOVEFRAME "CListFrames/RemoveFrame"
+#define MS_CLIST_FRAMES_REMOVEFRAME "CListFrames/RemoveFrame"
//////////////////////////////////////////////////////////////////////////
//shows all frames
//wParam=lParam=0
//returns 0 on success, -1 on failure
-#define MS_CLIST_FRAMES_SHOWALLFRAMES "CListFrames/ShowALLFrames"
+#define MS_CLIST_FRAMES_SHOWALLFRAMES "CListFrames/ShowALLFrames"
//////////////////////////////////////////////////////////////////////////
//shows the titlebars of all frames
//wParam=lParam=0
//returns 0 on success, -1 on failure
-#define MS_CLIST_FRAMES_SHOWALLFRAMESTB "CListFrames/ShowALLFramesTB"
+#define MS_CLIST_FRAMES_SHOWALLFRAMESTB "CListFrames/ShowALLFramesTB"
//////////////////////////////////////////////////////////////////////////
//hides the titlebars of all frames
//wParam=lParam=0
//returns 0 on success, -1 on failure
-#define MS_CLIST_FRAMES_HIDEALLFRAMESTB "CListFrames/HideALLFramesTB"
+#define MS_CLIST_FRAMES_HIDEALLFRAMESTB "CListFrames/HideALLFramesTB"
//////////////////////////////////////////////////////////////////////////
//shows the frame if it is hidden,
@@ -143,7 +134,7 @@ typedef struct tagCLISTFrame { //lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
//note that Frame number will be taken only if wParam == 0
-#define MS_CLIST_FRAMES_SHFRAME "CListFrames/SHFrame"
+#define MS_CLIST_FRAMES_SHFRAME "CListFrames/SHFrame"
//////////////////////////////////////////////////////////////////////////
//shows the frame titlebar if it is hidden,
@@ -152,7 +143,7 @@ typedef struct tagCLISTFrame { //lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
//note that Frame number will be taken only if wParam == 0
-#define MS_CLIST_FRAMES_SHFRAMETITLEBAR "CListFrame/SHFrameTitleBar"
+#define MS_CLIST_FRAMES_SHFRAMETITLEBAR "CListFrame/SHFrameTitleBar"
//////////////////////////////////////////////////////////////////////////
//locks the frame if it is unlocked,
@@ -161,7 +152,7 @@ typedef struct tagCLISTFrame { //lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
//note that Frame number will be taken only if wParam == 0
-#define MS_CLIST_FRAMES_ULFRAME "CListFrame/ULFrame"
+#define MS_CLIST_FRAMES_ULFRAME "CListFrame/ULFrame"
//////////////////////////////////////////////////////////////////////////
//collapses the frame if it is uncollapsed,
@@ -170,7 +161,7 @@ typedef struct tagCLISTFrame { //lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
//note that Frame number will be taken only if wParam == 0
-#define MS_CLIST_FRAMES_UCOLLFRAME "CListFrame/UCOLLFrame"
+#define MS_CLIST_FRAMES_UCOLLFRAME "CListFrame/UCOLLFrame"
//////////////////////////////////////////////////////////////////////////
//trigger border flags
@@ -178,20 +169,20 @@ typedef struct tagCLISTFrame { //lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
//note that Frame number will be taken only if wParam == 0
-#define MS_CLIST_FRAMES_SETUNBORDER "CListFrame/SetUnBorder"
+#define MS_CLIST_FRAMES_SETUNBORDER "CListFrame/SetUnBorder"
//////////////////////////////////////////////////////////////////////////
//trigger skinned flags
//wparam=frameid
//lparam=0
-#define MS_CLIST_FRAMES_SETSKINNED "CListFrame/SetSkinnedFrame"
+#define MS_CLIST_FRAMES_SETSKINNED "CListFrame/SetSkinnedFrame"
//////////////////////////////////////////////////////////////////////////
//redraws the frame
//wParam=FrameId, -1 for all frames
//lparam=FU_flags
//returns a pointer to option, -1 on failure
-#define MS_CLIST_FRAMES_UPDATEFRAME "CListFrame/UpdateFrame"
+#define MS_CLIST_FRAMES_UPDATEFRAME "CListFrame/UpdateFrame"
//////////////////////////////////////////////////////////////////////////
//gets the frame options
@@ -199,14 +190,14 @@ typedef struct tagCLISTFrame { //(LOWORD)wParam=FO_flag
//lParam=0
//returns a pointer to option, -1 on failure
-#define MS_CLIST_FRAMES_GETFRAMEOPTIONS "CListFrame/GetFrameOptions"
+#define MS_CLIST_FRAMES_GETFRAMEOPTIONS "CListFrame/GetFrameOptions"
//sets the frame options
//(HIWORLD)wParam=FrameId
//(LOWORD)wParam=FO_flag
//lParam=value
//returns 0 on success, -1 on failure
-#define MS_CLIST_FRAMES_SETFRAMEOPTIONS "CListFrame/SetFrameOptions"
+#define MS_CLIST_FRAMES_SETFRAMEOPTIONS "CListFrame/SetFrameOptions"
//////////////////////////////////////////////////////////////////////////
//Frames related menu stuff
@@ -230,7 +221,7 @@ __forceinline HGENMENU Menu_AddContextFrameMenuItem(TMO_MenuItem *pmi) //wparam=frameid
//lParam=0
//returns a HMENU on success, or NULL on failure
-#define MS_CLIST_MENUBUILDFRAMECONTEXT "CList/BuildContextFrameMenu"
+#define MS_CLIST_MENUBUILDFRAMECONTEXT "CList/BuildContextFrameMenu"
//////////////////////////////////////////////////////////////////////////
// the frame menu is about to be built
@@ -247,11 +238,11 @@ __forceinline HGENMENU Menu_AddContextFrameMenuItem(TMO_MenuItem *pmi) // MS_CLIST_ADDMAINMENUITEM
// MS_CLIST_REMOVEMAINMENUITEM
//
-#define ME_CLIST_PREBUILDFRAMEMENU "CList/PreBuildFrameMenu"
+#define ME_CLIST_PREBUILDFRAMEMENU "CList/PreBuildFrameMenu"
//////////////////////////////////////////////////////////////////////////
//needed by cluiframes module to add frames menu to main menu.
//it just calls NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
-#define MS_CLIST_FRAMEMENUNOTIFY "CList/ContextFrameMenuNotify"
+#define MS_CLIST_FRAMEMENUNOTIFY "CList/ContextFrameMenuNotify"
#endif /* M_CLUIFRAMES_H__ */
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index e858c37b6d..4837b5f28e 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -221,6 +221,7 @@ public: int addEffect(struct EffectID *pEffect);
int addEffect(struct EffectIDW *pEffect);
+ int addFrame(const struct CLISTFrame*);
int addHotkey(const struct HOTKEYDESC*);
int addSound(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = nullptr);
int addUserInfo(WPARAM wParam, struct OPTIONSDIALOGPAGE *odp);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 9d22c43486..03b0b88f8e 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 67c18be9df..1e7fb0deb2 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index b2f4221e09..87a1f7bd7a 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -492,13 +492,13 @@ int CreateFrame() 0, 0, 10, 10, g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { sizeof(CLISTFrame) };
- Frame.tname = TranslateT("Alarms");
+ Frame.szName.a = LPGEN("Alarms");
Frame.hWnd = hwnd_plugin;
Frame.align = alBottom;
- Frame.Flags = F_UNICODE | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
+ Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
Frame.height = 30;
Frame.hIcon = hIconMenuSet;
- frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ frame_id = g_plugin.addFrame(&Frame);
}
else {
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index c27c96c3fe..3c1f18750e 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* Show Frame */
static HWND hwndCountdownFrame;
-static WORD hFrame;
+static int hFrame;
/* Misc */
static HANDLE hHookModulesLoaded;
@@ -494,18 +494,18 @@ void ShowCountdownFrame(WORD fTimeFlags) if (hwndCountdownFrame == nullptr) return;
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- CLISTFrame clf = { sizeof(clf) };
- clf.hIcon = IcoLib_GetIcon("AutoShutdown_Active"); /* CListFrames does not make a copy */
- clf.align = alBottom;
- clf.height = GetSystemMetrics(SM_CYICON);
- clf.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_SKINNED;
- clf.name = Translate(MODULENAME);
- clf.TBname = Translate("Automatic shutdown");
- clf.hWnd = hwndCountdownFrame;
- hFrame = (WORD)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&clf, 0);
+ CLISTFrame Frame = { sizeof(Frame) };
+ Frame.hIcon = IcoLib_GetIcon("AutoShutdown_Active"); /* CListFrames does not make a copy */
+ Frame.align = alBottom;
+ Frame.height = GetSystemMetrics(SM_CYICON);
+ Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_SKINNED;
+ Frame.szName.a = MODULENAME;
+ Frame.szTBname.a = LPGEN("Automatic shutdown");
+ Frame.hWnd = hwndCountdownFrame;
+ hFrame = g_plugin.addFrame(&Frame);
if (hFrame) {
ShowWindow(hwndCountdownFrame, SW_SHOW);
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrame), (LPARAM)clf.name);
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrame), (LPARAM)MODULENAME);
/* HACKS TO FIX CLUI FRAMES:
* *** why is CLUIFrames is horribly buggy??! *** date: sept 2005, nothing changed until sept 2006
* workaround #1: MS_CLIST_FRAMES_REMOVEFRAME does not finish with destroy cycle (clist_modern, clist_nicer crashes) */
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index bde69bdc88..fa367f8420 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -63,11 +63,11 @@ static BOOL QuietTime, Preview, EnPreview; static int Volume;
static int device = -1;
static int newBass = 0;
+static int frame_id = 0;
HWND hwndSlider = nullptr, hwndMute = nullptr, hwndOptSlider = nullptr, hwnd_plugin = nullptr;
COLORREF clBack = 0;
HBRUSH hBkgBrush = nullptr;
-HANDLE frame_id = nullptr;
HANDLE hBASSFolder = nullptr, hPlaySound = nullptr;
static int OnPlaySnd(WPARAM wParam, LPARAM lParam)
@@ -447,13 +447,13 @@ void CreateFrame() WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { sizeof(CLISTFrame) };
- Frame.tname = TranslateT("BASS Interface");
+ Frame.szName.a = LPGEN("BASS Interface");
Frame.hWnd = hwnd_plugin;
Frame.align = alBottom;
- Frame.Flags = F_UNICODE | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
+ Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
Frame.height = 22;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- frame_id = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ frame_id = g_plugin.addFrame(&Frame);
ColourIDW colourid = { 0 };
colourid.cbSize = sizeof(ColourIDW);
@@ -475,7 +475,7 @@ void DeleteFrame() if (hBkgBrush)
DeleteObject(hBkgBrush);
- CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)frame_id, 0);
+ CallService(MS_CLIST_FRAMES_REMOVEFRAME, frame_id, 0);
}
void LoadBassLibrary(const wchar_t *ptszPath)
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index d28d9068bf..6d85477399 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -733,9 +733,9 @@ static int CLUIFramesGetalClientFrame(void) /////////////////////////////////////////////////////////////////////////////////////////
-static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, int frameid, bool bMain)
+static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, FRAMEWND &F, int frameid, bool bMain)
{
- pmi->langId = g_plugin.m_hLang;
+ pmi->langId = F.hLang;
HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi);
if (pmi->pszService != nullptr)
Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, frameid);
@@ -748,7 +748,8 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp return nullptr;
int framepos = id2pos(frameid);
- FrameMenuHandles &fmh = (frameid == -1) ? cont : g_pfwFrames[framepos].MenuHandles;
+ auto &F = g_pfwFrames[framepos];
+ FrameMenuHandles &fmh = (frameid == -1) ? cont : F.MenuHandles;
CMenuItem mi(g_plugin);
mi.root = root;
@@ -756,37 +757,37 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.name.a = LPGEN("&Visible");
mi.flags = CMIF_SYSTEM | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SHFRAME;
- fmh.MIVisible = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIVisible = addFrameMenuItem(&mi, F, frameid, bMain);
popuppos += 100000;
mi.position = popuppos++;
mi.name.a = LPGEN("&Show title");
mi.pszService = MS_CLIST_FRAMES_SHFRAMETITLEBAR;
- fmh.MITBVisible = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MITBVisible = addFrameMenuItem(&mi, F, frameid, bMain);
mi.position = popuppos++;
mi.name.a = LPGEN("&Locked");
mi.pszService = MS_CLIST_FRAMES_ULFRAME;
- fmh.MILock = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MILock = addFrameMenuItem(&mi, F, frameid, bMain);
mi.position = popuppos++;
mi.name.a = LPGEN("&Expanded");
mi.pszService = MS_CLIST_FRAMES_UCOLLFRAME;
- fmh.MIColl = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIColl = addFrameMenuItem(&mi, F, frameid, bMain);
// floating
mi.position = popuppos++;
mi.name.a = LPGEN("&Floating mode");
mi.flags = CMIF_SYSTEM;
mi.pszService = "Set_Floating";
- fmh.MIFloating = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIFloating = addFrameMenuItem(&mi, F, frameid, bMain);
mi.position = popuppos++;
mi.name.a = LPGEN("&Border");
mi.flags = CMIF_SYSTEM | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETUNBORDER;
- fmh.MIBorder = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIBorder = addFrameMenuItem(&mi, F, frameid, bMain);
popuppos += 100000;
@@ -795,43 +796,43 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.name.a = LPGEN("&Align");
mi.flags = CMIF_SYSTEM;
mi.pszService = nullptr;
- fmh.MIAlignRoot = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIAlignRoot = addFrameMenuItem(&mi, F, frameid, bMain);
// align top
mi.root = fmh.MIAlignRoot;
mi.position = popuppos++;
mi.name.a = LPGEN("&Top");
mi.pszService = CLUIFRAMESSETALIGNALTOP;
- fmh.MIAlignTop = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIAlignTop = addFrameMenuItem(&mi, F, frameid, bMain);
// align client
mi.position = popuppos++;
mi.name.a = LPGEN("&Client");
mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
- fmh.MIAlignClient = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIAlignClient = addFrameMenuItem(&mi, F, frameid, bMain);
// align bottom
mi.position = popuppos++;
mi.name.a = LPGEN("&Bottom");
mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
- fmh.MIAlignBottom = addFrameMenuItem(&mi, frameid, bMain);
+ fmh.MIAlignBottom = addFrameMenuItem(&mi, F, frameid, bMain);
// position root
mi.root = root;
mi.position = popuppos++;
mi.name.a = LPGEN("&Position");
mi.pszService = nullptr;
- mi.root = addFrameMenuItem(&mi, frameid, bMain);
+ mi.root = addFrameMenuItem(&mi, F, frameid, bMain);
mi.position = popuppos++;
mi.name.a = LPGEN("&Up");
mi.pszService = CLUIFRAMESMOVEUP;
- addFrameMenuItem(&mi, frameid, bMain);
+ addFrameMenuItem(&mi, F, frameid, bMain);
mi.position = popuppos++;
mi.name.a = LPGEN("&Down");
mi.pszService = CLUIFRAMESMOVEDOWN;
- addFrameMenuItem(&mi, frameid, bMain);
+ addFrameMenuItem(&mi, F, frameid, bMain);
return nullptr;
}
@@ -1040,7 +1041,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) fw.TitleBar.tbname = mir_a2u((char*)lParam);
if (fw.floating && (fw.TitleBar.tbname != nullptr))
- SetWindowText(fw.ContainerWnd, fw.TitleBar.tbname);
+ SetWindowText(fw.ContainerWnd, TranslateW_LP(fw.TitleBar.tbname, fw.hLang));
return 0;
case FO_TBTIPNAME:
@@ -1162,23 +1163,24 @@ static int _us_DoShowHideFrame(WPARAM wParam, LPARAM lParam) int pos = (wParam == 0) ? lParam : id2pos(wParam);
if (pos >= 0 && pos < g_nFramesCount) {
- g_pfwFrames[pos].visible = !g_pfwFrames[pos].visible;
+ auto &F = g_pfwFrames[pos];
+ F.visible = !F.visible;
CLUIFramesStoreFrameSettings(pos);
- if (g_pfwFrames[pos].OwnerWindow != (HWND)-2) {
- if (g_pfwFrames[pos].OwnerWindow)
- CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
- else if (g_pfwFrames[pos].visible) {
- g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_clistApi.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
- SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].OwnerWindow);
- CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ if (F.OwnerWindow != (HWND)-2) {
+ if (F.OwnerWindow)
+ CLUI_ShowWindowMod(F.OwnerWindow, (F.visible && F.collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ else if (F.visible) {
+ F.OwnerWindow = CreateSubContainerWindow(g_clistApi.hwndContactList, F.FloatingPos.x, F.FloatingPos.y, 10, 10);
+ SetParent(F.hWnd, F.OwnerWindow);
+ CLUI_ShowWindowMod(F.OwnerWindow, (F.visible && F.collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
}
}
- if (g_pfwFrames[pos].floating)
+ if (F.floating)
CLUIFrameResizeFloatingFrame(pos);
- if (!g_pfwFrames[pos].floating)
+ if (!F.floating)
CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
}
return 0;
@@ -1505,11 +1507,8 @@ static HFONT CLUILoadTitleBarFont() //wparam = (CLISTFrame*)clfrm
-static int _us_DoAddFrame(WPARAM wParam, LPARAM)
+static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
{
- int retval;
- LONG_PTR style;
- //char * CustomName = nullptr;
CLISTFrame *clfrm = (CLISTFrame *)wParam;
if (g_clistApi.hwndContactList == nullptr) return -1;
@@ -1526,6 +1525,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) F.hWnd = clfrm->hWnd;
F.height = clfrm->height;
F.TitleBar.hicon = clfrm->hIcon;
+ F.hLang = (int)lParam;
F.floating = FALSE;
if (clfrm->Flags & F_NO_SUBCONTAINER || !g_CluiData.fLayered)
F.OwnerWindow = (HWND)-2;
@@ -1537,17 +1537,17 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) F.dwFlags = clfrm->Flags;
- if (clfrm->name == nullptr || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
+ if (clfrm->szName.a == nullptr || ((clfrm->Flags & F_UNICODE) ? mir_wstrlen(clfrm->szName.w) : mir_strlen(clfrm->szName.a)) == 0) {
F.name = (LPTSTR)mir_alloc(255 * sizeof(wchar_t));
GetClassName(F.hWnd, F.name, 255);
}
- else F.name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->wname) : mir_a2u(clfrm->name);
+ else F.name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->szName.w) : mir_a2u(clfrm->szName.a);
- if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == nullptr
- || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0)
+ if (IsBadCodePtr((FARPROC)clfrm->szTBname.a) || clfrm->szTBname.a == nullptr
+ || ((clfrm->Flags & F_UNICODE) ? mir_wstrlen(clfrm->szTBname.w) : mir_strlen(clfrm->szTBname.a)) == 0)
F.TitleBar.tbname = mir_wstrdup(F.name);
else
- F.TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->TBwname) : mir_a2u(clfrm->TBname);
+ F.TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->szTBname.w) : mir_a2u(clfrm->szTBname.a);
F.needhide = FALSE;
F.TitleBar.ShowTitleBar = (clfrm->Flags & F_SHOWTB ? TRUE : FALSE);
@@ -1556,11 +1556,11 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) F.collapsed = (clfrm->Flags & F_UNCOLLAPSED) ? FALSE : TRUE;
F.Locked = clfrm->Flags & F_LOCKED ? TRUE : FALSE;
F.visible = clfrm->Flags & F_VISIBLE ? TRUE : FALSE;
- F.UseBorder = ((clfrm->Flags&F_NOBORDER) || g_CluiData.fLayered) ? FALSE : TRUE;
+ F.UseBorder = ((clfrm->Flags & F_NOBORDER) || g_CluiData.fLayered) ? FALSE : TRUE;
//Frames[nFramescount].OwnerWindow = 0;
- F.TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName, F.name,
+ F.TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName, TranslateW_LP(F.name, F.hLang),
(db_get_b(0, CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER)
| WS_CHILD | WS_CLIPCHILDREN |
(F.TitleBar.ShowTitleBar ? WS_VISIBLE : 0) |
@@ -1591,7 +1591,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) F.TitleBar.oldstyles = GetWindowLongPtr(F.TitleBar.hwnd, GWL_STYLE);
//Frames[nFramescount].FloatingPos.x =
- retval = F.id;
+ int retval = F.id;
F.order = g_nFramesCount + 1;
g_nFramesCount++;
@@ -1600,7 +1600,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) F.height = 0;
// create frame
- style = GetWindowLongPtr(F.hWnd, GWL_STYLE);
+ LONG_PTR style = GetWindowLongPtr(F.hWnd, GWL_STYLE);
style &= (~WS_BORDER);
style |= (((F.UseBorder) && !g_CluiData.fLayered) ? WS_BORDER : 0);
SetWindowLongPtr(F.hWnd, GWL_STYLE, style);
@@ -1871,7 +1871,6 @@ static int CLUIFramesResizeFrames(const RECT newsize) int topBorder = newsize.top;
SortData *sdarray;
-
g_CluiData.nGapBetweenTitlebar = (int)db_get_dw(0, "CLUIFrames", "GapBetweenTitleBar", SETTING_GAPTITLEBAR_DEFAULT);
GapBetweenFrames = db_get_dw(0, "CLUIFrames", "GapBetweenFrames", SETTING_GAPFRAMES_DEFAULT);
@@ -2492,7 +2491,9 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid) textrc.left += GetSystemMetrics(SM_CXSMICON) + 2;
textrc.top += 2;
}
- ske_TextOut(hdcMem, textrc.left, textrc.top, F.TitleBar.tbname, (int)mir_wstrlen(F.TitleBar.tbname));
+
+ wchar_t *wszTitle = TranslateW_LP(F.TitleBar.tbname, F.hLang);
+ ske_TextOut(hdcMem, textrc.left, textrc.top, wszTitle, (int)mir_wstrlen(wszTitle));
if (!AlignCOLLIconToLeft)
ske_DrawIconEx(hdcMem, F.TitleBar.wndSize.right - GetSystemMetrics(SM_CXSMICON) - 2, rc.top + ((g_nTitleBarHeight >> 1) - (GetSystemMetrics(SM_CXSMICON) >> 1)), F.collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, nullptr, DI_NORMAL);
@@ -3167,25 +3168,26 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) if (pos < 0 || pos >= g_nFramesCount)
return 0;
- if (g_pfwFrames[pos].floating || (lParam & 2)) {
- if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].visible) {
- if (g_pfwFrames[pos].OwnerWindow == nullptr) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(g_clistApi.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
- CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
- SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].OwnerWindow);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_clistApi.hwndContactList);
- SetWindowLongPtr(g_pfwFrames[pos].OwnerWindow, GWLP_USERDATA, g_pfwFrames[pos].id);
- g_pfwFrames[pos].floating = FALSE;
+ auto &F = g_pfwFrames[pos];
+ if (F.floating || (lParam & 2)) {
+ if (F.OwnerWindow != (HWND)-2 && F.visible) {
+ if (F.OwnerWindow == nullptr) F.OwnerWindow = CreateSubContainerWindow(g_clistApi.hwndContactList, F.FloatingPos.x, F.FloatingPos.y, 10, 10);
+ CLUI_ShowWindowMod(F.OwnerWindow, (F.visible && F.collapsed && IsWindowVisible(g_clistApi.hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
+ SetParent(F.hWnd, F.OwnerWindow);
+ SetParent(F.TitleBar.hwnd, g_clistApi.hwndContactList);
+ SetWindowLongPtr(F.OwnerWindow, GWLP_USERDATA, F.id);
+ F.floating = FALSE;
if (!(lParam & 2)) {
- DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd = nullptr;
+ DestroyWindow(F.ContainerWnd);
+ F.ContainerWnd = nullptr;
}
}
else {
- SetParent(g_pfwFrames[pos].hWnd, g_clistApi.hwndContactList);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_clistApi.hwndContactList);
- g_pfwFrames[pos].floating = FALSE;
- if (g_pfwFrames[pos].ContainerWnd) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd = nullptr;
+ SetParent(F.hWnd, g_clistApi.hwndContactList);
+ SetParent(F.TitleBar.hwnd, g_clistApi.hwndContactList);
+ F.floating = FALSE;
+ if (F.ContainerWnd) DestroyWindow(F.ContainerWnd);
+ F.ContainerWnd = nullptr;
}
}
else {
@@ -3193,61 +3195,61 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) LONG_PTR temp;
int neww, newh;
- g_pfwFrames[pos].oldstyles = GetWindowLongPtr(g_pfwFrames[pos].hWnd, GWL_STYLE);
- g_pfwFrames[pos].TitleBar.oldstyles = GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd, GWL_STYLE);
- bool locked = g_pfwFrames[pos].Locked;
- g_pfwFrames[pos].Locked = FALSE;
- g_pfwFrames[pos].minmaxenabled = FALSE;
+ F.oldstyles = GetWindowLongPtr(F.hWnd, GWL_STYLE);
+ F.TitleBar.oldstyles = GetWindowLongPtr(F.TitleBar.hwnd, GWL_STYLE);
+ bool locked = F.Locked;
+ F.Locked = FALSE;
+ F.minmaxenabled = FALSE;
- GetWindowRect(g_pfwFrames[pos].hWnd, &rectw);
- GetWindowRect(g_pfwFrames[pos].TitleBar.hwnd, &recttb);
- if (!g_pfwFrames[pos].TitleBar.ShowTitleBar)
+ GetWindowRect(F.hWnd, &rectw);
+ GetWindowRect(F.TitleBar.hwnd, &recttb);
+ if (!F.TitleBar.ShowTitleBar)
recttb.top = recttb.bottom = recttb.left = recttb.right = 0;
- g_pfwFrames[pos].ContainerWnd = CreateContainerWindow(g_clistApi.hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ F.ContainerWnd = CreateContainerWindow(g_clistApi.hwndContactList, F.FloatingPos.x, F.FloatingPos.y, 10, 10);
- SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].ContainerWnd);
- SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_pfwFrames[pos].ContainerWnd);
- if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].OwnerWindow != nullptr) {
- DestroyWindow(g_pfwFrames[pos].OwnerWindow);
- g_pfwFrames[pos].OwnerWindow = nullptr;
+ SetParent(F.hWnd, F.ContainerWnd);
+ SetParent(F.TitleBar.hwnd, F.ContainerWnd);
+ if (F.OwnerWindow != (HWND)-2 && F.OwnerWindow != nullptr) {
+ DestroyWindow(F.OwnerWindow);
+ F.OwnerWindow = nullptr;
}
- GetBorderSize(g_pfwFrames[pos].ContainerWnd, &border);
+ GetBorderSize(F.ContainerWnd, &border);
- SetWindowLongPtr(g_pfwFrames[pos].ContainerWnd, GWLP_USERDATA, g_pfwFrames[pos].id);
+ SetWindowLongPtr(F.ContainerWnd, GWLP_USERDATA, F.id);
if ((lParam == 1)) {
- if (g_pfwFrames[pos].FloatingPos.x < 0) { g_pfwFrames[pos].FloatingPos.x = 0; };
- if (g_pfwFrames[pos].FloatingPos.y < 0) { g_pfwFrames[pos].FloatingPos.y = 0; };
+ if (F.FloatingPos.x < 0) { F.FloatingPos.x = 0; };
+ if (F.FloatingPos.y < 0) { F.FloatingPos.y = 0; };
- SetWindowPos(g_pfwFrames[pos].ContainerWnd, HWND_TOPMOST, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, g_pfwFrames[pos].FloatingSize.x, g_pfwFrames[pos].FloatingSize.y, SWP_HIDEWINDOW | SWP_NOACTIVATE);
+ SetWindowPos(F.ContainerWnd, HWND_TOPMOST, F.FloatingPos.x, F.FloatingPos.y, F.FloatingSize.x, F.FloatingSize.y, SWP_HIDEWINDOW | SWP_NOACTIVATE);
}
else if (lParam == 0) {
neww = rectw.right - rectw.left + border.left + border.right;
newh = (rectw.bottom - rectw.top) + (recttb.bottom - recttb.top) + border.top + border.bottom;
if (neww < 20) { neww = 40; };
if (newh < 20) { newh = 40; };
- if (g_pfwFrames[pos].FloatingPos.x < 20) { g_pfwFrames[pos].FloatingPos.x = 40; };
- if (g_pfwFrames[pos].FloatingPos.y < 20) { g_pfwFrames[pos].FloatingPos.y = 40; };
+ if (F.FloatingPos.x < 20) { F.FloatingPos.x = 40; };
+ if (F.FloatingPos.y < 20) { F.FloatingPos.y = 40; };
- SetWindowPos(g_pfwFrames[pos].ContainerWnd, HWND_TOPMOST, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, neww, newh, SWP_HIDEWINDOW | SWP_NOACTIVATE);
+ SetWindowPos(F.ContainerWnd, HWND_TOPMOST, F.FloatingPos.x, F.FloatingPos.y, neww, newh, SWP_HIDEWINDOW | SWP_NOACTIVATE);
}
- SetWindowText(g_pfwFrames[pos].ContainerWnd, g_pfwFrames[pos].TitleBar.tbname);
+ SetWindowText(F.ContainerWnd, F.TitleBar.tbname);
- temp = GetWindowLongPtr(g_pfwFrames[pos].ContainerWnd, GWL_EXSTYLE);
+ temp = GetWindowLongPtr(F.ContainerWnd, GWL_EXSTYLE);
temp |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
- SetWindowLongPtr(g_pfwFrames[pos].ContainerWnd, GWL_EXSTYLE, temp);
+ SetWindowLongPtr(F.ContainerWnd, GWL_EXSTYLE, temp);
- g_pfwFrames[pos].floating = TRUE;
- g_pfwFrames[pos].Locked = locked;
+ F.floating = TRUE;
+ F.Locked = locked;
}
CLUIFramesStoreFrameSettings(pos);
- g_pfwFrames[pos].minmaxenabled = TRUE;
- hwndtooltiptmp = g_pfwFrames[pos].TitleBar.hwndTip;
+ F.minmaxenabled = TRUE;
+ hwndtooltiptmp = F.TitleBar.hwndTip;
- hwndtmp = g_pfwFrames[pos].ContainerWnd;
+ hwndtmp = F.ContainerWnd;
CLUIFramesOnClistResize((WPARAM)g_clistApi.hwndContactList, 0);
if (hwndtmp)
diff --git a/plugins/Clist_modern/src/cluiframes.h b/plugins/Clist_modern/src/cluiframes.h index 155fdba991..a7a24d3a81 100644 --- a/plugins/Clist_modern/src/cluiframes.h +++ b/plugins/Clist_modern/src/cluiframes.h @@ -117,6 +117,7 @@ struct FRAMEWND POINT FloatingPos;
POINT FloatingSize;
int order;
+ int hLang;
DockOpt dockOpt;
HWND OwnerWindow;
tPaintCallbackProc PaintCallbackProc;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 62447a7711..e5231d0b19 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /**************************************************/
/* Declarations */
-static HANDLE hNotifyFrame = nullptr;
+static int hNotifyFrame = 0;
/**************************************************/
@@ -77,11 +77,11 @@ static void EventArea_HideShowNotifyFrame() if (desired) {
if (!dwVisible)
- CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
+ CallService(MS_CLIST_FRAMES_SHFRAME, hNotifyFrame, 0);
}
else {
if (dwVisible)
- CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
+ CallService(MS_CLIST_FRAMES_SHFRAME, hNotifyFrame, 0);
}
}
@@ -502,11 +502,11 @@ int EventArea_Create(HWND hCluiWnd) Frame.hWnd = g_CluiData.hwndEventFrame;
Frame.align = alBottom;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = (db_get_b(0, "CLUI", "ShowEventArea", SETTING_SHOWEVENTAREAFRAME_DEFAULT) ? F_VISIBLE : 0) | F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
+ Frame.Flags = (db_get_b(0, "CLUI", "ShowEventArea", SETTING_SHOWEVENTAREAFRAME_DEFAULT) ? F_VISIBLE : 0) | F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER;
Frame.height = h;
- Frame.tname = L"EventArea"; //do not translate
- Frame.TBtname = TranslateT("Event area");
- hNotifyFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ Frame.szName.a = "EventArea";
+ Frame.szTBname.a = LPGEN("Event area");
+ hNotifyFrame = g_plugin.addFrame(&Frame);
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)Frame.hWnd, (LPARAM)EventArea_PaintCallbackProc); //$$$$$ register sub for frame
CallService(MS_CLIST_FRAMES_UPDATEFRAME, -1, 0);
EventArea_HideShowNotifyFrame();
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index be0136f7e5..181d59c2e1 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -411,10 +411,10 @@ HRESULT CLUI::CreateCLC() Frame.hWnd = g_clistApi.hwndContactTree;
Frame.align = alClient;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_UNICODE;
- Frame.tname = LPGENW("My contacts");
- Frame.TBtname = TranslateT("My contacts");
- hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER;
+ Frame.szName.a = LPGEN("My contacts");
+ Frame.szTBname.a = LPGEN("My contacts");
+ hFrameContactTree = (HWND)g_plugin.addFrame(&Frame);
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)Frame.hWnd, (LPARAM)CLCPaint::PaintCallbackProc);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrameContactTree), (LPARAM)Translate("My Contacts"));
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 4d40efc5ad..a261c96ae2 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -11,7 +11,6 @@ POINT lastpnt; #define TM_STATUSBARHIDE 23435235
HWND hModernStatusBar = nullptr;
-HANDLE hFramehModernStatusBar = nullptr;
#define DBFONTF_BOLD 1
#define DBFONTF_ITALIC 2
@@ -877,13 +876,14 @@ HWND StatusBar_Create(HWND parent) Frame.hWnd = hModernStatusBar;
Frame.align = alBottom;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
+ Frame.Flags = F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER;
if (db_get_b(0, "CLUI", "ShowSBar", SETTING_SHOWSBAR_DEFAULT))
Frame.Flags |= F_VISIBLE;
Frame.height = h;
- Frame.tname = L"Status bar";
- Frame.TBtname = TranslateT("Status bar");
- hFramehModernStatusBar = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ Frame.szName.a = "Status bar";
+ Frame.szTBname.a = LPGEN("Status bar");
+ g_plugin.addFrame(&Frame);
+
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)Frame.hWnd, (LPARAM)NewStatusPaintCallbackProc); //$$$$$ register sub for frame
LoadStatusBarData();
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 4baf61d193..e972a3f12b 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -279,13 +279,13 @@ void CustomizeToolbar(HWND hwnd) ModernToolbarCtrl* pMTBInfo = (ModernToolbarCtrl*)GetWindowLongPtr(hwnd, 0);
CLISTFrame Frame = { sizeof(Frame) };
- Frame.tname = L"Toolbar";
+ Frame.szName.a = "Toolbar";
Frame.hWnd = hwnd;
Frame.align = alTop;
- Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_UNICODE | F_NO_SUBCONTAINER;
+ Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_NO_SUBCONTAINER;
Frame.height = 18;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- pMTBInfo->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ pMTBInfo->hFrame = g_plugin.addFrame(&Frame);
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)hwnd, (LPARAM)ToolBar_LayeredPaintProc);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index a94709dc67..a880621876 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -1109,7 +1109,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return TRUE;
}
-static HWND hCLVMFrame;
+static int hCLVMFrame;
HWND g_hwndViewModeFrame;
struct view_mode_t
@@ -1190,20 +1190,19 @@ void CreateViewModeFrame() CLISTFrame frame = { 0 };
frame.cbSize = sizeof(frame);
- frame.tname = L"View modes";
+ frame.szName.a = frame.szTBname.a = "View modes";
frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
frame.height = 18;
- frame.TBtname = TranslateT("View modes");
- frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
+ frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_NO_SUBCONTAINER;
frame.align = alBottom;
frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", _A2W(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, g_clistApi.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
g_hwndViewModeFrame = frame.hWnd;
- hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
- CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
+ hCLVMFrame = g_plugin.addFrame(&frame);
+ CallService(MS_CLIST_FRAMES_UPDATEFRAME, hCLVMFrame, FU_FMPOS);
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)frame.hWnd, (LPARAM)ViewModePaintCallbackProc); //$$$$$ register sub for frame
- ApplyViewMode(nullptr); //Apply last selected view mode
+ ApplyViewMode(nullptr); // Apply last selected view mode
}
void ApplyViewMode(const char *Name, bool onlySelector)
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 715fab58d4..66b3c225bf 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -42,7 +42,7 @@ struct CListImlIcon static int iconsOn;
-HANDLE hNotifyFrame = (HANDLE)-1;
+int hNotifyFrame = -1;
void HideShowNotifyFrame()
{
@@ -56,11 +56,11 @@ void HideShowNotifyFrame() if (desired) {
if (!dwVisible)
- CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
+ CallService(MS_CLIST_FRAMES_SHFRAME, hNotifyFrame, 0);
}
else {
if (dwVisible)
- CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
+ CallService(MS_CLIST_FRAMES_SHFRAME, hNotifyFrame, 0);
}
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 4d08b64480..cf269c7bf4 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -41,7 +41,7 @@ static RECT rcWPC; static int transparentFocus = 1; static byte oldhideoffline; static int disableautoupd = 1; -HANDLE hFrameContactTree; +static int hFrameContactTree; extern RECT old_window_rect, new_window_rect; extern BOOL g_trayTooltipActive; @@ -63,9 +63,8 @@ RECT cluiPos; wchar_t *statusNames[12]; extern LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -extern HANDLE hNotifyFrame; +extern int hNotifyFrame; -int LoadCluiServices(void); void MF_InitCheck(void); void InitGroupMenus(); void FS_RegisterFonts(); @@ -181,16 +180,16 @@ static int CreateCLC() { CLISTFrame frame = { 0 }; frame.cbSize = sizeof(frame); - frame.tname = L"EventArea"; - frame.TBtname = TranslateT("Event area"); + frame.szName.a = "EventArea"; + frame.szTBname.a = LPGEN("Event area"); frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); frame.height = 20; - frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; + frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER; frame.align = alBottom; frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, g_clistApi.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr); g_hwndEventArea = frame.hWnd; - hNotifyFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0); - CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hNotifyFrame, FU_FMPOS); + hNotifyFrame = g_plugin.addFrame(&frame); + CallService(MS_CLIST_FRAMES_UPDATEFRAME, hNotifyFrame, FU_FMPOS); HideShowNotifyFrame(); CreateViewModeFrame(); } @@ -200,11 +199,11 @@ static int CreateCLC() Frame.hWnd = g_clistApi.hwndContactTree; Frame.align = alClient; Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); - Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; - Frame.tname = L"My contacts"; - Frame.TBtname = TranslateT("My contacts"); + Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER; + Frame.szName.a = "My contacts"; + Frame.szTBname.a = LPGEN("My contacts"); Frame.height = 200; - hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); + hFrameContactTree = g_plugin.addFrame(&Frame); CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_UNICODETEXT, hFrameContactTree), (LPARAM)TranslateT("My contacts")); // ugly, but working hack. Prevent that annoying little scroll bar from appearing in the "My Contacts" title bar @@ -583,7 +582,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) if (Docking_IsDocked(0, 0)) return; - if (hFrameContactTree == nullptr) + if (hFrameContactTree == 0) return; maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", 75); diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 5aefb329d5..502d2e8a06 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -1577,18 +1577,18 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) Frames[nFramescount].dwFlags = clfrm->Flags; - if (clfrm->name == nullptr || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) { + if (clfrm->szName.a == nullptr || ((clfrm->Flags & F_UNICODE) ? mir_wstrlen(clfrm->szName.w) : mir_strlen(clfrm->szName.a)) == 0) { wchar_t ptszClassName[256]; GetClassName(Frames[nFramescount].hWnd, ptszClassName, _countof(ptszClassName)); Frames[nFramescount].name = mir_wstrdup(ptszClassName); } - else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->wname) : mir_a2u(clfrm->name); + else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->szName.w) : mir_a2u(clfrm->szName.a); - if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == nullptr - || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0) + if (IsBadCodePtr((FARPROC)clfrm->szTBname.a) || clfrm->szTBname.a == nullptr + || ((clfrm->Flags & F_UNICODE) ? mir_wstrlen(clfrm->szTBname.w) : mir_strlen(clfrm->szTBname.a)) == 0) Frames[nFramescount].TitleBar.tbname = mir_wstrdup(Frames[nFramescount].name); else - Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->TBwname) : mir_a2u(clfrm->TBname); + Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->szTBname.w) : mir_a2u(clfrm->szTBname.a); Frames[nFramescount].needhide = FALSE; Frames[nFramescount].TitleBar.ShowTitleBar = (clfrm->Flags & F_SHOWTB ? TRUE : FALSE); Frames[nFramescount].TitleBar.ShowTitleBarTip = (clfrm->Flags & F_SHOWTBTIP ? TRUE : FALSE); diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index b5429d776b..35a700855d 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -984,7 +984,6 @@ clvm_config_command: return TRUE;
}
-static HWND hCLVMFrame;
HWND g_hwndViewModeFrame;
void CreateViewModeFrame()
@@ -1006,20 +1005,19 @@ void CreateViewModeFrame() memset(&frame, 0, sizeof(frame));
frame.cbSize = sizeof(frame);
- frame.tname = L"View modes";
- frame.TBtname = TranslateT("View modes");
+ frame.szName.a = "View modes";
+ frame.szTBname.a = LPGEN("View modes");
frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
frame.height = 22;
- frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE;
+ frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER;
frame.align = alBottom;
frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", L"CLVM", WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, g_clistApi.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
g_hwndViewModeFrame = frame.hWnd;
- hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
- CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
+
+ int hCLVMFrame = g_plugin.addFrame(&frame);
+ CallService(MS_CLIST_FRAMES_UPDATEFRAME, hCLVMFrame, FU_FMPOS);
}
-const char *MakeVariablesString(const char *src, const char *UIN);
-
void ApplyViewMode(const char *name)
{
cfg::dat.bFilterEffective = 0;
diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index 64aea6c305..00f1c34c83 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -149,7 +149,7 @@ struct TTBCtrlButton struct TTBCtrl
{
HWND hWnd;
- HANDLE hFrame;
+ int hFrame;
int nButtonWidth;
int nButtonHeight;
int nButtonSpace;
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 6574fe47ed..9b1e207684 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -274,17 +274,15 @@ int CreateFrame() hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My details"), WS_CHILD | WS_VISIBLE,
0, 0, 10, 10, g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
- CLISTFrame Frame = { 0 };
-
+ CLISTFrame Frame = {};
Frame.cbSize = sizeof(Frame);
- Frame.tname = TranslateT("My details");
- Frame.cbSize = sizeof(CLISTFrame);
+ Frame.szName.a = LPGEN("My details");
Frame.hWnd = hwnd_frame;
Frame.align = alTop;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_SKINNED | F_UNICODE;
+ Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_SKINNED;
Frame.height = 100;
- frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ frame_id = g_plugin.addFrame(&Frame);
if (db_get_b(NULL, "MyDetails", "ForceHideFrame", 0)) {
int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0);
@@ -303,14 +301,14 @@ int CreateFrame() }
}
else {
- wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;//CS_HREDRAW | CS_VREDRAW;
+ wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = FrameContainerWindowProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = g_plugin.getInst();
wndclass.hIcon = nullptr;
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
- wndclass.hbrBackground = nullptr; //(HBRUSH)(COLOR_3DFACE+1);
+ wndclass.hbrBackground = nullptr;
wndclass.lpszMenuName = nullptr;
wndclass.lpszClassName = CONTAINER_CLASS_NAME;
RegisterClass(&wndclass);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 3673f7e4a2..fa4b172eb2 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -862,15 +862,14 @@ void InitList() hpwnd = CreateWindow(_A2W(MODULENAME) L"WindowClass", L"Ping", (WS_BORDER | WS_CHILD | WS_CLIPCHILDREN), 0, 0, 0, 0, hwnd_clist, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame frame = { 0 };
- frame.name = MODULENAME;
frame.cbSize = sizeof(CLISTFrame);
+ frame.szName.a = MODULENAME;
+ frame.szTBname.a = LPGEN("Ping");
frame.hWnd = hpwnd;
frame.align = alBottom;
frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
frame.height = 30;
- frame.TBname = Translate("Ping");
-
- frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
+ frame_id = g_plugin.addFrame(&frame);
}
else {
hpwnd = CreateWindowEx(WS_EX_TOOLWINDOW, _A2W(MODULENAME) L"WindowClass", L"Ping",
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 195d0e5f05..ae798838c2 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -593,8 +593,8 @@ static int OnShutdown(WPARAM, LPARAM) {
if (g_ctrl) {
if (g_ctrl->hFrame) {
- CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)g_ctrl->hFrame, 0);
- g_ctrl->hFrame = nullptr;
+ CallService(MS_CLIST_FRAMES_REMOVEFRAME, g_ctrl->hFrame, 0);
+ g_ctrl->hFrame = 0;
}
if (g_ctrl->hWnd) {
DestroyWindow(g_ctrl->hWnd);
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 5099ddad7f..3eb9e78cde 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -270,15 +270,15 @@ void CALLBACK OnEventFire() InitInternalButtons(); // if there's no customized frames, create our own - if (g_ctrl->hFrame == nullptr) { + if (g_ctrl->hFrame == 0) { CLISTFrame Frame = { sizeof(Frame) }; - Frame.tname = L"Toolbar"; + Frame.szName.a = "Toolbar"; Frame.hWnd = g_ctrl->hWnd; Frame.align = alTop; - Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_UNICODE; + Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED; Frame.height = g_ctrl->nLastHeight; Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); - g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); + g_ctrl->hFrame = g_plugin.addFrame(&Frame); } // receive buttons diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index b454b80c6c..cc01aa9724 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -65,7 +65,7 @@ unsigned short int Traffic_LineHeight; wchar_t Traffic_CounterFormat[512];
wchar_t Traffic_TooltipFormat[512];
//
-HANDLE Traffic_FrameID = nullptr;
+int Traffic_FrameID = 0;
char Traffic_AdditionSpace;
@@ -139,8 +139,8 @@ int TrafficCounterShutdown(WPARAM, LPARAM) // Удаляем фрейм.
if ((ServiceExists(MS_CLIST_FRAMES_REMOVEFRAME)) && Traffic_FrameID) {
- CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)Traffic_FrameID, 0);
- Traffic_FrameID = nullptr;
+ CallService(MS_CLIST_FRAMES_REMOVEFRAME, Traffic_FrameID, 0);
+ Traffic_FrameID = 0;
}
return 0;
}
@@ -766,7 +766,7 @@ LRESULT CALLBACK TrafficCounterWndProc_MW(HWND hwnd, UINT msg, WPARAM wParam, LP OverallInfo.Total.Timer = (CurrentTimeMs - OverallInfo.Total.TimeAtStart) / 1000;
}
- CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)Traffic_FrameID, FU_FMREDRAW);
+ CallService(MS_CLIST_FRAMES_UPDATEFRAME, Traffic_FrameID, FU_FMREDRAW);
}
break;
@@ -834,10 +834,9 @@ void CreateTrafficWindow(HWND hCluiWnd) f.height = TrafficWindowHeight();
f.Flags = unOptions.FrameIsVisible | F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER;
f.hWnd = TrafficHwnd;
- f.TBname = ("Traffic counter");
- f.name = ("Traffic counter");
+ f.szName.a = f.szTBname.a = LPGEN("Traffic counter");
// Создаём фрейм
- Traffic_FrameID = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&f, 0);
+ Traffic_FrameID = g_plugin.addFrame(&f);
CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)f.hWnd, (LPARAM)TrafficCounter_PaintCallbackProc);
}
@@ -849,10 +848,10 @@ void CreateTrafficWindow(HWND hCluiWnd) INT_PTR MenuCommand_TrafficShowHide(WPARAM, LPARAM)
{
unOptions.FrameIsVisible = !unOptions.FrameIsVisible;
- if (Traffic_FrameID == nullptr)
+ if (Traffic_FrameID == 0)
ShowWindow(TrafficHwnd, unOptions.FrameIsVisible ? SW_SHOW : SW_HIDE);
else
- CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)Traffic_FrameID, 0);
+ CallService(MS_CLIST_FRAMES_SHFRAME, Traffic_FrameID, 0);
db_set_dw(NULL, MODULENAME, SETTINGS_WHAT_DRAW, unOptions.Flags);
//
return 0;
@@ -973,7 +972,7 @@ int UpdateFonts(WPARAM, LPARAM) void UpdateTrafficWindowSize(void)
{
- if (Traffic_FrameID != nullptr)
+ if (Traffic_FrameID != 0)
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, Traffic_FrameID), TrafficWindowHeight());
}
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index e81a01f038..f2181b8475 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -242,14 +242,14 @@ static void addWindow(MCONTACT hContact) WindowList_Add(hMwinWindowList, hWnd, hContact);
CLISTFrame Frame = { 0 };
- Frame.tname = winname;
+ Frame.szName.w = winname;
Frame.hIcon = LoadIconEx("main", FALSE);
Frame.cbSize = sizeof(Frame);
Frame.hWnd = hWnd;
Frame.align = alBottom;
Frame.Flags = F_VISIBLE | F_NOBORDER | F_UNICODE;
Frame.height = 32;
- DWORD frameID = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ int frameID = g_plugin.addFrame(&Frame);
db_set_dw(hContact, WEATHERPROTONAME, "mwin", frameID);
db_set_b(hContact, "CList", "Hidden", TRUE);
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 73436781c3..d91d7afdcb 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -82,11 +82,11 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", nullptr, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, nullptr, g_plugin.getInst(), this);
frame.align = alBottom;
frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default
- frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_UNICODE;
- frame.tname = mir_a2u(proto->m_szModuleName);
- frame.TBtname = proto->m_tszUserName;
- m_frameId = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
- mir_free(frame.tname);
+ frame.Flags = F_VISIBLE | F_LOCKED | F_NOBORDER | F_UNICODE;
+ frame.szName.w = mir_a2u(proto->m_szModuleName);
+ frame.szTBname.w = proto->m_tszUserName;
+ m_frameId = g_plugin.addFrame(&frame);
+ mir_free(frame.szName.w);
if (m_frameId == -1) {
DestroyWindow(frame.hWnd);
return;
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index 397031fa9c..b6fb78d6f4 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -221,6 +221,11 @@ int CMPluginBase::addEffect(EffectIDW *pEffect) ///////////////////////////////////////////////////////////////////////////////////////// +int CMPluginBase::addFrame(const CLISTFrame *F) +{ + return (int)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)F, m_hLang); +} + int CMPluginBase::addHotkey(const HOTKEYDESC *hk) { return Hotkey_Register(hk, m_hLang); diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 950ef2f568..001b75d8f6 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -629,3 +629,4 @@ Profile_GetSettingInt @657 Netlib_GetUserSettingsByName @658
Netlib_SetUserSettingsByName @659
?Backup@MDatabaseCommon@@UAGHPB_W@Z @660 NONAME
+?addFrame@CMPluginBase@@QAEHPBUCLISTFrame@@@Z @661 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index f0153a3013..7ecf390d80 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -629,3 +629,4 @@ Profile_GetSettingInt @657 Netlib_GetUserSettingsByName @658
Netlib_SetUserSettingsByName @659
?Backup@MDatabaseCommon@@UEAAHPEB_W@Z @660 NONAME
+?addFrame@CMPluginBase@@QEAAHPEBUCLISTFrame@@@Z @661 NONAME
diff --git a/src/mir_app/src/stdafx.h b/src/mir_app/src/stdafx.h index 1158f779fa..57234299a6 100644 --- a/src/mir_app/src/stdafx.h +++ b/src/mir_app/src/stdafx.h @@ -90,6 +90,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_timezones.h>
#include <m_extraicons.h>
#include <m_xstatus.h>
+#include <m_cluiframes.h>
#include <m_metacontacts.h>
#include <m_gui.h>
#include <m_srmm_int.h>
|