ba0f4a990cae9e8d8f332bb238f46f52ce2d75c6
6 * Copyright (C) 2007 Timo Kreuzer <timo <dot> kreuzer <at> reactos <dot> org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 MainWindow_OnSize(HWND hMainWnd
)
31 HWND hProcessListctrl
, hHandleListCtrl
, hProcessRefresh
, hHandleRefresh
;
34 hProcessListctrl
= GetDlgItem(hMainWnd
, IDC_PROCESSLIST
);
35 hHandleListCtrl
= GetDlgItem(hMainWnd
, IDC_HANDLELIST
);
36 hProcessRefresh
= GetDlgItem(hMainWnd
, IDC_REFRESHPROCESS
);
37 hHandleRefresh
= GetDlgItem(hMainWnd
, IDC_REFRESHHANDLE
);
39 GetClientRect(hMainWnd
, &rect
);
41 //g_Separator = (rect.right / 2);
42 MoveWindow(hProcessListctrl
, 5, 5, g_Separator
- 5, rect
.bottom
- 40, TRUE
);
43 MoveWindow(hHandleListCtrl
, g_Separator
+ 5, 5, rect
.right
- g_Separator
- 5, rect
.bottom
- 40, TRUE
);
44 MoveWindow(hProcessRefresh
, g_Separator
- 90, rect
.bottom
- 30, 90, 25, TRUE
);
45 MoveWindow(hHandleRefresh
, rect
.right
- 90, rect
.bottom
- 30, 90, 25, TRUE
);
52 MainWnd_OnNotify(HWND hWnd
, WPARAM wParam
, LPARAM lParam
)
54 LPNMHDR pnmh
= (LPNMHDR
)lParam
;
60 LPNMLISTVIEW pnmlv
= (LPNMLISTVIEW
)pnmh
;
61 if ((wParam
== IDC_PROCESSLIST
)
62 && (pnmlv
->uNewState
& LVIS_SELECTED
)
63 && !(pnmlv
->uOldState
& LVIS_SELECTED
))
66 memset(&item
, 0, sizeof(LV_ITEM
));
67 item
.mask
= LVIF_PARAM
;
68 item
.iItem
= pnmlv
->iItem
;
69 (void)ListView_GetItem(GetDlgItem(hWnd
, IDC_PROCESSLIST
), &item
);
70 HandleList_Update(GetDlgItem(hWnd
, IDC_HANDLELIST
), (HANDLE
)item
.lParam
);
81 MainWindow_WndProc(HWND hMainWnd
, UINT message
, WPARAM wParam
, LPARAM lParam
)
89 SendMessage(hMainWnd
, WM_SETICON
, ICON_BIG
, (LPARAM
)LoadIcon(g_hInstance
, MAKEINTRESOURCE(IDI_MAIN
)));
90 (void)ListView_SetExtendedListViewStyle(GetDlgItem(hMainWnd
, IDC_PROCESSLIST
), LVS_EX_FULLROWSELECT
);
91 (void)ListView_SetExtendedListViewStyle(GetDlgItem(hMainWnd
, IDC_HANDLELIST
), LVS_EX_FULLROWSELECT
);
92 GetClientRect(hMainWnd
, &rect
);
93 g_Separator
= (rect
.right
/ 2);
94 HandleList_Create(GetDlgItem(hMainWnd
, IDC_HANDLELIST
));
95 ProcessList_Create(GetDlgItem(hMainWnd
, IDC_PROCESSLIST
));
96 MainWindow_OnSize(hMainWnd
);
101 return MainWindow_OnSize(hMainWnd
);
105 switch (LOWORD(wParam
))
110 EndDialog(hMainWnd
, IDOK
);
113 case IDC_REFRESHHANDLE
:
116 HWND hProcessListCtrl
= GetDlgItem(hMainWnd
, IDC_PROCESSLIST
);
117 memset(&item
, 0, sizeof(LV_ITEM
));
118 item
.mask
= LVIF_PARAM
;
119 item
.iItem
= ListView_GetSelectionMark(hProcessListCtrl
);
120 (void)ListView_GetItem(hProcessListCtrl
, &item
);
121 HandleList_Update(GetDlgItem(hMainWnd
, IDC_HANDLELIST
), (HANDLE
)item
.lParam
);
124 case IDC_REFRESHPROCESS
:
126 ProcessList_Update(GetDlgItem(hMainWnd
, IDC_PROCESSLIST
));
138 return MainWnd_OnNotify(hMainWnd
, wParam
, lParam
);