File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -252,4 +252,18 @@ void Injector::on_actionQuit_triggered()
252252
253253 // Close the injector.
254254 QCoreApplication::quit ();
255+ }
256+ void Injector::on_actionDiscord_Presence_triggered (bool checked)
257+ {
258+ if (checked) {
259+ // Run the Discord Presence executable.
260+ system (" discord/DiscordPresence.exe" );
261+ } else {
262+ // Close our running Discord Presence process.
263+ DWORD pid = NULL ;
264+ HWND hWnd = FindWindow (NULL , QString (" DiscordPresence.exe" ).toStdWString ().c_str ());
265+ GetWindowThreadProcessId (hWnd, &pid);
266+ HANDLE handle = OpenProcess (SYNCHRONIZE | PROCESS_TERMINATE, TRUE , pid);
267+ TerminateProcess (handle, NULL );
268+ }
255269}
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ private slots:
3838
3939 void on_actionQuit_triggered ();
4040
41+ void on_actionDiscord_Presence_triggered (bool checked);
42+
4143private:
4244 Ui::Injector *ui;
4345};
Original file line number Diff line number Diff line change 104104 <string >Misc</string >
105105 </property >
106106 <addaction name =" actionAbout" />
107+ <addaction name =" actionDiscord_Presence" />
107108 <addaction name =" actionQuit" />
108109 </widget >
109110 <addaction name =" Scripts" />
168169 <string >Quit</string >
169170 </property >
170171 </action >
172+ <action name =" actionDiscord_Presence" >
173+ <property name =" checkable" >
174+ <bool >true</bool >
175+ </property >
176+ <property name =" text" >
177+ <string >Discord Presence</string >
178+ </property >
179+ </action >
171180 </widget >
172181 <resources />
173182 <connections />
You can’t perform that action at this time.
0 commit comments