Esempio n. 1
0
void
CExampleDlg::LoadDefaults()
{
	HKEY key = OpenSettingsRegistryKey();
	if (key) {
		TCHAR acSetting[100];
		if (LoadSetting(key, _T("user"), acSetting, sizeof(acSetting))) {
			sUserName = acSetting;
		}
		if (LoadSetting(key, _T("server"), acSetting, sizeof(acSetting))) {
			sServerAddress = acSetting;
		}
		RegCloseKey(key);
	}

	if (sUserName.IsEmpty()) {
		TCHAR acUserName[100];
		DWORD nBufferSize = sizeof(acUserName);
		if (GetUserName(acUserName, &nBufferSize)) {
			sUserName = acUserName;
		}
	}
	if (sServerAddress.IsEmpty()) {
		sServerAddress = _T("localhost");
	}
}
bool pawsNpcDialogWindow::PostSetup()
{
    psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_DIALOG_MENU);
    psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_CHAT);
    psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_REMOVE_OBJECT);

    responseList = dynamic_cast<pawsListBox*>(FindWidget("ResponseList"));
    speechBubble = FindWidget("SpeechBubble");
    textBox = dynamic_cast<pawsEditTextBox*>(FindWidget("InputText"));
    closeBubble = dynamic_cast<pawsButton*>(FindWidget("CloseBubble"));

    if(!responseList || !FindWidget("Lists") || !speechBubble || !FindWidget("Bubbles") || !closeBubble)
    {
        return false;
    }

    //loads the options regarding this window
    if(!LoadSetting())
    {
        //setup the window with defaults.
        SetupWindowWidgets();
        CleanBubbles();
    }
    return true;
}
Esempio n. 3
0
BOOL WINAPI ScreenSaverConfigureDialog(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
    case WM_INITDIALOG:
        LoadSetting();
        OnInitDialog(hWnd);
        return TRUE;

    case WM_CLOSE:
        EndDialog(hWnd, 0);
        break;

    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
        case IDOK:
            GetSetting(hWnd);
            SaveSetting();
            EndDialog(hWnd, 0);
            break;

        case IDC_RESET:
            ResetSetting(hWnd);
            EndDialog(hWnd, 0);
            break;

        case IDCANCEL:
            EndDialog(hWnd, 0);
            break;
        }
        break;
    }
    return FALSE;
}
Esempio n. 4
0
/*------------------------------------------------
  CLOCKM_REFRESHCLOCK message
--------------------------------------------------*/
void OnRefreshClock(HWND hwnd)
{
	LoadSetting(hwnd); // reload settings
	
	CreateClockDC(hwnd); // draw.c
	
#if TC_ENABLE_TRAYNOTIFY
	InitTrayNotify(hwnd); // traynotify.c
#endif
	
	// InitUserStr(); // userstr.c
	
#if TC_ENABLE_SYSINFO
	EndSysInfo(hwnd);  // sysinfo.c
	InitSysInfo(hwnd);  // sysinfo.c
#endif
	
	PostMessage(GetParent(GetParent(hwnd)), WM_SIZE,
		SIZE_RESTORED, 0);
	PostMessage(GetParent(hwnd), WM_SIZE,
		SIZE_RESTORED, 0);
	
	InvalidateRect(hwnd, NULL, FALSE);
	InvalidateRect(GetParent(hwnd), NULL, TRUE);
}
NTSTATUS DriverEntry(
    IN PDRIVER_OBJECT	DriverObject
    ,IN PUNICODE_STRING	RegistryPath )
{
    //	変数宣言
    NTSTATUS					Status;
    SETTING						Setting;
    HID_MINIDRIVER_REGISTRATION	HIDMiniDriverRegistration;

    //	ドライバ エントリ ポイントを設定する
    DriverObject->DriverExtension->AddDevice					= AddDevice;
    DriverObject->DriverUnload									= DriverUnload;
    DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL]	= InternalDeviceControl;
    DriverObject->MajorFunction[IRP_MJ_PNP]						= PnP;
    DriverObject->MajorFunction[IRP_MJ_POWER]					= Power;

    //	設定を取得する
    LoadSetting( &Setting );
    DevicesArePolled	= Setting.DevicesArePolled;
    LimitationMode		= Setting.LimitationMode;

    //	HID Minidriver を登録する
    RtlZeroMemory( &HIDMiniDriverRegistration, sizeof( HIDMiniDriverRegistration ) );
    HIDMiniDriverRegistration.Revision				= HID_REVISION;
    HIDMiniDriverRegistration.DriverObject			= DriverObject;
    HIDMiniDriverRegistration.RegistryPath			= RegistryPath;
    HIDMiniDriverRegistration.DeviceExtensionSize	= sizeof( DEVICE_EXTENSION );
    HIDMiniDriverRegistration.DevicesArePolled		= DevicesArePolled;
    Status	= HidRegisterMinidriver( &HIDMiniDriverRegistration );

    return( Status );
}
void __fastcall TfrmMain::LoadTimer(TObject *Sender)
{
	LoadSetting();
	if (FileExists(String(LoginerPath) +"\\Data\\"+ GameAccount + "\\Items.dat"))
	{
		TStringList *list = new TStringList();
		list->LoadFromFile(String(LoginerPath) +"\\Data\\"+ GameAccount + "\\Items.dat");
		for (int i = 0; i < list->Count; i++)
		{
			unsigned int ItemID;
			ItemID = _wtoi(list->Strings[i].w_str());
			AnsiString name = String(GetItemName(ItemID));
			if (name.IsEmpty())
			{
				name.sprintf(TEXT("未知物品(編號:%d)"), ItemID);
			}
			int index = list_drop->Items->IndexOfObject((TObject *)ItemID);
			if (index > -1)
				list_drop->Items->Delete(index);
			index = list_filter->Items->IndexOfObject((TObject *)ItemID);
			if (index < 0)
				list_filter->Items->AddObject(name, (TObject *)ItemID);
		}

		delete list;
	}
	Load->Enabled = false;

}
Esempio n. 7
0
void CUIHandlerOnekey::InitDelay()
{
    LoadSetting();

    UpdateHeader();
    UpdateMiddle();
    m_ctrlClean.UpdateUI();
    _LoadProvider();
}
Esempio n. 8
0
BOOL CGpsdoDownload::OnInitDialog()
{
	CDialog::OnInitDialog();

	LoadSetting();
	GetDlgItem(IDC_MASTER_PATH)->SetWindowText(m_strMasterPath);
	GetDlgItem(IDC_SLAVE_PATH)->SetWindowText(m_strSlavePath);

	return TRUE;  // return TRUE unless you set the focus to a control
}
Esempio n. 9
0
// Load a bool from the registry
//
bool
WebCam::LoadSetting(const WCHAR* name, bool* pValue)
{
	unsigned iValue = 0;
	bool bReturn = LoadSetting(name, &iValue);
	if (bReturn)
		*pValue = iValue ? true : false;

	return bReturn;
}
Esempio n. 10
0
bool CSettingsManager::LoadSetting(const TiXmlNode *node, const std::string &settingId)
{
  if (node == NULL)
    return false;

  CSetting *setting = GetSetting(settingId);
  if (setting == NULL)
    return false;

  return LoadSetting(node, setting);
}
Esempio n. 11
0
	PulseAudioSource(int port, int mic): mPort(port)
	, mMic(mic)
	, mBuffering(50)
	, mPaused(true)
	, mQuit(false)
	, mPMainLoop(nullptr)
	, mPContext(nullptr)
	, mStream(nullptr)
	, mServer(nullptr)
	, mPAready(0)
	, mResampleRatio(1.0)
	, mTimeAdjust(1.0)
	, mOutputSamplesPerSec(48000)
	, mResampler(nullptr)
	, mOutSamples(0)
	{
		CONFIGVARIANT var(mic ? N_AUDIO_DEVICE1 : N_AUDIO_DEVICE0, CONFIG_TYPE_CHAR);
		if(LoadSetting(mPort, APINAME, var) && !var.strValue.empty())
		{
			mDevice = var.strValue;
			//TODO open device etc.
		}
		else
			throw AudioSourceError(APINAME ": failed to load device settings");

		{
			CONFIGVARIANT var(N_BUFFER_LEN, CONFIG_TYPE_INT);
			if(LoadSetting(mPort, APINAME, var))
				mBuffering = var.intValue;
		}

		if (!AudioInit())
			throw AudioSourceError(APINAME ": failed to bind pulseaudio library");

		mSSpec.format =  PA_SAMPLE_FLOAT32LE; //PA_SAMPLE_S16LE;
		mSSpec.channels = 2;
		mSSpec.rate = 48000;

		if (!Init())
			throw AudioSourceError(APINAME ": failed to init");
	}
