반응형 SB 리치 패밀리5296 [개발/delphi] 자기 자신을 지우는 프로그램 만들기(delphi) [개발/delphi] 자기 자신을 지우는 프로그램 만들기(delphi) from. 나이렉스 홈페이지 팁란( http://www.nilex.net/ ) 안치봉( ahn@nilex.co.kr ) 자기 자신을 지우는 프로그램은 대부분 인스톨에 관계된것 중에서 Uninstall 프로그램 에 적용이 됩니다. 아래는 그 소스입니다. 간단히 설명을 드리자면 원래 실행중인 프 로그램을 당장(?) 삭제하는것은 힘듭니다. 그래서 아래꽁수는 시스템에서 지원해주는 기능을 사용합니다. 자세한건 소스를 직접 분석해 보시기 바랍니다 - 백문이 불여 일 행! ... ... procedure TForm1.RemoveFile(FileName: String); var ShortDest: array[0..400] of Char; WINIn.. 2011. 12. 12. [개발/delphi] how to register an OCX [delphi] How to register an OCX http://www.delphifaq.com/faq/delphi_windows_API/f515_0.htm program RegisterMyOCX; uses OLECtl, Windows, Dialogs; var OCXHand: THandle; RegFunc: TDllRegisterServer; //add to the uses clause begin OCXHand:= LoadLibrary('c:\windows\system\test.ocx'); RegFunc:= GetProcAddress(OCXHand, 'DllRegisterServer'); //case sensitive if RegFunc 0 then RegFunc else ShowMessage('E.. 2011. 12. 12. [개발/delphi] Starting and stopping Windows services [delphi] Starting and stopping Windows services http://www.delphifaq.com/faq/delphi_windows_API/f521_0.htm Note: Thanks to Henk Mulder who mailed me about a correction with the assignment to dwCurrentState. I think this code was written originally with Delphi 3 and probably Borland or Microsoft changed something from a signed integer to an unsigned word. { Thanks to Andrea Canu for pointing out .. 2011. 12. 12. [개발/delphi] how to have an exe file delete itself [delphi] How to have an EXE file delete itself http://www.delphifaq.com/faq/delphi_windows_API/f530_0.htm Both Windows 95 and NT provide mechanisms for doing just this. Under Win95 you use the WinInit.ini file. Create a [rename] section and put in entries like "NewName.txt=OldName.txt" to have files renamed, or "nil=OldName.txt" to have them deleted. Windows will perform this at the next boot. U.. 2011. 12. 12. [개발/delphi] 외부 프로그램 실행하고 기다리기 Execute and wait [delphi] Execute and wait for termination (16 and 32bit applications) http://www.delphifaq.com/faq/delphi_windows_API/f353_0.htm This unit is based upon the well-known and largely used WinExecAndWait function The former WinexecAndWait function doesn't compile under Delphi 2.0 because the GetModuleUsage function is no longer supported under Win95. I have simply updated the previous code so that i.. 2011. 12. 12. [delphi] Tracking DLL loading, attaching, detaching and unloading DLL 을 이용할 때 dll 이 로딩되는지 언로딩 되는지 알 수 있다. Library testdll; http://www.delphifaq.com/faq/delphi_windows_API/f534_0.htm The code snippet shows how your DLL can track its usage. uses Windows, // DLL_PROCESS_nnn defined in here SysUtils, Classes; procedure MyDLLProc(Reason: Integer); begin case Reason of DLL_PROCESS_ATTACH: // called when the DLL is loaded begin end; DLL_PROCESS_DETACH: // called when.. 2011. 12. 12. 이전 1 ··· 697 698 699 700 701 702 703 ··· 883 다음 반응형