summaryrefslogtreecommitdiff
path: root/worldtime/plugwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'worldtime/plugwin.cpp')
-rw-r--r--worldtime/plugwin.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/worldtime/plugwin.cpp b/worldtime/plugwin.cpp
index e20030d..ac87a31 100644
--- a/worldtime/plugwin.cpp
+++ b/worldtime/plugwin.cpp
@@ -26,16 +26,11 @@ HWND label;
HWND pluginwind = 0, hwnd_clist = 0;
-static CRITICAL_SECTION cs2;
-
bool hook_window_behaviour_to_clist = true;
bool set_format = false;
bool show_icons = true;
bool hide_menu = false;
-HANDLE status_update_thread = 0;
-
-static HMODULE hUserDll;
BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags);
@@ -329,7 +324,6 @@ LRESULT CALLBACK mypluginwindow1proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
SetBkMode(dis->hDC, TRANSPARENT);
- EnterCriticalSection(&cs2);
pItemData = &listbox_items[dis->itemID];
{
@@ -356,7 +350,6 @@ LRESULT CALLBACK mypluginwindow1proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
}
- LeaveCriticalSection(&cs2);
SetBkMode(dis->hDC, OPAQUE);
SelectObject(dis->hDC, oldFont);
} else {
@@ -388,7 +381,6 @@ LRESULT CALLBACK mypluginwindow1proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
TCHAR buf[512], buf2[512];
MyGetSystemTime(&st);
- EnterCriticalSection(&cs2);
for(int i = 0; i < listbox_items.getCount(); i++) {
TIME_ZONE_INFORMATION tzi;
tzi.Bias = timezone_list[listbox_items[i].timezone_list_index].TZI.Bias;
@@ -427,7 +419,6 @@ LRESULT CALLBACK mypluginwindow1proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
listbox_items[i].icon = (HICON)hIcon;
}
}
- LeaveCriticalSection(&cs2);
if(need_repaint)
InvalidateRect(label, 0, FALSE);
}
@@ -736,14 +727,10 @@ int FillList(WPARAM wParam, LPARAM lParam) {
SendMessage(label, LB_RESETCONTENT, 0, 0);
- EnterCriticalSection(&cs2);
-
for(int i = 0; i < listbox_items.getCount(); i++) {
SendMessage(label, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)listbox_items[i].pszText);
}
- LeaveCriticalSection(&cs2);
-
InvalidateRect(label, 0, TRUE);
return 0;
}
@@ -921,7 +908,7 @@ int addmypluginwindow1(HWND parent)
HookEvent(ME_SKIN_SERVICESCREATED, SkinReload);
}
- hUserDll = GetModuleHandleA("user32");
+ HMODULE hUserDll = GetModuleHandleA("user32");
if (hUserDll) {
MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow");
@@ -929,8 +916,6 @@ int addmypluginwindow1(HWND parent)
hwnd_clist = parent;
- InitializeCriticalSection(&cs2);
-
hook_window_behaviour_to_clist = (DBGetContactSettingByte(NULL, "WorldTime", "MinMax", DEFAULT_MINMAX ? 1 : 0) == 1);
set_format = (DBGetContactSettingByte(NULL, "WorldTime", "EnableTimeFormat", 0) == 1);
show_icons = (DBGetContactSettingByte(NULL, "WorldTime", "ShowIcons", 1) == 1);
@@ -1099,7 +1084,6 @@ void plugwin_cleanup() {
//KillTimer(pluginwind, TIMER_ID2);
DestroyWindow(pluginwind);
- DeleteCriticalSection(&cs2);
-
DeleteObject(ContactFont);
+ DeleteObject(TitleBarFont);
} \ No newline at end of file