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