Thread: system calls

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    19
    Okay guys, I think I have solved the problem (of course with your help ) Here is my new code:


    Dev-C++ (using gcc)


    Code:
    #include <windows.h>
    #include <stdio.h>
    
    int Exec(char szPath[])
    {
       PROCESS_INFORMATION pif;
       STARTUPINFO si;
       ZeroMemory(&si,sizeof(si));
       si.cb = sizeof(si);
       BOOL bRet = CreateProcess(szPath," 192.168.1.10",NULL,NULL,FALSE,0,NULL,NULL,&si,&pif);
       
       if (bRet == FALSE) 
       {
          MessageBox(HWND_DESKTOP,"Unable to start program","",MB_OK);
          return 1; 
       } 
       
       CloseHandle(pif.hProcess);
       CloseHandle(pif.hThread);
       return 0;
    }
    
    int main()
    {
       Exec( "C:\\Program Files\\Nmap\\Nmap.exe " );
       
    }
    Thank you very much for your help!
    Last edited by kiai_viper; 06-13-2007 at 12:21 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Basic system calls help.
    By AmbliKai in forum C Programming
    Replies: 5
    Last Post: 03-21-2008, 07:18 AM
  2. Opinions on custom system build
    By lightatdawn in forum Tech Board
    Replies: 2
    Last Post: 10-18-2005, 04:15 AM
  3. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 07:38 AM
  4. School Mini-Project on C/C++ (Need Your Help)..
    By EazTerence in forum C++ Programming
    Replies: 4
    Last Post: 09-08-2005, 01:08 AM
  5. System Calls && Variables
    By Okiesmokie in forum C++ Programming
    Replies: 6
    Last Post: 03-06-2002, 09:10 PM