2 * Copyright (c) 2006 Secure Endpoints Inc.
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
30 /* Dialog procedures and support functions for handling configuration
31 dialogs for general plug-in configuration. */
33 /* Structure for holding dialog data for the configuration window. */
34 typedef struct tag_config_main_dlg_data {
35 khui_config_node cnode;
37 /* TODO: add fields as needed */
38 } config_main_dlg_data;
41 config_dlgproc(HWND hwnd,
46 config_main_dlg_data * d;
50 d = malloc(sizeof(*d));
52 ZeroMemory(d, sizeof(*d));
54 /* for configuration panels that are not subpanels, lParam is
55 a held handle to the configuration node. The handle will
56 be held for the lifetime of the window. */
58 d->cnode = (khui_config_node) lParam;
60 /* TODO: perform any other required initialization stuff
64 #pragma warning(disable: 4244)
65 SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) d);
70 case KHUI_WM_CFG_NOTIFY:
72 d = (config_main_dlg_data *)
73 GetWindowLongPtr(hwnd, DWLP_USER);
77 /* WMCFG_APPLY is the only notification we care about */
79 if (HIWORD(wParam) == WMCFG_APPLY) {
80 /* TODO: Apply changes and update the state */
88 d = (config_main_dlg_data *)
89 GetWindowLongPtr(hwnd, DWLP_USER);
91 /* TODO: perform any other required uninitialization here */
95 SetWindowLongPtr(hwnd, DWLP_USER, 0);