Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[2867] [답변] MODEL10/ 델파이에서의 프로그램 콜 & 킬
grcsb [ ] 1439 읽음    1998-05-19 19:51
온란인 상태라서 소스에 바보스럽더라도 이해를..

* 꿈꾸는 바로 류.. 였지여..

1. 우선다른 프로그램 실행

Function  RunFile(FileName:String):String;
Var
   pFileName : PChar;
   TempCStr : Packed Array [0..1024] of Char;
Begin
     pFileName:= @TempCStr;
    
     Result:= '';
     DiskError:= WinExec(StrToC(FileName), SW_SHOWDEFAULT);
     Case DiskError of
          0 : Result:= '메모리가 부족하거나,화일에 이상이 있습니다';
          2 : Result:= '화일이 존재하지 않습니다.';
          3 : Result:= 'Path가 존재하지 않습니다';
          5 : Result:= 'Dynamically link Error or Network-Protection Error.';
          6 : Result:= 'Library required separate data segments for each task.';
          8 : Result:= 'There was insufficient memory to start the application.';
         10 : Result:= 'Windows version was incorrect.';
         11 : Result:= 'Executable file was invalid.';
         12 : Result:= 'Application was designed for a different operating system.';
         13 : Result:= 'Application was designed for MS-DOS 4.0.';
         14 : Result:= 'Type of executable file was unknown.';
         15 : Result:= 'Attempt was made to load a real-mode application (developed for an earlier version of Windows).';
         16 : Result:= 'Second instance of an executable file containing multiple read-only data segments.';
         19 : Result:= 'Compressed executable file!!';
         20 : Result:= 'Dynamic-link library (DLL) file was invalid.';
         21 : Result:= 'Application requires 32-bit extensions.';
      End;
End;

* 사용하실때에는
  Procedure Form1.Button1Click(Sender:TObject);
  Begin
    RunFile('C:\Command.com');
  End;


2. 다른 프로그램 종료
  * 방법 1
  SendMessage(FindWindow(Nil, 'WinFax PRO Send'), WM_CLOSE , 0, 0);
  * 방법 2
  CloseWindow(FindWindow(Nil, '제목없음 - 메모장'));


+ -

관련 글 리스트
2867 [답변] MODEL10/ 델파이에서의 프로그램 콜 & 킬 grcsb 1439 1998/05/19
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.