-
Notifications
You must be signed in to change notification settings - Fork 5
/
PuTTYCSDialog.h
executable file
·285 lines (231 loc) · 8.28 KB
/
PuTTYCSDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/**
* PuTTYCSDialog.h - PuTTYCS Main Dialog header
*
* Copyright (c) 2005 - 2008 Jason Millard ([email protected])
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* REVISION HISTORY:
*
* 11/07/2005: Initial version J. Millard
* 11/17/2005: Added UNICODE support J. Millard
* Added command cistory clear button
* Added AltGr support
* 11/18/2005: Fixed AltGr support J. Millard
* 12/06/2005: Added mouse Copy/Paste emulation J. Millard
* Navigation through command history
* moves cursor to end of command
* 12/15/2005: Added minimize to system tray J. Millard
* Added tab completion
* 12/19/2005: Added window opacity J. Millard
* 05/27/2006: Improved system tray logic J. Millard
* Added Windows XP style
* Added close, backspace, and
* delete buttons
* 11/20/2006: Added support for user defined J. Millard
* cascade size.
* 06/21/2007: Added Ctrl-R and Ctrl-D buttons J. Millard
* Added {%CTRL%} command token
* Added {%INC%} command token
* Added scroll command history using
* up/down arrow keys
* Added check for PuTTYCS update
* Added run on system startup
* 02/29/2008: Added horizontal/vertical tiling J. Millard
* Updated cascade logic
* Added post send transition delay
* Added --script command line option
*/
#if !defined(AFX_PuTTYCSDLG_H__7BCAE5A7_75C4_4831_82FD_5A13F846FE61__INCLUDED_)
#define AFX_PuTTYCSDLG_H__7BCAE5A7_75C4_4831_82FD_5A13F846FE61__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef UNICODE
#define CommandLineToArgv CommandLineToArgvW
#else
#define CommandLineToArgv CommandLineToArgvT
LPTSTR *WINAPI CommandLineToArgvT(LPCTSTR lpCmdLine, int *lpArgc);
#endif
#include "CommandEdit.h"
class CPuTTYCSDialog : public CDialog
{
// Construction
public:
CPuTTYCSDialog(CWnd* pParent = NULL); // standard constructor
~CPuTTYCSDialog();
CObArray* GetAllWindows();
// Dialog Data
//{{AFX_DATA(CPuTTYCSDialog)
enum { IDD = IDD_PUTTYCS_DIALOG };
CCommandEdit m_cceCommandEdit;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPuTTYCSDialog)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
bool m_bIsClosing;
bool m_bFindAll;
int m_iDialogHeight;
/**
* PuTTY Filters
*/
CStringArray m_csaFilters;
int m_iFilter;
/**
* Command history
*/
CStringArray m_csaCmdHistory;
int m_iCmdHistory;
/**
* Window
*/
int m_iToolWindow;
int m_iAlwaysOnTop;
int m_iMinimizeToSysTray;
int m_iOpacity;
/**
* Auto arrange
*/
int m_iAutoArrange;
int m_iAutoMinimize;
int m_iArrangeOnStartup;
int m_iUnhideOnExit;
/**
* Tile method
*/
int m_iTileMethod;
/**
* Cascade dimensions
*/
int m_iCascadeWidth;
int m_iCascadeHeight;
/**
* Keyboard/Mouse
*/
int m_iTabCompletion;
int m_iCmdHistoryScrollThrough;
int m_iEmulateCopyPaste;
/**
* Send CR
*/
int m_iSendCR;
/**
* Miscellaneous
*/
int m_iSavePassword;
CString m_csPassword;
int m_iRunOnSystemStartup;
int m_iCheckForUpdates;
/**
* Transition delays
*/
int m_iTransition;
int m_iPostSendDelay;
/**
* Fonts
*/
CFont* m_pMarlettNormal;
CFont* m_pMarlettSmall;
CFont* m_pSymbolSmall;
void sendCommand( CString csCommand, bool bTab );
void sendBuffer( CString csBuffer, bool bParse = false, bool bTab = false );
void LoadPreferences();
void SavePreferences();
void UpdateDialog();
void RefreshDialog();
void SendScript( CString csFilename );
void MovePuttyWnd(CWnd* pWnd, int iX, int intY, int iSizeX, int iSizeY);
void SetRunOnSystemStartup( bool bEnable = true );
void CheckForUpdates(bool bInteractive = false);
void ParseCmdLineOptions(LPTSTR pCmdLine = NULL);
// Generated message map functions
//{{AFX_MSG(CPuTTYCSDialog)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnAboutButton();
afx_msg void OnSelChangeFiltersCombobox();
afx_msg void OnCascadeButton();
afx_msg void OnTileButton();
afx_msg void OnMinimizeButton();
afx_msg void OnHideButton();
afx_msg void OnFiltersButton();
afx_msg void OnSendCRPushButton();
afx_msg void OnCmdHistoryUpButton();
afx_msg void OnCmdHistoryDownButton();
afx_msg void OnUpButton();
afx_msg void OnDownButton();
afx_msg void OnRightButton();
afx_msg void OnLeftButton();
afx_msg void OnClearButton();
afx_msg void OnBreakButton();
afx_msg void OnEndTelnetButton();
afx_msg void OnEscapeButton();
afx_msg void OnEnterButton();
afx_msg void OnPasswordButton();
afx_msg void OnPreferencesButton();
afx_msg void OnScriptButton();
afx_msg void OnSendButton();
afx_msg void OnTrayNotify(WPARAM wParam, LPARAM lParam);
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
afx_msg void OnCmdHistoryClearButton();
afx_msg void OnOpenMenuItem();
afx_msg void OnBackspaceButton();
afx_msg void OnDeleteButton();
afx_msg void OnCloseButton();
afx_msg void OnCtrlButton();
afx_msg void OnIncButton();
afx_msg void OnCheckForUpdates();
afx_msg void OnCtrlDButton();
afx_msg void OnCtrlRButton();
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CSendKeys m_skSendKeys;
CObArray m_obaWindows;
UINT m_uiTaskbarMessage;
BOOL m_bDisablePopup;
NOTIFYICONDATA* m_pTNI;
void SetSysTrayTip( CString csTip = PUTTYCS_EMPTY_STRING );
static BOOL CALLBACK enumwindowsProc(HWND hwnd, LPARAM lParam);
static int wildcmp(const TCHAR* wild, const TCHAR* string);
void SortWindows();
static int Compare(const void* pWndS1, const void* pWndS2);
static CString GetAttributeValue(const CString, const CString);
CMenu* m_pMenu;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PuTTYCSDLG_H__7BCAE5A7_75C4_4831_82FD_5A13F846FE61__INCLUDED_)