Results 1 to 2 of 2

Thread: Run other application from C++

  1. #1
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    Run other application from C++

    For VC6
    [src]
    #include < iostream.h >
    #include < windows.h >


    int main(void)
    {

    cout<<"MS Paint Will start nown"<<endl;
    /* แก้ไขโปรแกรมที่ต้องการรัน ในบรรทัดถัดไป*/
    system("C:WINNTSystem32mspaint.exe");

    return 0;
    }
    [/src]

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    187


    Re: Run other application from C++

    [src]
    #include < windows.h >
    void main( VOID )
    {
    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );

    // Start the child process.
    if( !CreateProcess( NULL, // No module name (use command line).
    "MyChildProcess", // Command line.
    NULL, // Process handle not inheritable.
    NULL, // Thread handle not inheritable.
    FALSE, // Set handle inheritance to FALSE.
    0, // No creation flags.
    NULL, // Use parent's environment block.
    NULL, // Use parent's starting directory.
    &si, // Pointer to STARTUPINFO structure.
    &pi ) // Pointer to PROCESS_INFORMATION structure.
    )
    {
    ErrorExit( "CreateProcess failed." );
    }

    // Wait until child process exits.
    WaitForSingleObject( pi.hProcess, INFINITE );

    // Close process and thread handles.
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
    }
    [/src]

Similar Threads

  1. หลักการป้องกัน Web Application #1
    By HxZer0 in forum Server/Web Security Protection & Tuning
    Replies: 0
    Last Post: 12-05-2008, 05:02 PM
  2. Hacking Web Application
    By big_ajax in forum Ethical Hacking for Padawan
    Replies: 1
    Last Post: 21-03-2008, 01:41 PM
  3. Hacking Web Application
    By zetalr in forum Hacking, Exploit Articles/Tutorial/Techniques
    Replies: 3
    Last Post: 18-06-2007, 12:32 AM
  4. Application cracking
    By elitesaint in forum Newbie / Starter Hacker
    Replies: 3
    Last Post: 07-03-2007, 04:06 PM
  5. SSL Application with VC++
    By newsbot in forum C/C++,C#,VC++,MFC,Win32
    Replies: 1
    Last Post: 26-11-2004, 01:38 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •