diff --git a/TegraRcmGUI/TegraRcm.cpp b/TegraRcmGUI/TegraRcm.cpp index 49ccec8..801ea95 100644 --- a/TegraRcmGUI/TegraRcm.cpp +++ b/TegraRcmGUI/TegraRcm.cpp @@ -139,6 +139,12 @@ void TegraRcm::ShowContextMenu(HWND hWnd) HMENU hMenu = CreatePopupMenu(); if (hMenu) { + + CString autoinjectLb; + if (AUTOINJECT_CURR) autoinjectLb = _T("Auto inject (On)"); + else autoinjectLb = _T("Auto inject (Off)"); + InsertMenu(hMenu, -1, MF_BYPOSITION, SWM_AUTOINJECT, autoinjectLb); + if (m_RC == 0) { @@ -219,6 +225,7 @@ void TegraRcm::ShowContextMenu(HWND hWnd) mii.dwTypeData = _T("Favorites"); CString csPathf, csFilename, payload; + m_Ctrltb1->GetDlgItem(PAYLOAD_PATH)->GetWindowTextW(csPathf); int nIndex = csPathf.ReverseFind(_T('\\')); if (nIndex > 0) diff --git a/TegraRcmGUI/TegraRcmGUI.rc b/TegraRcmGUI/TegraRcmGUI.rc index b44164e..14996cf 100644 Binary files a/TegraRcmGUI/TegraRcmGUI.rc and b/TegraRcmGUI/TegraRcmGUI.rc differ diff --git a/TegraRcmGUI/TegraRcmGUIDlg.cpp b/TegraRcmGUI/TegraRcmGUIDlg.cpp index e3e81b2..caa5438 100644 --- a/TegraRcmGUI/TegraRcmGUIDlg.cpp +++ b/TegraRcmGUI/TegraRcmGUIDlg.cpp @@ -92,6 +92,7 @@ BEGIN_MESSAGE_MAP(CTegraRcmGUIDlg, CDialog) ON_COMMAND(SWM_FAV08, InjectFav08Command) ON_COMMAND(SWM_FAV09, InjectFav09Command) ON_COMMAND(SWM_FAV10, InjectFav10Command) + ON_COMMAND(SWM_AUTOINJECT, AutoInjectCommand) END_MESSAGE_MAP() // @@ -365,6 +366,32 @@ void CTegraRcmGUIDlg::InjectFavCommand(int i) } } +void CTegraRcmGUIDlg::AutoInjectCommand() +{ + if (m_TegraRcm != NULL) + { + DialogTab03 *pt = (DialogTab03*)m_TegraRcm->m_Ctrltb3; + if (m_TegraRcm->AUTOINJECT_CURR) + { + m_TegraRcm->AUTOINJECT_CURR = FALSE; + m_TegraRcm->SetPreset("AUTO_INJECT", "FALSE"); + m_TegraRcm->DELAY_AUTOINJECT = FALSE; + CButton *m_ctlCheck = (CButton*)pt->GetDlgItem(AUTO_INJECT); + m_ctlCheck->SetCheck(BST_UNCHECKED); + } + else + { + m_TegraRcm->AUTOINJECT_CURR = TRUE; + m_TegraRcm->SetPreset("AUTO_INJECT", "TRUE"); + m_TegraRcm->DELAY_AUTOINJECT = TRUE; + CButton *m_ctlCheck = (CButton*)pt->GetDlgItem(AUTO_INJECT); + m_ctlCheck->SetCheck(BST_CHECKED); + } + AfxGetMainWnd()->UpdateWindow(); + pt->OnClickedAutoInject(); + } +} + void CTegraRcmGUIDlg::StartTimer() { diff --git a/TegraRcmGUI/TegraRcmGUIDlg.h b/TegraRcmGUI/TegraRcmGUIDlg.h index b4c35e5..56be0a8 100644 --- a/TegraRcmGUI/TegraRcmGUIDlg.h +++ b/TegraRcmGUI/TegraRcmGUIDlg.h @@ -26,7 +26,7 @@ #include "TegraRcm.h" #include "DialogTab01.h" #include "DialogTab02.h" - +#include "DialogTab03.h" #pragma comment (lib, "setupapi.lib") @@ -118,6 +118,7 @@ public: void InjectFav08Command(); void InjectFav09Command(); void InjectFav10Command(); + void AutoInjectCommand(); CTegraRcmGUIDlg *m_pMainWnd = this; private: diff --git a/TegraRcmGUI/resource.h b/TegraRcmGUI/resource.h index 57302b1..ac0dd2f 100644 Binary files a/TegraRcmGUI/resource.h and b/TegraRcmGUI/resource.h differ