Esempio n. 12
0
bool CSettingsManager::Deserialize(const TiXmlNode *node, std::map<std::string, CSetting*> *loadedSettings /* = NULL */)
{
  if (node == NULL)
    return false;

  for (SettingMap::iterator it = m_settings.begin(); it != m_settings.end(); it++)
  {
    if (LoadSetting(node, it->second.setting) && loadedSettings != NULL)
      loadedSettings->insert(make_pair(it->first, it->second.setting));
  }

  return true;
}
Esempio n. 13
0
BOOL CSettingCommonUI::OnInitDialog()
{
	CDialog::OnInitDialog();

	CButton* pBtn = (CButton*)GetDlgItem(IDC_CHECK_USE_DEFAULT_PROFILE);
	pBtn->SetCheck(1);

	LoadSetting();

	PECore::PostMessage(WM_GET_MSG_STORE,(WPARAM)m_hWnd,0);

	return TRUE;  // return TRUE unless you set the focus to a control
}
bool pawsActiveMagicWindow::PostSetup()
{
    pawsWidget::PostSetup();

    buffList  = (pawsScrollMenu*)FindWidget("BuffBar");
    if(!buffList)
        return false;
    buffList->SetEditLock(ScrollMenuOptionDISABLED);

    if(autoResize)
    {
        buffList->SetLeftScroll(ScrollMenuOptionDISABLED);
        buffList->SetRightScroll(ScrollMenuOptionDISABLED);
    }
    else
    {
        buffList->SetLeftScroll(ScrollMenuOptionDYNAMIC);
        buffList->SetRightScroll(ScrollMenuOptionDYNAMIC);
    }

    showWindow              = (pawsCheckBox*)FindWidget("ShowActiveMagicWindow");
    if(!showWindow)
        return false;

    psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_ACTIVEMAGIC);

    // If no active magic, hide the window.
    if(buffList->GetSize() < 1 && showWindow->GetState() == false)
    {
        show=false;
        showWindow->Hide();
    }
    else
    {
        show=true;
        showWindow->Show();
    }

    LoadSetting();

    csString blankSpell;
    blankSpell="";
    psSpellCastMessage msg(blankSpell, psengine->GetKFactor()); //request the current Active Mgic list
    msg.SendMessage();

    return true;
}
Esempio n. 15
0
void CSyncUI::OnBnClickedBtnStartSync()
{
	if (m_iSyncDone)
	{
		PE_PHONE_SETTING* s = PECore::GetCurPhone();
		CButton* pBtnSMS = (CButton*)GetDlgItem(IDC_CHECK_SYNC_SMS);
		CButton* pBtnCall = (CButton*)GetDlgItem(IDC_CHECK_SYNC_CALL);
		CButton* pBtnMMS = (CButton*)GetDlgItem(IDC_CHECK_SYNC_MMS);
		CButton* pBtnCalendar = (CButton*)GetDlgItem(IDC_CHECK_SYNC_CALENDAR);
		CButton* pBtnContacts = (CButton*)GetDlgItem(IDC_CHECK_SYNC_CONTACTS);

		CButton* pBtnImage = (CButton*)GetDlgItem(IDC_CHECK_SYNC_IMAGE);
		CButton* pBtnVideo = (CButton*)GetDlgItem(IDC_CHECK_SYNC_VIDEO);
		CButton* pBtnAudio = (CButton*)GetDlgItem(IDC_CHECK_SYNC_AUDIO);

		if ( s)
		{
			s->dwSyncSMS = pBtnSMS->GetCheck();
			s->dwSyncCall = pBtnCall->GetCheck();
			s->dwSyncMMS = pBtnMMS->GetCheck();
			s->dwSyncCalendar = pBtnCalendar->GetCheck();
			s->dwSyncContact = pBtnContacts->GetCheck();
			s->dwSyncImage = pBtnImage->GetCheck();
			s->dwSyncVideo = pBtnVideo->GetCheck();
			s->dwSyncAudio = pBtnAudio->GetCheck();

			CSettingHelper::SetPhoneSetting(s);
		}

		LoadSetting();

		PECore::PostMessage(WM_SYNC_NOW,0,0);
		m_btnStartSync.SetWindowText(_T("Stop Sync"));
		m_iSyncDone = 0;
		g_iCanSync = 1;

		g_iCanceled = 0;
		m_SyncProgress.SetPos(0);
	}
	else
	{
		g_iCanSync = 0;
		g_iCanceled = 1;
		SetDlgItemText(IDC_STATIC_NOW_SYNC,_T("Canceling Sync process now..."));
	}
}
Esempio n. 16
0
DWORD CUIHandlerOnekey::OnSetting()
{
    LoadSetting();
    time(&m_theLastPop);
    UINT_PTR uRet = 0;
    if(m_strCustom.length() == 0)
        m_strCustom = m_strDefault;
    CKscOneKeyConfig test(m_dlg, m_bSettingByClean);
    CString cstrdefaulttmp(m_strDefault.c_str());
    CString cstrcustmp(m_strCustom.c_str());

    test.SplitString(cstrdefaulttmp,L',',test.m_defaultvec);
    test.SplitString(cstrcustmp,L',',test.m_customvec);
    uRet = test.DoModal();
    m_bSettingByClean = FALSE;
    return (DWORD)uRet;
}
Esempio n. 17
0
void CUIHandlerOnekey::OnCleanLink()
{
    DWORD dwRet = 0;
    if(IsPopSetting() && m_ctrlClean.HasBegin() && m_ctrlClean.HasEnd())
    {
        LoadSetting();
        if (m_strMakeSure.compare(L"yes") == 0)
        {
            m_bSettingByClean = TRUE;
            dwRet = OnSetting();
            if (dwRet == 0)
            {
                return;
            }
        }
    }
    _FakeClean();
}
Esempio n. 18
0
	virtual MicMode GetMicMode(AudioSource* compare)
	{
		if(compare && typeid(compare) != typeid(this))
			return MIC_MODE_SEPARATE; //atleast, if not single altogether

		if (compare)
		{
			PulseAudioSource *src = dynamic_cast<PulseAudioSource *>(compare);
			if (src && mDevice == src->mDevice)
				return MIC_MODE_SHARED;
			return MIC_MODE_SEPARATE;
		}

		CONFIGVARIANT var(mMic ? N_AUDIO_DEVICE0 : N_AUDIO_DEVICE1, CONFIG_TYPE_CHAR);
		if(LoadSetting(mPort, APINAME, var) && var.strValue == mDevice)
			return MIC_MODE_SHARED;

		return MIC_MODE_SINGLE;
	}
