cpueblo's
Programming
     

Google
 
Programming | Tools | Money | Blog | ±âÁ¸ ÀÚ·á½Ç | ÄÚµå»ç¶û | RedMine ¹æ¸í·Ï | About Me | English | °Ë»ö   
¾ð¾îº°:


ÁÖÁ¦º°:


Àüü Ç׸ñº°


±âŸ


±¤ÈñÀÇ ÀÚÀÛÅø

cpueblo's Library

 

ShellExecuteEx() - ÆÄÀÏ ½ÇÇà - ±â´Ù¸®±â~~

µî·ÏÀÚ : À¯±¤Èñ, 02-08-21 05:56:36



BOOL ExecuteProgram( String FileName, String Params, INT Flag )
{
     SHELLEXECUTEINFO execinfo;

     // ½ÇÇàÀ» À§ÇØ ±¸Á¶Ã¼ ¼¼Æ®
     ZeroMemory( &execinfo, sizeof(execinfo) );
     execinfo.cbSize = sizeof(execinfo);
     execinfo.lpVerb = "open";
     execinfo.lpFile = FileName.c_str();
     execinfo.lpParameters = Params.c_str();
     execinfo.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
     execinfo.nShow = SW_SHOWDEFAULT;

     // ÇÁ·Î±×·¥À» ½ÇÇàÇÑ´Ù.
     int r = (int)ShellExecuteEx( &execinfo );
     if( r == 0 ) return( false );

     // ¸¸¾à Sync Ç÷¢ÀÌ ¼¼Æ®µÇ¾úÀ¸¸é,
     // ½ÇÇàÀÌ Á¾·áµÉ ¶§±îÁö ±â´Ù¸°´Ù.
     if( Flag == 1 ){
       DWORD ec;
       do {
         GetExitCodeProcess( execinfo.hProcess, &ec );
         Application->ProcessMessages();
       } while( ec == STILL_ACTIVE );
     }

     return( true );
}
Âü°íÀÎ : ¹Ú¼º¿Ï °úÀå´Ô~ (crack90@hanmail.net)
World of World. http://cpueblo.com by À¯±¤Èñ. mail to cpueblocpueblo.com