65 lines
1.4 KiB
C++
65 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <Windows.h>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <sane/sane_ex.h>
|
|
|
|
#include "DlgPage.h"
|
|
|
|
// CDlgIndicator 对话框
|
|
//#define USE_SOLE_WIN_THREAD
|
|
|
|
#ifdef USE_SOLE_WIN_THREAD
|
|
#include <thread>
|
|
#include <memory>
|
|
#endif
|
|
|
|
class dlg_setting : public dlg_base
|
|
{
|
|
SANEAPI sane_api_;
|
|
SANE_Handle sane_dev_;
|
|
bool with_scan_;
|
|
unsigned int papers_;
|
|
unsigned int images_;
|
|
bool err_;
|
|
int id_help_;
|
|
int id_restore_;
|
|
std::wstring cfg_file_;
|
|
bool *twain_set_;
|
|
bool schm_from_empty_;
|
|
std::wstring name_;
|
|
|
|
HMENU cfg_menu_;
|
|
|
|
HWND tab_;
|
|
|
|
#ifdef USE_SOLE_WIN_THREAD
|
|
std::unique_ptr<std::thread> thread_;
|
|
#endif
|
|
|
|
BOOL handle_message(UINT msg, WPARAM wp, LPARAM lp) override;
|
|
void handle_command(WORD code, WORD id, HANDLE ctrl);
|
|
void notify_over(void);
|
|
void on_init_dialog(void);
|
|
BOOL on_notify(int ctrl_id, LPNMHDR pnmh);
|
|
int get_tab_count(void);
|
|
dlg_page* add_tab(const char* utf8_title);
|
|
dlg_page* get_page(int index);
|
|
dlg_page* get_page(const char* utf8_title);
|
|
dlg_page* select_page(int index);
|
|
void refresh_controls(int src_sn);
|
|
void save_changes_to_cur_scheme(int reason);
|
|
|
|
public:
|
|
dlg_setting(HWND parent, LPSANEAPI api, SANE_Handle dev, bool with_scan, const wchar_t* name, bool sole_thread);
|
|
~dlg_setting();
|
|
|
|
public:
|
|
HWND window(void);
|
|
HWND parent(void);
|
|
//void show(void);
|
|
void hide(void);
|
|
void notify_scan_over(void);
|
|
};
|