온란인 상태라서 소스에 바보스럽더라도 이해를..
* 꿈꾸는 바로 류.. 였지여..
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, '제목없음 - 메모장'));
|