Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
question about c.
Reply
Posted 2002-10-15, 02:33 PM
I'm pretty new to c programming so plz dont flame me if this is a newbie question but is there a way u could open a different program with an .exe extension w/ a c program.

like for example would this work?

fp = fopen("file.exe", ??);

ty for your help

Last edited by Demosthenes; 2002-10-15 at 04:04 PM.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2002-10-17, 02:02 PM in reply to Demosthenes's post "question about c."
This is C, a computer language...Anything will work, you just have to know how to devise the right scripts. There is a way for all.
Headhunter $160 Grunt $235 Taruen $325, Beating a level 50, Pricless
Old
Profile PM WWW Search
Almata is neither ape nor machine; has so far settled for the in-betweenAlmata is neither ape nor machine; has so far settled for the in-between
 
Almata
 



 
Reply
Posted 2002-10-17, 02:56 PM in reply to Demosthenes's post "question about c."
That would open the file. The question is if opening the file is really what you want to do.
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2002-10-17, 03:30 PM in reply to Demosthenes's post "question about c."
Well I run bots on my computer all day when I'm not at home and the new one crashes quite a bit. I was wanting to make a program that would just restart it for me everytime it turns off. This is my script:

#include <stdio.h>
FILE *fp;

int main(void)
{
fp = fopen("mephbot.exe", "???");

if(fclose(fp))
{
fp = fopen("mephbot.exe", "???");
}

return 0;
}


I was thinking that would do it but it does absolutely nothing...doesn't even start my program. Mephbot.exe is the name of the program I did check that and where I put the question marks I have tried many differen combos. Any help as to why this is not working would be helpful...thnx
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2002-10-17, 10:48 PM in reply to Demosthenes's post "question about c."
VB is much nicer for writing these kind of programs, if you have it, Ill tell you how to write it.
Old
Profile PM WWW Search
drivehappy is neither ape nor machine; has so far settled for the in-betweendrivehappy is neither ape nor machine; has so far settled for the in-between
 
drivehappy
 



 
Reply
Posted 2002-10-18, 07:53 AM in reply to Demosthenes's post "question about c."
You want to execute, not open the program. I can't help you on that one if you're trying to do it in a DOS program. If you can use the windows API, look at ShellExecute and ShellExecuteEx .
And if you have computers with compilers at school (read CS lab), and they have VC++, and they have fortress or some other lock out program, I have the source for a very interesting, um, utillity that I wrote, that can, um, supliment the run box by convincing windows that text files are really executable without renaming them, yeah. (In other words, this source turns VC on a computer into a nice way to run WinAmp and such on computers that wouldn't normally allow it)
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2002-10-20, 09:56 AM in reply to Demosthenes's post "question about c."
mjordan2nd: Tells us what compilers you have; straight c is old, and hard to work with.
Old
Profile PM WWW Search
drivehappy is neither ape nor machine; has so far settled for the in-betweendrivehappy is neither ape nor machine; has so far settled for the in-between
 
drivehappy
 



 
Reply
Posted 2002-10-20, 11:34 AM in reply to Demosthenes's post "question about c."
i have dev-c++ compiler.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2002-11-05, 01:33 PM in reply to Demosthenes's post "question about c."
mjordan2nd: Try this, should work in any c compiler that supports Win32. It'll run Notepad untill you quit it via the taskmanager.....

#include <windows.h>

int WINAPI WinMain(HINSTANCE handle,HINSTANCE dontcare,PSTR cli,int showflags);

int WINAPI WinMain(HINSTANCE handle,HINSTANCE dontcare,PSTR cli,int showflags) {
STARTUPINFO startup;
PROCESS_INFORMATION process;

GetStartupInfo(&startup); /* Just copy the current process startup info. */
do {
if (!CreateProcess("c:\\WINNT\\System32\\NotePad.EXE" ,NULL,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,N ULL,&startup,&process)) {
MessageBox(NULL,"Can't launch app.","Applauncher",MB_ICONWARNING|MB_OK);
exit(1); /* can't create process, die. */
}
WaitForSingleObject(process.hProcess,INFINITE); /* Wait for the process to die. */

} while (1);
return 0;
}

Last edited by MrRooster; 2002-11-05 at 01:37 PM.
Old
Profile PM WWW Search
MrRooster is neither ape nor machine; has so far settled for the in-betweenMrRooster is neither ape nor machine; has so far settled for the in-between
 
MrRooster
 



 
Reply
Posted 2002-11-05, 07:20 PM in reply to Demosthenes's post "question about c."
thank u mr rooster...ill try it and c if it works, never done any windows programming so ill c...thank u
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 03:58 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.