Made extensive changes to the launcher to provide more control over setting up auto-start and it now saves configuration to the user's documents directory if auto-starting at login and saves to the system directory if auto-starting at boot. Replaced MapVirtualKey() with table lookup to work around that function's lack of support for extended keyboard scan codes. Added first cut at support for AltGr.
81 lines
1.9 KiB
C++
Executable file
81 lines
1.9 KiB
C++
Executable file
/*
|
|
* synergy -- mouse and keyboard sharing utility
|
|
* Copyright (C) 2002 Chris Schoeneman
|
|
*
|
|
* This package is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* found in the file COPYING that should have accompanied this file.
|
|
*
|
|
* This package is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef CAUTOSTART_H
|
|
#define CAUTOSTART_H
|
|
|
|
#include "CString.h"
|
|
|
|
#define WINDOWS_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
|
|
class CConfig;
|
|
|
|
//! Auto start dialog for Microsoft Windows launcher
|
|
class CAutoStart {
|
|
public:
|
|
// if config == NULL then it's assumed we're installing/uninstalling
|
|
// the client, otherwise the server.
|
|
CAutoStart(HWND parent, CConfig* config, const CString& cmdLine);
|
|
~CAutoStart();
|
|
|
|
//! @name manipulators
|
|
//@{
|
|
|
|
//! Run dialog
|
|
/*!
|
|
Display and handle the dialog until closed by the user.
|
|
*/
|
|
void doModal();
|
|
|
|
//@}
|
|
//! @name accessors
|
|
//@{
|
|
|
|
//! Test if user configuration was saved
|
|
/*!
|
|
Returns true if the user's configuration (as opposed to the system-wide
|
|
configuration) was saved successfully while in doModal().
|
|
*/
|
|
bool wasUserConfigSaved() const;
|
|
|
|
//@}
|
|
|
|
private:
|
|
void update();
|
|
bool onInstall(bool allUsers);
|
|
bool onUninstall(bool allUsers);
|
|
|
|
// log handling
|
|
static bool onLog(int priority, const char* message);
|
|
|
|
// message handling
|
|
BOOL doDlgProc(HWND, UINT, WPARAM, LPARAM);
|
|
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
private:
|
|
static CAutoStart* s_singleton;
|
|
|
|
HWND m_parent;
|
|
CConfig* m_config;
|
|
bool m_isServer;
|
|
CString m_cmdLine;
|
|
CString m_name;
|
|
HWND m_hwnd;
|
|
bool m_install;
|
|
CString m_errorMessage;
|
|
bool m_userConfigSaved;
|
|
};
|
|
|
|
#endif
|