summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-08 21:02:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-08 21:02:06 +0000
commit2840393bf5378c012577c4764dc4cbd162f85d4e (patch)
tree257a83be6f650415d8b47bb982b0bc700e6c9f8c /plugins/TopToolBar
parentd0ffabed30e05f6dc56e2e5231637f333bc16003 (diff)
GetWindowLong -> GetWindowLongPtr
git-svn-id: http://svn.miranda-ng.org/main/trunk@364 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r--plugins/TopToolBar/CLCButton.cpp6
-rw-r--r--plugins/TopToolBar/_button.cpp6
-rw-r--r--plugins/TopToolBar/button.cpp8
-rw-r--r--plugins/TopToolBar/buttonopt.cpp6
-rw-r--r--plugins/TopToolBar/main.cpp20
-rw-r--r--plugins/TopToolBar/ttbopt.cpp12
6 files changed, 30 insertions, 28 deletions
diff --git a/plugins/TopToolBar/CLCButton.cpp b/plugins/TopToolBar/CLCButton.cpp
index c2b197f7dc..7993a085c9 100644
--- a/plugins/TopToolBar/CLCButton.cpp
+++ b/plugins/TopToolBar/CLCButton.cpp
@@ -266,7 +266,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
MButtonCtrl *bct = (MButtonCtrl *) GetWindowLongPtr(hwndDlg, 0);
switch (msg) {
case WM_NCCREATE:
- SetWindowLong(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) | BS_OWNERDRAW);
+ SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) | BS_OWNERDRAW);
bct = ( MButtonCtrl* )malloc(sizeof(MButtonCtrl));
if (bct == NULL)
return FALSE;
@@ -289,7 +289,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
bct->flatBtn = 0;
bct->bThemed = FALSE;
LoadTheme(bct);
- SetWindowLong(hwndDlg, 0, (LONG) bct);
+ SetWindowLongPtr(hwndDlg, 0, (LONG) bct);
if (((CREATESTRUCTA *) lParam)->lpszName)
SetWindowTextA(hwndDlg, ((CREATESTRUCTA *) lParam)->lpszName);
return TRUE;
@@ -591,7 +591,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
DestroyTheme(bct);
free(bct);
}
- SetWindowLong(hwndDlg, 0, (LONG) NULL);
+ SetWindowLongPtr(hwndDlg, 0, (LONG) NULL);
break; // DONT! fall thru
}
diff --git a/plugins/TopToolBar/_button.cpp b/plugins/TopToolBar/_button.cpp
index e1c1a31584..a6d5e3b019 100644
--- a/plugins/TopToolBar/_button.cpp
+++ b/plugins/TopToolBar/_button.cpp
@@ -265,7 +265,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
MButtonCtrl* bct = (MButtonCtrl *)GetWindowLongPtr(hwndDlg, 0);
switch(msg) {
case WM_NCCREATE:
- SetWindowLong(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE)|BS_OWNERDRAW);
+ SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE)|BS_OWNERDRAW);
bct = ( MButtonCtrl* )malloc(sizeof(MButtonCtrl));
if (bct == NULL)
return FALSE;
@@ -285,7 +285,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
bct->cHot = 0;
bct->flatBtn = 0;
LoadTheme(bct);
- SetWindowLong(hwndDlg, 0, (LONG)bct);
+ SetWindowLongPtr(hwndDlg, 0, (LONG)bct);
if (((CREATESTRUCT *)lParam)->lpszName) SetWindowText(hwndDlg, ((CREATESTRUCT *)lParam)->lpszName);
return TRUE;
@@ -312,7 +312,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
DestroyTheme(bct);
free(bct);
}
- SetWindowLong(hwndDlg, 0, (LONG)NULL);
+ SetWindowLongPtr(hwndDlg, 0, (LONG)NULL);
break; // DONT! fall thru
case WM_SETTEXT:
diff --git a/plugins/TopToolBar/button.cpp b/plugins/TopToolBar/button.cpp
index ab6662e6ef..54bf8bf816 100644
--- a/plugins/TopToolBar/button.cpp
+++ b/plugins/TopToolBar/button.cpp
@@ -250,10 +250,10 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MButtonCtrl* bct = (MButtonCtrl *)GetWindowLong(hwndDlg, 0);
+ MButtonCtrl* bct = (MButtonCtrl *)GetWindowLongPtr(hwndDlg, 0);
switch(msg) {
case WM_NCCREATE:
- SetWindowLong(hwndDlg, GWL_STYLE, GetWindowLong(hwndDlg, GWL_STYLE)|BS_OWNERDRAW);
+ SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE)|BS_OWNERDRAW);
bct = (MButtonCtrl*)malloc(sizeof(MButtonCtrl));
if (bct == NULL)
return FALSE;
@@ -273,7 +273,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
bct->cHot = 0;
bct->flatBtn = 0;
LoadTheme(bct);
- SetWindowLong(hwndDlg, 0, (LONG)bct);
+ SetWindowLongPtr(hwndDlg, 0, (LONG)bct);
if (((CREATESTRUCT *)lParam)->lpszName) SetWindowText(hwndDlg, ((CREATESTRUCT *)lParam)->lpszName);
return TRUE;
@@ -504,7 +504,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
DestroyTheme(bct);
free(bct);
}
- SetWindowLong(hwndDlg,0,(LONG)NULL);
+ SetWindowLongPtr(hwndDlg,0,(LONG)NULL);
break; // DONT! fall thru
}
return DefWindowProc(hwndDlg, msg, wParam, lParam);
diff --git a/plugins/TopToolBar/buttonopt.cpp b/plugins/TopToolBar/buttonopt.cpp
index 99f7c0f9de..ace5bc14b4 100644
--- a/plugins/TopToolBar/buttonopt.cpp
+++ b/plugins/TopToolBar/buttonopt.cpp
@@ -69,11 +69,11 @@ static BOOL CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
int i, count;
dat = (struct ProtocolOrderData*)malloc(sizeof(struct ProtocolOrderData));
- SetWindowLong(GetDlgItem(hwndDlg, IDC_PROTOCOLORDER), GWL_USERDATA, (LONG)dat);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLORDER), GWL_USERDATA, (LONG)dat);
dat->dragging = 0;
- SetWindowLong(GetDlgItem(hwndDlg, IDC_PROTOCOLVISIBILITY), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLVISIBILITY), GWL_STYLE)|TVS_NOHSCROLL);
- SetWindowLong(GetDlgItem(hwndDlg, IDC_PROTOCOLORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLORDER), GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLVISIBILITY), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLVISIBILITY), GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLORDER), GWL_STYLE)|TVS_NOHSCROLL);
{ HIMAGELIST himlCheckBoxes;
himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR4|ILC_MASK, 2, 2);
diff --git a/plugins/TopToolBar/main.cpp b/plugins/TopToolBar/main.cpp
index c0008e239b..6597cb041d 100644
--- a/plugins/TopToolBar/main.cpp
+++ b/plugins/TopToolBar/main.cpp
@@ -287,7 +287,7 @@ int CreateOneWindow(int ButtonPos)
else
Buttons[ButtonPos].hwnd = CreateWindow("STATIC", "", WS_CHILD|SS_NOTIFY, 0, 0, BUTTWIDTH, BUTTHEIGHT, hwndTopToolBar, NULL, hInst, 0);
- SetWindowLong(Buttons[ButtonPos].hwnd, GWLP_USERDATA, Buttons[ButtonPos].id);
+ SetWindowLongPtr(Buttons[ButtonPos].hwnd, GWLP_USERDATA, Buttons[ButtonPos].id);
if (DBGetContactSettingByte(0, TTB_OPTDIR, "UseFlatButton", 1))
SendMessage(Buttons[ButtonPos].hwnd, BUTTONSETASFLATBTN, 0, 0);
@@ -382,7 +382,7 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam)
SendMessage(Buttons[i].hwndTip, TTM_ACTIVATE, (WPARAM)(Buttons[i].dwFlags&TTBBF_SHOWTOOLTIP)?TRUE:FALSE, 0);
- SetWindowLong(Buttons[i].hwnd, GWLP_USERDATA, Buttons[i].id);
+ SetWindowLongPtr(Buttons[i].hwnd, GWLP_USERDATA, Buttons[i].id);
nButtonsCount++;
@@ -565,12 +565,12 @@ int SetButtBitmap(int pos)
t = IMAGE_ICON;
curstyle |= (t == IMAGE_ICON || UseIcoLib) ? SS_ICON : SS_BITMAP;
- SetWindowLong(Buttons[pos].hwnd, GWL_STYLE, curstyle);
+ SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle);
}
- else SetWindowLong(Buttons[pos].hwnd, GWL_STYLE, curstyle|(Buttons[pos].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
+ else SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle|(Buttons[pos].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
}
else if (GetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE)&SS_ICON)
- SetWindowLong(Buttons[pos].hwnd, GWL_STYLE, curstyle|SS_ICON);
+ SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle|SS_ICON);
if ( !UseIcoLib||(Buttons[pos].dwFlags & TTBBF_ISSEPARATOR)) {
if (!(Buttons[pos].dwFlags & TTBBF_DRAWBORDER)) {
@@ -1094,7 +1094,7 @@ static int OnmodulesLoad(WPARAM wParam, LPARAM lParam)
static const MUUID interfaces[] = {MIID_TTB, MIID_LAST};
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
@@ -1116,14 +1116,14 @@ PLUGININFOEX pluginInfo =
MIID_TTB
};
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
/////////////////////////////////////////////////////////////////////////////////////////
-int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
pluginLink = link;
mir_getMMI( &mmi );
@@ -1143,7 +1143,9 @@ int __declspec(dllexport) Load(PLUGINLINK *link)
return 0;
}
-int __declspec(dllexport) Unload(void)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+extern "C" int __declspec(dllexport) Unload(void)
{
SaveAllSeparators();
UnInitLBut();
diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp
index f4bddc8f6b..aea347c2fe 100644
--- a/plugins/TopToolBar/ttbopt.cpp
+++ b/plugins/TopToolBar/ttbopt.cpp
@@ -211,10 +211,10 @@ void SetImagesForCurrent (HWND hwndDlg, int curselect)
t = IMAGE_ICON;
int st = WS_CHILDWINDOW | SS_NOTIFY | WS_VISIBLE;
st |= (t == IMAGE_ICON) ? SS_ICON : SS_BITMAP;
- SetWindowLong(GetDlgItem(hwndDlg, IDC_BMPUP), GWL_STYLE, st);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPUP), GWL_STYLE, st);
}
else {
- SetWindowLong(GetDlgItem(hwndDlg, IDC_BMPUP), GWL_STYLE, WS_CHILDWINDOW|WS_VISIBLE|SS_NOTIFY|(Buttons[curselect].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPUP), GWL_STYLE, WS_CHILDWINDOW|WS_VISIBLE|SS_NOTIFY|(Buttons[curselect].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
t = IMAGE_ICON;
}
@@ -226,10 +226,10 @@ void SetImagesForCurrent (HWND hwndDlg, int curselect)
t = IMAGE_ICON;
int st = WS_CHILDWINDOW | SS_NOTIFY | WS_VISIBLE;
st |= (t == IMAGE_ICON) ? SS_ICON : SS_BITMAP;
- SetWindowLong(GetDlgItem(hwndDlg, IDC_BMPDN), GWL_STYLE, st);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPDN), GWL_STYLE, st);
}
else {
- SetWindowLong(GetDlgItem(hwndDlg, IDC_BMPDN), GWL_STYLE, WS_CHILDWINDOW|WS_VISIBLE|SS_NOTIFY|(Buttons[curselect].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPDN), GWL_STYLE, WS_CHILDWINDOW|WS_VISIBLE|SS_NOTIFY|(Buttons[curselect].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
t = IMAGE_ICON;
}
@@ -245,10 +245,10 @@ static BOOL CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
TranslateDialogDefault(hwndDlg);
dat = (struct OrderData*)malloc(sizeof(struct OrderData));
- SetWindowLong(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWLP_USERDATA, (LONG)dat);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWLP_USERDATA, (LONG)dat);
dat->dragging = 0;
- SetWindowLong(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE)|TVS_NOHSCROLL);
{
HIMAGELIST himlCheckBoxes;
himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR4|ILC_MASK, 2, 2);