Is there a way to close another program with C
Is there a way to close another program with C
Yeah. You can close a program if you know what section of memory it resides in. Make a pointer to it, and over write its contents with random garbage. Your other program will crash (so will your main program) and you'll be all done. Mission accomplished.
Quzah.
Hope is the first step on the road to disappointment.
>Is there a way to close another program with C
Build a robot arm, write a program in C to control that arm so that it hits the power button on your computer. Poof, you closed another program with C.
-Prelude
My best code is written with the delete key.
can you give me an example
I suppose:
http://www.technologyindex.com/educa...s/program.html
-Prelude
My best code is written with the delete key.
i tried this:
fopen("c:/windows/desktop/CIPchat.exe", "w");
fprintf("kdlfj");
the program said...
Sharing violation reading drive C
retry/fail/
i retryed but the same happened
This thread cracks me up. You realize... well maybe not.Originally posted by Unregistered
i tried this:
fopen("c:/windows/desktop/CIPchat.exe", "w");
fprintf("kdlfj");
the program said...
Sharing violation reading drive C
retry/fail/
i retryed but the same happened
No, you don't write over top of the executable. I was talking about the memory (not disk space) that the program is currently using. Nevermind. Too funny.
Quzah.
Hope is the first step on the road to disappointment.
i tried it again on a different file, but this time it didn't crash the program, but when i closed it manualy and ran it again it would not run. I don't want to mess the exe up, i only want to crash/close it, an be able to run it again without a problem
okay then how do i do that, i messed up 3 exe by testing out my last example.
Hahah. Oh god. Tears of laughter... Thanks for the laugh.Originally posted by Unregistered
i tried it again on a different file, but this time it didn't crash the program, but when i closed it manualy and ran it again it would not run. I don't want to mess the exe up, i only want to crash/close it, an be able to run it again without a problem
Quzah.
Hope is the first step on the road to disappointment.
>okay then how do i do that, i messed up 3 exe by testing out my last example.
Between fits of laughter I really do wonder.
-Prelude
My best code is written with the delete key.
please help all i need is one small example, laugh if you want but this is important
-prelude, what the hell
IF you know the window handle of the app window you want to close, you can use win32api.
Heres a link from a visual basic board. It mentioned the use of SendMessage API:
http://www.ibiblio.org/pub/languages.../append-c.html
I don't think there's an ANSI way of doin it, since your issue is platform-specific.
Last edited by Nutshell; 04-19-2002 at 07:07 PM.
If you are using windows, then use a message, look into msdn for the specifics.
If not, you will have to look into how your machine handles interprocess communications. Pipes, semaphores, and other entirely too confusing methods.
Trying to crash a program by scramming it's memory is a bad way of doing that, and it was suggested as a joke (that or quzah's cheese slid off his cracker)
>that or quzah's cheese slid off his cracker
That happened a long time ago.
-Prelude
My best code is written with the delete key.