// #pragma once #include #include #pragma comment(lib, "base_util.lib") //#define WM_GET_TEST_ITEM_NAME WM_USER + 100 // WPARAM: (wchar_t*)title, LPARAM: (ITEM*)item //#define WM_GET_TEST_ITEM_TITLE WM_USER + 101 // WPARAM: (wchar_t*)name, LPARAM: (ITEM*)item #define WM_TO_ITEM_MGR_TAB WM_USER + 102 #define WM_TEST_ITEM_CHANGED WM_USER + 103 #define WM_REFRESH_TEST_ITEM WM_USER + 104 #define WM_SET_CODE_VER WM_USER + 105 // WPARAM: unused, LPARAM: ver #include #include class page_config { public: page_config() {} virtual ~page_config() {} typedef struct _item { std::wstring name; std::wstring title; std::wstring desc; bool man; bool fatal; bool operator==(const wchar_t* t) { return title == t; } }ITEM; public: virtual std::wstring export_config(bool *ok/*return error message if this returned false*/, bool used_in_code = false, int code_ver = 1) = 0; }; typedef struct _lst_col { std::wstring title; int width; int align; }LSTCOL; extern INTER_MODULE_CALLBACK(got_wstr); extern INTER_MODULE_CALLBACK(got_str); extern void init_list_ctrl(CListCtrl* lst, const std::vector& cols); extern std::wstring get_list_item_text(CListCtrl* lst, int item, int col); extern std::wstring get_list_column_title(CListCtrl* lst, int col); extern int find_list_item(CListCtrl* lst, const wchar_t* find, int col = 0); extern int get_list_selected_item(CListCtrl* lst); extern void select_list_item(CListCtrl* lst, int item); extern WORD vid_pid_from_hex(const wchar_t* hex, bool* ok); extern void set_sane_config(known_file_util::IJsonW* sane, known_file_util::IJsonW* cfg, std::wstring& val); extern void get_sane_config(std::wstring& cfg); extern void on_combo_param_changed(HWND dlg, CComboBox* param_ctrl, CComboBox* val_ctrl, CListCtrl* lst, UINT edit_id, bool lst_trigger); extern int add_param(HWND dlg, CComboBox* param_ctrl, CComboBox* val_ctrl, CListCtrl* lst, UINT edit_id); extern void on_list_param_sel_changed(CComboBox* param_ctrl, CListCtrl* lst, int item, void(*cb_change_notify)(void*), void* param); extern std::wstring get_window_text(HWND wnd); extern void replace(std::wstring& str, const wchar_t* now, const wchar_t* to_be);