Esempio n. 19
0
HRESULT CHdrPropSheet::CheckFileType()
{
	TCHAR ext[_MAX_EXT];
	_tsplitpath(m_szPath, NULL, NULL, NULL, ext);

	TCHAR exts[1024];
	LoadSetting(_T("exts"), exts, lengthof(exts), DEFAULT_EXTS);

	LPCTSTR separator = _T(";");
	LPTSTR tok = _tcstok(exts, separator);
	while (tok != NULL) {
		if (::lstrcmpi(tok, ext) == 0) {
			return S_OK;
		}
		tok = _tcstok(NULL, separator);
	}

	return E_FAIL;
}
Esempio n. 20
0
BOOL CLauncherService::Startup(int argc, char **argv)
{
    struct  sigaction   handler;

    if (!CheckKernelParam(argc, argv))
        return FALSE;

    // Set Interrrupt Signal Handler
    handler.sa_handler = InterruptSignalHandler;
    sigfillset(&handler.sa_mask);
    sigaction(SIGINT, &handler, 0);
    sigaction(SIGTERM, &handler, 0);
    sigaction(SIGCHLD, &handler, 0);
    FirmUpdate();
    DisplaySplash();
    LoadSetting();
    Monitoring();

    return TRUE;
}
Esempio n. 21
0
int RawInputPad::Open()
{
	PHIDP_PREPARSED_DATA pPreparsedData = NULL;

	//TODO Better place?
	LoadMappings(mapVector);

	memset(&this->ovl, 0, sizeof(OVERLAPPED));
	memset(&this->ovlW, 0, sizeof(OVERLAPPED));

	//this->padState.initStage = 0;
	this->doPassthrough = !!conf.DFPPass;//TODO per player
	this->usbHandle = INVALID_HANDLE_VALUE;
	std::wstring path;
	{
		CONFIGVARIANT var(N_JOYSTICK, CONFIG_TYPE_WCHAR);
		if (LoadSetting(mPort, APINAME, var))
			path = var.wstrValue;
		else
			return 1;
	}

	this->usbHandle = CreateFileW(path.c_str(), GENERIC_READ|GENERIC_WRITE,
		FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);

	if(this->usbHandle != INVALID_HANDLE_VALUE)
	{
		this->ovl.hEvent = CreateEvent(0, 0, 0, 0);
		this->ovlW.hEvent = CreateEvent(0, 0, 0, 0);

		HidD_GetAttributes(this->usbHandle, &(this->attr));
		HidD_GetPreparsedData(this->usbHandle, &pPreparsedData);
		HidP_GetCaps(pPreparsedData, &(this->caps));
		HidD_FreePreparsedData(pPreparsedData);
		return 0;
	}
	else
		fwprintf(stderr, L"Could not open device '%s'.\nPassthrough and FFB will not work.\n", path.c_str());

	return 1;
}
Esempio n. 22
0
BOOL CSyncUI::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_btnStartSync.SubclassDlgItem(IDC_BTN_START_SYNC, this);
	m_btnStartSync.SetColor(CButtonST::BTNST_COLOR_BK_OUT,SUB_BTN_COLOR);
	m_btnStartSync.SetColor(CButtonST::BTNST_COLOR_BK_IN,SUB_BTN_SEL_COLOR);
	m_btnStartSync.SetColor(CButtonST::BTNST_COLOR_BK_FOCUS,SUB_BTN_COLOR);
	m_btnStartSync.SetColor(CButtonST::BTNST_COLOR_FG_IN,SUB_BTN_FONT_FOCUS_COLOR);
	m_btnStartSync.SetColor(CButtonST::BTNST_COLOR_FG_OUT,SUB_BTN_FONT_COLOR);
	m_btnStartSync.SetColor(CButtonST::BTNST_COLOR_FG_FOCUS,SUB_BTN_FONT_COLOR);

	m_SyncProgress.SetRange(0,100);

	LoadSetting();

	m_iSyncDone = 1;

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 23
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);
	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);
	UIAddChildWindowContainer(m_hWnd);


	initValue();
	LoadSetting();
	InitDB();
	initPreviewDlg();
	initDH();
	initBottomButton();
	initTimeLabel();
	initSlide();
	initCradleButton();
	//默认选中channel 0
	FocusChannel(0);
	//默认布局
	SetPreviewDlgLayout(PREVIEWLAYOUT4,0);
	//计时器 时钟
	SetTimer(1,1000);
	//录像
	SetTimer(2,1000);
	SetWindowPos(NULL,0,0,1000,700,SWP_SHOWWINDOW);
	CenterWindow();

	RegisterStreamDirectReadCallback(StreamDirectReadCallback, this);
	updateSetting();
	return TRUE;
}
Esempio n. 24
0
bool CSettingsManager::Deserialize(const TiXmlNode *node, bool &updated, std::map<std::string, CSetting*> *loadedSettings /* = NULL */)
{
  updated = false;

  if (node == NULL)
    return false;

  CSharedLock lock(m_settingsCritical);

  for (SettingMap::iterator it = m_settings.begin(); it != m_settings.end(); ++it)
  {
    bool settingUpdated = false;
    if (LoadSetting(node, it->second.setting, settingUpdated))
    {
      updated |= settingUpdated;
      if (loadedSettings != NULL)
        loadedSettings->insert(make_pair(it->first, it->second.setting));
    }
  }

  return true;
}
Esempio n. 25
0
void SettingLocalOpml::OnShowWindow(BOOL bShow, UINT nStatus)
{
    CDialog::OnShowWindow(bShow, nStatus);
    // ↑ CTabDialog ではなく、CDialog にしているのは、 SettingLocalOpml には
    // ↑ m_username, m_pasword を入力するための CEdit コントロールが存在しな
    // ↑ いため

    if ( bShow ) {
        LoadSetting();

        CEdit   *p = (CEdit *)GetDlgItem( IDC_EDIT_LOCALOPML_FILENAME );
        p->SetWindowText( m_filename );

        SetIsTarget();

        m_initialized = true;
    }
    else {
        CEdit   *p = (CEdit *)GetDlgItem( IDC_EDIT_LOCALOPML_FILENAME );
        p->GetWindowText( m_filename );
    }
}
Esempio n. 26
0
USBDevice *MsdDevice::CreateDevice(int port)
{
	MSDState *s = (MSDState *)qemu_mallocz(sizeof(MSDState));
	if (!s)
		return NULL;

	//CONFIGVARIANT varApi(N_DEVICE_API, CONFIG_TYPE_CHAR);
	//LoadSetting(port, DEVICENAME, varApi);
	std::string api = *MsdDevice::APIs().begin();

	CONFIGVARIANT var(N_CONFIG_PATH, CONFIG_TYPE_TCHAR);

	if(!LoadSetting(port, api, var))
	{
		fprintf(stderr, "usb-msd: Could not load settings\n");
		return NULL;
	}

	s->hfile = wfopen(var.tstrValue.c_str(), TEXT("r+b"));
	if (!s->hfile) {
		fprintf(stderr, "usb-msd: Could not open image file\n");
		return NULL;
	}

	s->last_cmd = -1;
	s->dev.speed = USB_SPEED_FULL;
	s->dev.handle_packet = usb_generic_handle_packet;

	s->dev.handle_reset = usb_msd_handle_reset;
	s->dev.handle_control = usb_msd_handle_control;
	s->dev.handle_data = usb_msd_handle_data;
	s->dev.handle_destroy = usb_msd_handle_destroy;

	sprintf(s->dev.devname, "QEMU USB MSD(%.16s)",
			 ""/*filename*/);

	usb_msd_handle_reset((USBDevice *)s);
	return (USBDevice *)s;
}
Esempio n. 27
0
BOOL WINAPI ScreenSaverConfigureDialog(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
    case WM_INITDIALOG:
        ss.modeinfo.count = hack_count;
        ss.modeinfo.cycles = hack_cycles;
        ss.modeinfo.size = hack_size;
        LoadSetting(&ss.modeinfo);
        OnInitDialog(hWnd);
        return TRUE;

    case WM_CLOSE:
        EndDialog(hWnd, 0);
        break;

    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
        case IDOK:
            GetSetting(hWnd);
            SaveSetting(&ss.modeinfo);
            EndDialog(hWnd, 0);
            break;

        case IDC_RESET:
            ResetSetting(hWnd);
            EndDialog(hWnd, 0);
            break;

        case IDCANCEL:
            EndDialog(hWnd, 0);
            break;
        }
        break;
    }
    return FALSE;
}
Esempio n. 28
0
void CUIHandlerOnekey::OnCleanButton()
{
    DWORD dwRet = 0;
    //if(/*IsPopSetting()*/)
    {
        LoadSetting();
        if (m_strMakeSure.compare(L"yes") == 0 || m_strMakeSure.compare(L"") == 0)
        {
            m_bSettingByClean = TRUE;
            dwRet = OnSetting();
            if (dwRet == 0)
            {
                return;
            }
        }
    }

    m_dlg->SetItemVisible(ID_DIV_ONEKEY_START, TRUE);
    m_dlg->SetItemVisible(ID_DIV_ONEKEY_SCAN, FALSE);
    m_dlg->SetItemVisible(ID_DIV_ONEKEY_SCANHEAD, FALSE);
    m_dlg->SetItemVisible(ID_DIV_ONEKEY_STARTHEAD, TRUE);

    _FakeClean();
}
Esempio n. 29
0
BOOL ss_init(HWND hwnd)
{
    RECT rc;

    set_saver_name(progname);

    ss.hwnd = hwnd;

#undef ya_rand_init
    ya_rand_init(0);

    GetClientRect(hwnd, &rc);
    ss.x0 = rc.left;
    ss.y0 = rc.top;
    assert(ss.x0 == 0);
    assert(ss.y0 == 0);
    ss.width = rc.right - rc.left;
    ss.height = rc.bottom - rc.top;
    if (ss.width == 0 || ss.height == 0)
        return FALSE;

    ss.hdc = GetWindowDC(hwnd);
    if (ss.hdc == NULL)
        return FALSE;

    if (!InitPixelFormat(&ss))
    {
        ReleaseDC(hwnd, ss.hdc);
        return FALSE;
    }

    ss.hbmScreenShot = GetScreenShotBitmap();
    if (ss.hbmScreenShot == NULL)
    {
        ReleaseDC(hwnd, ss.hdc);
        return FALSE;
    }
    //SaveBitmapToFile("screenshot.bmp", ss.hbmScreenShot);

    MakeCurrent(&ss);

    ss.modeinfo.dpy = ss.hdc;
    ss.modeinfo.window = 0;
    ss.modeinfo.width = ss.width;
    ss.modeinfo.height = ss.height;
    ss.modeinfo.num_screen = 1;
    ss.modeinfo.screen_number = 0;
    ss.modeinfo.polygon_count = 0;
    ss.modeinfo.fps_p = False;
    ss.modeinfo.is_drawn = True;
    ss.modeinfo.count = hack_count;
    ss.modeinfo.cycles = hack_cycles;
    ss.modeinfo.size = hack_size;
    ss.modeinfo.xgwa.width = ss.width;
    ss.modeinfo.xgwa.height = ss.height;
    ss.modeinfo.xgwa.depth = 32;
    ss.modeinfo.xgwa.visual = NULL;
    ss.modeinfo.xgwa.colormap = 0;
    ss.modeinfo.xgwa.screen = 0;

    LoadSetting(&ss.modeinfo);
    SaveSetting(&ss.modeinfo);

    hack_init(&ss.modeinfo);

    return TRUE;
}
Esempio n. 30
0
void CSettings::LoadAllSettings()
{
    for (int i = 0; i < (int)StoredSettings.size(); ++i)
        memcpy(&StoredSettings[i], LoadSetting(StoredSettings[i].Name), sizeof(CoreVariable));
}