Solved Run At Startup
-
@Fuel said in Run At Startup:
You mean the Windows Resource Monitor? I dont think so. Its Part of the OS. There are no Functions to implement it in your own Program. Maybe with C# but i dont know.
It's not necessarily the windows resource monitor, but another 3rd party resource monitor that shows in just one line on my computer. I would like it to run in the actual program I have created. But yeah, something like that. As stated, I've hunted awhile now online and haven't found anything related to what I'm wanting to do. So I decided to give in and just ask lol.
-
Hi
Maybe i don't understand clearly what you are trying
but can you just start the other external .exe program using QProcess ?
When you app starts up. -
@mrjj said in Run At Startup:
Hi
Maybe i don't understand clearly what you are trying
but can you just start the other external .exe program using QProcess ?
When you app starts up.Yeah, I tried something like this:
QString program = "C:/resomonitor.exe"; QStringList arguments; arguments << "-style" << "motif"; QProcess *myProcess = new QProcess(parent); myProcess->start(program, arguments);
But nothing works. The program still runs with no errors, but nothing happens.
-
is that a Qt program? (resomonitor.exe)
the -style suggest it.
Also if u go to c:\ and click on it , it will run ?did you try with other program for test ?
like notepad.exe -
@mrjj said in Run At Startup:
is that a Qt program? (resomonitor.exe)
the -style suggest it.
Also if u go to c:\ and click on it , it will run ?did you try with other program for test ?
like notepad.exeNo, it's a 3rd part resource monitor. And yeah, if I go there and click, it runs. I can either put the .exe in C:/ or I can use AHK (autohotkey) to make a file to run it. But either way, I can't get the program to start using Qprocess. I"m sure there's a way to do it, but I haven't found it yet. Thank you!
-
@Epiales666
It normally just works.
Also, just use notepad.exe did not work either ??try this oneliner
bool ok = QProcess::startDetached("notepad.exe"); -
@mrjj said in Run At Startup:
bool ok = QProcess::startDetached("notepad.exe");
Yeah, I get the error
warning: C4189: 'ok' : local variable is initialized but not referenced
But it opens notepad.
-
@Epiales666
it is just warning telling we did not use bool ok for anything and that
is right :)
ok so now try withc:\\resomonitor.exe
if that cannot start, i am guessing on it needs extra dlls that the
environment inside QProcess is not setup to find. -
@mrjj said in Run At Startup:
c:\resomonitor.exe
Nope, doesn't do anything either :(
Thank you for taking the time to help m8. I'll keep messing around with it... tytyty
-
im pretty sure it just needs some extra dlls.
Did you just take it from its installation folder and
put alone in c:\ ?
and u did use 2 backslashes ?c:\\xx.exe <-- 2 in code
Is it a public free one i could also download?
-
@mrjj said in Run At Startup:
im pretty sure it just needs some extra dlls.
Did you just take it from its installation folder and
put alone in c:\ ?
and u did use 2 backslashes ?c:\\xx.exe <-- 2 in code
Is it a public free one i could also download?
Okay, here is the actual link to the resource monitor
QProcess::startDetached("C:\\Program Files (x86)\IObit\Advanced SystemCare Ultimate\Monitor.exe");
And yes, I put a shortcut in C: and also in system 32, so that I could try using it both ways:
QProcess::startDetached("C:\\Monitor.exe"); QProcess::startDetached("Monitor.exe");
Trying all three above shows no errors, but won't work either :(
-
Hi
I do not think you can just copy monitor alone.
that is the error. i guess it has dlls in its folder, which are NOT found when running it
with QProcess since they are in other folder.for this line
QProcess::startDetached("C:\\Program Files (x86)\IObit\Advanced SystemCare Ultimate\Monitor.exe"); did you escape all slashes ? also it might not like the spaces unless you put "" around
like this
QProcess::startDetached("\"C:\\Program Files (x86)\\Windows Photo Viewer\\ImagingDevices.exe\"");
this starts the app.
-
Yeah, I've tried that way as well... my newest attempts are:
QProcess *process = new QProcess(this); QString monitor="\"C:\\Monitor.exe\""; process->startDetached(monitor);
AND
QProcess::startDetached("\"C:\\Program Files (x86)\\IObit\\Advanced SystemCare Ultimate\\Monitor.exe\"");
Neither one of them work either. Grrrrr Your example works fine. It opens correctly... what am I doing wrong?
-
@Epiales666
I guess that Monitor.exe dont like to be started like that :)
Im not sure what environment QProcess starts with. if copy of default
or a reduced one. In any case, i think Monitor.exe tried to load something in dont find when started like that. -
@mrjj said in Run At Startup:
@Epiales666
I guess that Monitor.exe dont like to be started like that :)
Im not sure what environment QProcess starts with. if copy of default
or a reduced one. In any case, i think Monitor.exe tried to load something in dont find when started like that.Yeah, I can do variants of
QProcess *process = new QProcess(this); QString monitor="\"C:\Monitor.exe\""; process->startDetached(monitor);
And it will work. Like if I put in the address for internet explorer, it works fine. So does the example you gave me... But it doesn't seem to like Monitor.exe for whatever reason. Frustrating. It shouldn't matter what exe it is. It should open regardless.
Anyway, thank you for your help. I'll still mess around with other variants and see if I can't get something to work.
-
@Epiales666 said in Run At Startup:
what exe it is. It should open regardless.
No, that really is not the case.
if it has some path set in ENVIRONMENT it uses for data or loads dlls directly from subfolder next to exe, it
wont work as QProcess might not have
same setup in ENVIRONMENT. ( i dont know if true or false)Also if this one
"Advanced SystemCare Ultimate 10 is a powerful and full-scale software for PC security"
It might detect it as tampering and hence do not start. -
Thank you very much for your help. I'm going to go ahead and classify this topic as solved, since there is no work around to doing what I'd like to do. You were an extremely helpful person. I'll go back and add to your reputation. Thank you much
-
So you know, I solved the problem by doing the below:
QDesktopServices::openUrl(QUrl("file:///C:/Program Files (x86)/IObit/Advanced SystemCare Ultimate/Monitor.exe", QUrl::TolerantMode));
Only issue is I don't know how to place it to a particular spot on my system. I have a blank table set inside my program so that I can move it right into that spot and it looks lke it's part of the program lol... so just have to figure out how to move it to x and y position so that it starts there along with the program at startup.
But wanted to let you know there was a work around to get it to start when system boots. Again, thanks for your help.
-
So you can see what I'm talking about...
https://gyazo.com/b225e65df38e57dafea62e680349089c
See the Ram and CPU at the top? That's the Monitor.exe.... I just either need to move it to x and y position, or somehow place it WITHIN the app so that it shows there...don't know how to do either lol. I used the:
setGeometry(1510, 30, 10,10);
For the app location, but not sure how to do that one. Thanks!
-
@Epiales666
Hi
Cool launcher :)
I think its sadly not possible to embed monitor into your app.
But you should be able to move it but to control it, i think you need native windows api.Update
Why not get the values your self?
https://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process