// initialize GetMonitorInfo API static BOOL WINAPI initializeGetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpmi) { HMODULE hModule = GetModuleHandle(_T("user32.dll")); if (!hModule) return FALSE; FARPROC proc = GetProcAddress(hModule, "GetMonitorInfoA"); if (proc) getMonitorInfo = reinterpret_cast<BOOL (WINAPI *)(HMONITOR, LPMONITORINFO)>(proc); else getMonitorInfo = emulateGetMonitorInfo; return getMonitorInfo(hMonitor, lpmi); }
GenericSLM::GenericSLM(const char* name) : initialized_(false), name_(name), busy_(false), error_(0), graphicsPortDescription_(""), allOff_(false), allOn_(false), invert_(false), colorInvert_(false), inversionNum_(0), monochromeColorNum_(0), inversionStr_("Off"), monochromeColorStr_("White"), chosenDisplayIndex_(-1) { assert(strlen(name) < (unsigned int) MM::MaxStrLength); InitializeDefaultErrorMessages(); displays_ = getMonitorInfo(); // create pre-initialization properties // ------------------------------------ // Name CreateProperty(MM::g_Keyword_Name, name_.c_str(), MM::String, true); // Description CreateProperty(MM::g_Keyword_Description, "SLM controlled by computer display adapter output", MM::String, true); // Graphics Port GenerateGraphicsPortProperty(); // Mode Properties GenerateModeProperties(); }