Browse Source

added activate window delay to adv options, changed default value from 50ms to 100ms

scott brogden 6 years ago
parent
commit
6af7cf0451
3 changed files with 21 additions and 4 deletions
  1. 12 3
      AdvGeneral.cpp
  2. 6 1
      Options.cpp
  3. 3 0
      Options.h

+ 12 - 3
AdvGeneral.cpp

@@ -117,6 +117,8 @@ END_MESSAGE_MAP()
 #define SETTING_TOOLTIP_LINES 69
 #define SETTING_TOOLTIP_CHARACTERS 70
 
+#define SETTING_ACTIVATE_WINDOW_DELAY 71
+
 BOOL CAdvGeneral::OnInitDialog()
 {
 	CDialogEx::OnInitDialog();
@@ -142,9 +144,10 @@ BOOL CAdvGeneral::OnInitDialog()
 	hdItem.cxy = 325; // whatever you want the property name column width to be
 	m_propertyGrid.GetHeaderCtrl().SetItem(0, &hdItem);
 
-	m_propertyGrid.SetFont(this->GetFont());
-	
-	
+	m_propertyGrid.SetFont(this->GetFont());	
+
+	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Activate Window Delay (100ms default)"), (long)CGetSetOptions::SendKeysDelay(), _T(""), SETTING_ACTIVATE_WINDOW_DELAY));
+
 	AddTrueFalse(pGroupTest, _T("Allow Duplicates"), CGetSetOptions::GetAllowDuplicates(), SETTING_ALLOW_DUPLICATES);
 	AddTrueFalse(pGroupTest, _T("Always Show Scroll Bar"), CGetSetOptions::GetShowScrollBar(), SETTING_ALWAYS_SHOW_SCROLL_BAR);
 	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Amount of text to save for description"), g_Opt.m_bDescTextSize, _T(""), SETTING_DESC_SIZE));
@@ -703,6 +706,12 @@ void CAdvGeneral::OnBnClickedOk()
 					CGetSetOptions::SetRevertToTopLevelGroup(val);
 				}
 				break;
+			case SETTING_ACTIVATE_WINDOW_DELAY:
+				if (pNewValue->lVal != pOrigValue->lVal)
+				{
+					CGetSetOptions::SetSendKeysDelay(pNewValue->lVal);
+				}
+				break;
 			}
 		}
 	}

+ 6 - 1
Options.cpp

@@ -1997,7 +1997,12 @@ DWORD CGetSetOptions::GetDittoHotKey()
 
 DWORD CGetSetOptions::SendKeysDelay()
 {
-	return (DWORD)GetProfileLong(_T("SendKeysDelay"), 50);
+	return (DWORD)GetProfileLong(_T("SendKeysDelay"), 100);
+}
+
+void CGetSetOptions::SetSendKeysDelay(DWORD val)
+{
+	SetProfileLong(_T("SendKeysDelay"), val);
 }
 
 DWORD CGetSetOptions::WaitForActiveWndTimeout()

+ 3 - 0
Options.h

@@ -396,7 +396,10 @@ public:
 	static long		GetKeyStatePasteDelay();
 
 	static DWORD	GetDittoHotKey();
+	
 	static DWORD	SendKeysDelay();
+	static void		SetSendKeysDelay(DWORD val);
+
 	static DWORD	WaitForActiveWndTimeout();
 	static DWORD	FocusChangedDelay();
 	static DWORD	FocusWndTimerTimeout();