mirror of
https://github.com/eliboa/TegraRcmGUI.git
synced 2024-12-27 10:36:04 +00:00
Added : trigger autoinject option from tray context menu
This commit is contained in:
parent
7b9b222148
commit
763ddd3473
5 changed files with 36 additions and 1 deletions
|
@ -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)
|
||||
|
|
Binary file not shown.
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue