2 * Copyright (c) 2005 Massachusetts Institute of Technology
\r
4 * Permission is hereby granted, free of charge, to any person
\r
5 * obtaining a copy of this software and associated documentation
\r
6 * files (the "Software"), to deal in the Software without
\r
7 * restriction, including without limitation the rights to use, copy,
\r
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
\r
9 * of the Software, and to permit persons to whom the Software is
\r
10 * furnished to do so, subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be
\r
13 * included in all copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
28 #include<netidmgr_intver.h>
\r
29 #include<tlhelp32.h>
\r
36 about_dlg_proc(HWND hwnd,
\r
47 SetDlgItemText(hwnd, IDC_PRODUCT,
\r
48 TEXT(KH_VERSTR_PRODUCT_1033));
\r
49 SetDlgItemText(hwnd, IDC_COPYRIGHT,
\r
50 TEXT(KH_VERSTR_COPYRIGHT_1033));
\r
51 SetDlgItemText(hwnd, IDC_BUILDINFO,
\r
52 TEXT(KH_VERSTR_BUILDINFO_1033));
\r
55 CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,
\r
58 if (hsnap != INVALID_HANDLE_VALUE) {
\r
63 hw = GetDlgItem(hwnd, IDC_MODULES);
\r
68 GetWindowRect(hw, &r);
\r
69 OffsetRect(&r, -r.left, -r.top);
\r
71 ZeroMemory(&lvc, sizeof(lvc));
\r
72 lvc.mask = LVCF_TEXT | LVCF_WIDTH;
\r
74 lvc.pszText = L"Name";
\r
75 lvc.cx = r.right / 4;
\r
77 ListView_InsertColumn(hw, 0, &lvc);
\r
79 lvc.pszText = L"Path";
\r
80 lvc.cx = (r.right * 3) / 4;
\r
81 ListView_InsertColumn(hw, 1, &lvc);
\r
83 ZeroMemory(&mod, sizeof(mod));
\r
84 mod.dwSize = sizeof(mod);
\r
86 /* done with columns, now for the actual data */
\r
87 if (!Module32First(hsnap, &mod))
\r
88 goto _done_with_modules;
\r
95 ZeroMemory(&lvi, sizeof(lvi));
\r
97 lvi.mask = LVIF_TEXT;
\r
98 lvi.pszText = mod.szModule;
\r
99 idx = ListView_InsertItem(hw, &lvi);
\r
101 lvi.mask = LVIF_TEXT;
\r
104 lvi.pszText = mod.szExePath;
\r
105 ListView_SetItem(hw, &lvi);
\r
107 ZeroMemory(&mod, sizeof(mod));
\r
108 mod.dwSize = sizeof(mod);
\r
109 } while(Module32Next(hsnap, &mod));
\r
111 _done_with_modules:
\r
112 CloseHandle(hsnap);
\r
115 khm_add_dialog(hwnd);
\r
116 khm_enter_modal(hwnd);
\r
121 khm_del_dialog(hwnd);
\r
125 if (wParam == MAKEWPARAM(IDOK, BN_CLICKED)) {
\r
127 DestroyWindow(hwnd);
\r
136 khm_create_about_window(void) {
\r
138 hwnd = CreateDialog(khm_hInstance,
\r
139 MAKEINTRESOURCE(IDD_ABOUT),
\r
143 ShowWindow(hwnd, SW_SHOW);
\r
144 /* no need to keep track of the hwnd, since we add it to the
\r
145 dialog chain in the dialog procedure */
\r