-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwwi (2).patch
59 lines (53 loc) · 2.11 KB
/
wwi (2).patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- C:/Users/xx/Documents/Visual Studio 2010/Projects/WhenWasIt/dlg_handlers.cpp Thu Sep 15 23:11:52 2011
+++ C:/Users/xx/Documents/Visual Studio 2010/Projects/WhenWasIt_mod/dlg_handlers.cpp Thu Sep 15 23:18:29 2011
@@ -633,38 +633,6 @@
hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
}
-void SavePosition(HWND hWnd, char *wndName)
-{
- RECT rWnd;
- GetWindowRect(hWnd, &rWnd);
- char buffer[512];
- sprintf(buffer, "%sPosX", wndName);
- DBWriteContactSettingDword(0, ModuleName, buffer, rWnd.left);
- sprintf(buffer, "%sPosY", wndName);
- DBWriteContactSettingDword(0, ModuleName, buffer, rWnd.top);
- sprintf(buffer, "%sWidth", wndName);
- DBWriteContactSettingDword(0, ModuleName, buffer, rWnd.right - rWnd.left);
- sprintf(buffer, "%sHeight", wndName);
- DBWriteContactSettingDword(0, ModuleName, buffer, rWnd.bottom - rWnd.top);
-}
-
-void LoadPosition(HWND hWnd, char *wndName)
-{
- int x, y;
- int width = 0, height = 0;
- char buffer[512];
- sprintf(buffer, "%sPosX", wndName);
- x = DBGetContactSettingDword(0, ModuleName, buffer, 0);
- sprintf(buffer, "%sPosY", wndName);
- y = DBGetContactSettingDword(0, ModuleName, buffer, 0);
- sprintf(buffer, "%sWidth", wndName);
- width = DBGetContactSettingDword(0, ModuleName, buffer, 500);
- sprintf(buffer, "%sHeight", wndName);
- height = DBGetContactSettingDword(0, ModuleName, buffer, 300);
- //MoveWindow(hWnd, x, y, width, height, TRUE);
- SetWindowPos(hWnd, NULL, x, y, width, height, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
-}
-
#define NA TranslateT("N/A")
@@ -1000,7 +968,7 @@
params.column = column;
ListView_SortItemsEx(params.hList, BirthdaysCompare, (LPARAM) ¶ms);
- LoadPosition(hWnd, "BirthdayList");
+ Utils_RestoreWindowPosition(hWnd,NULL,ModuleName,"BirthdayList");
return TRUE;
break;
@@ -1009,7 +977,7 @@
case WM_DESTROY:
{
hBirthdaysDlg = NULL;
- SavePosition(hWnd, "BirthdayList");
+ Utils_SaveWindowPosition(hWnd,NULL,ModuleName,"BirthdayList");
lastColumn = -1;
break;