コード例 #1
0
void ToolsOptionsWindow::OnCreate (HWND hWnd)
{				
	// Make this window handle global
	m_hwnd = hWnd;
	g_hWnd = hWnd; // Need to do this otherwise the control creation wrapper functions don't work.

	HFONT hfDefault = (HFONT) GetStockObject (DEFAULT_GUI_FONT);

	// The status list box
	m_lstcategory = CreateWindow ("listbox", NULL, WS_CHILD | WS_BORDER | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL, 10, 10, 100, 480, hWnd, (HMENU) ID_LSTOPTIONCATEGORY, GetModuleHandle (NULL), NULL);
	SendMessage (m_lstcategory, WM_SETFONT, (WPARAM) hfDefault, MAKELPARAM (FALSE, 0));

	SendMessage (m_lstcategory, LB_SETITEMHEIGHT, 0, 32);

	CreateGeneralPanel ();

	//ID_OPTWINDOWCLOSE
	m_btnclose = CreateButton ("Close", 455, 440, 70, 23, ID_OPTWINDOWCLOSE);

	// Add the categories to the list box
	char szGeneral[SIZE_NAME];
	ZeroMemory (szGeneral, SIZE_NAME);
	strcpy_s (szGeneral, SIZE_NAME, "General");

	SendMessage (m_lstcategory, LB_ADDSTRING, 0, (LPARAM) szGeneral);


	// Read the registry settings, and set the control values
	ReadRegistrySettings ();
}
コード例 #2
0
ファイル: ServerSession.cpp プロジェクト: edwig/Marlin
// CTOR of HTTP Server session
ServerSession::ServerSession()
{
  ASSERT(g_session == nullptr);

  ReadRegistrySettings();
  CreateLogfile();
  InitializeCriticalSection(&m_lock);
}
コード例 #3
0
void CIWinSyncDlg::OnTraymenuStatus() 
{
	ReadRegistrySettings();
	PopulateSettingsDialog();
	if(m_bMinimizeToTray)
	{
		this->ShowWindow(SW_SHOWNORMAL);
		m_bMinimizeToTray = FALSE;
	}
}
コード例 #4
0
BOOL CIWinSyncDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	
	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	m_bLoggingEnabled = FALSE; // We have not obtained log details yet
	SetupLogging();

	//Populate the Debug Level Listbox
	CListBox* pDebugLevelList = NULL;
	pDebugLevelList = (CListBox*) GetDlgItem(IDC_LIST_LOGLEVEL);
	if (pDebugLevelList != NULL)
	{
		pDebugLevelList->AddString(LOGLEVEL_LISTBOX_DEBUG);
		pDebugLevelList->AddString(LOGLEVEL_LISTBOX_WARN);
		pDebugLevelList->AddString(LOGLEVEL_LISTBOX_ERROR);
	}
	//Load Application Settings from the registry
	ReadRegistrySettings();
	m_bSuppressDialogs = FALSE;
	m_bDisableSync = FALSE;
	PopulateSettingsDialog();
	
	if (m_bSyncPathSet)
	{
		ShowWindow(SW_SHOWMINIMIZED);
	}
	else
	{
		ShowWindow(SW_SHOWNORMAL);
	}
	
	m_bMinimizeToTray = FALSE;
	m_bCanShowFlyout = TRUE;

	if ( m_bSyncPathSet)
	{
		LOG(G2L_DEBUG) << "Application Is Started - Starting OfflineFiles Service";
		if ( !InitSyncClient() ) //Need to pass event details
		{
			PostQuitMessage(0); // Shutdown because the application did not initialise
			return TRUE;
		}
		//start The sync Timer
		m_puSyncTimer = SetTimer(SYNC_TIMER_ID, m_nSyncInterval, NULL);
		if(  m_puSyncTimer == 0)
		{
			LOG(G2L_WARNING) << "Failed To start the sync Timer";
			PostQuitMessage(0); // Shutdown because the application did not initialise
			return TRUE;
		}
		LOG(G2L_DEBUG) << "Application Is Started - Started OfflineFiles Service";
		PostMessage(WM_SYSCOMMAND, SC_MINIMIZE);
	}
	else
	{
		LOG(G2L_DEBUG) << "Application Is Started - Sync Folder Is Not set";
	}
	return TRUE;  // return TRUE  unless you set the focus to a control
}