Sign in to follow this  

Start remote program

This topic is 3460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm wondering how you start a program from a current? Also, I'm wondering how you can make the program "invisible"? It doesn't matter how, as long as it's not at the taskbar (the big thing, anyway). Thanks in advance!

Share this post


Link to post
Share on other sites
Quote:
Original post by Obbedemus
I'm wondering how you start a program from a current?
Also, I'm wondering how you can make the program "invisible"? It doesn't matter how, as long as it's not at the taskbar (the big thing, anyway).
Thanks in advance!
What language, OS and API (E.g. C++ / Windows XP / Win32)? And why do you want to do this?

Share this post


Link to post
Share on other sites
Oh, forgot! C++, Windows, Win32.
I'm planning to create a program that shuts down the computer after a certain amount of time. So I don't have to... (I don't know shit about viruses and shit, so don't worry)

Share this post


Link to post
Share on other sites
You could also write up a daemon that is run at boot time. Then after, say, 4 hours, shuts the computer down automatically, unless you tell it not to.

Share this post


Link to post
Share on other sites
Well, instead of int main(), use WinMain, like this:


int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPCSTR lpCmdLine,
int nCmdShow)
{
while(1){
DoSomething();
Sleep(1000); // Otherwise the process will take 100% CPU power.
}
return 0;
}




There will be no window created and there will be nothing in the taskbar. Use this if you have the source of the program you want to start. If you haven't got it, use ShellExecute instead.

Share this post


Link to post
Share on other sites
Quote:
Original post by Obbedemus
Oh, forgot! C++, Windows, Win32.
I'm planning to create a program that shuts down the computer after a certain amount of time. So I don't have to... (I don't know shit about viruses and shit, so don't worry)


Solved problem.

Share this post


Link to post
Share on other sites

This topic is 3460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this