본문 바로가기
반응형

Delphi, RadStudio82

[개발/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.
[개발/delphi] RLINK 32: out of memory 델파이 RLINK32: out of memory 델파이 컴파일을 하다보면 RLINK32 에러가 발생하는 경우가 있다. 이 경우는 코드상의 에러가 아니어서 설정 변경을 통해서 에러를 수정할 수가 있다. 아래의 방법들을 시도해 보는 것으로 에러를 수정할 수가 있다. 1 리소스명을 짧게 한다. 2. dll 파일을 더 작은 리소스 수로 여러개로 나눈다. 3. 이미지 리소스를 여러개의 strips(icons, glyphs, etc)으로 결합한다. 4. 만약 icon 파일에 128x128 크기의 형식이 포함되어 있다면 이것을 제거하면 확실하게 수정된다. 2011. 12. 12.
[Delphi] IdHTTP로 세션아이디를 포함하여 요청하기 (SessionID) [Delphi] IdHTTP로 세션아이디를 포함하여 요청하기 (SessionID) 출처: 출처 : http://bloodguy.tistory.com 세션ID는 재주껏 가져오자. 쿠키에 저장되어 있으니. TWebBrowser에서 세션ID 가져오기 : http://bloodguy.tistory.com/entry/Delphi-TWebBrowser에서-세션아이디SessionID-가져오기 // URL에서 도메인명만 따냄 function GetHostNameFromURL(URL: String): String; var PosSlash: Integer; begin Result:=Trim(URL); Result:=MidStr(Result, Pos('://', Result)+3, Length(Result)); PosSla.. 2011. 12. 9.
[delphi] 브라우저 링크 프로토콜 정의하기 [delphi] 브라우저 링크 프로토콜 정의하기 출처 : http://bloodguy.tistory.com/entry/%EB%B8%8C%EB%9D%BC%EC%9A%B0%EC%A0%80-%EB%A7%81%ED%81%AC-%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C-%EC%A0%95%EC%9D%98%ED%95%98%EA%B8%B0 레지스트리에 등록한다. 예제는 BTP(Bloodguy Test Protocol) 을 만든다고 가정. HKEY_CLASSES_ROOT\BTP 라는 키를 만들고 '(기본값)'에 다음과 같은 value를 넣고, 'URL Protocol' 이라는 빈 문자열 값을 하나 만든다. (기본값) REG_SZ URL:BTP(Bloodguy Test Protocol) URL Pr.. 2011. 12. 9.
반응형