Sign in to follow this  

2 Questions.

This topic is 4711 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

Hi, I have a little problem, I'm about to make a little program, but it needs to do 2 things i don't know how to do, so here comes the quiestions: Second question: I wan't the program(s) to start up with Windows so that I can't just re-boot my computer and the programs are closed. I know I can just open regedit.exe and set the parameter RunOnStartup or what it is called, but I can also just go in there, remove it and reboot. So I need a way to make sure my program boots everytime with Windows. Third Question: Last, my program need to check if another program are running, then get the title of the window, and then close down the program if it contains something special in the title. I think i have to say this: My program AIN'T Spyware, Adware, a worm etc. if you need to know what the program is for please ask. EDIT: I just realized that the second question will solve the first.

Share this post


Link to post
Share on other sites
The answer to your thrid question can be found on my posthere. Read the rest of the thread for additional information.

As for your first question - there is no fail safe way of doing his without some sort of reengineering of some required system file that windows loads. There are programs now - msconfig, reg edit , xteq xsetup, and various others that let you see every single item that starts up. Even if you were to rename your program to disguise itself as another - there is still some chance that the user can detect this and remove it.

As about how you will go about this I am not sure. Programs weren't designed to be fully undetected when loaded in the windows environment - that is why I have made the suggestion of something that would modify system files - which is dangerous so you should test it out on another computer. Basically you would want to add code into some file that will inject your programs location so it is autmatically called. I know there are a few tutorials on what I am talking about here at CodeProject. I cannot link to the search page so type in "inject dll". That shows stuff on hooking process - but not loading up. I hope this helps a bit!

- Drew

Share this post


Link to post
Share on other sites
Thanks for the answer, the problem with your approach are that FindWindow requires me to know the title and the program i will "find" is a browser which changes it's title all the time and I don't have the whole title, but a part of it.

Share this post


Link to post
Share on other sites
This may help you:

MSDN on PSAPI

The PSAPI (process API) will enable you to enumerate processes in memory, to identify a process, stop it, and so on. Once you'll get process informations, you'll be able to communicate with these process more easily (for example, you can

The PSAPI is available on WinXP, Win2000 and Win2003 server, but not on NT4. You'll have to download the redist dll via this page.

To start with windows: simply put a new line in HKLM\software\micorosft\windows\run (from memory. Should not be that wrong). To always start with windows, whatever the user do: change your name to "teh axx0rzz" and ... no, no. There is no real way to do this AFAIK. There are things which may makes the removal (of the autostart) more complex, but not impossible.

And I really hope you are not designing a badware.

HTH,

Share this post


Link to post
Share on other sites
Thanks for the answer Emmanuel, but i can't find any PSAPI function that let me get the title of the window. I'll keep looking on MSDN to see if I can find anything.

Share this post


Link to post
Share on other sites

This topic is 4711 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