| mege | 07.09.2005 - 23:19:38 |
| benimde ilk aklıma gelen yöntemler : tabi oldukça basit
function IsDelphiRunning:boolean;
begin IsDelphiRunning:=FindWindow('TAppBuilder',nil)<>0; end; Function IsDelphiRunning:Boolean; Begin Result := not((FindWindow('TApplication', nil) = 0) or (FindWindow('TAlignPalette', nil) = 0) or (FindWindow('TPropertyInspector', nil) = 0) or (FindWindow('TAppBuilder', nil) = 0)); End; ve sonunda; (tabi daha denemedim sabah inş. :) ) 參考 Borland 這篇 FAQ List:
Summary: The API' function IsDebuggerPresent() can recognize Delphi IDE (at least version 5 which I tried) as well as and 3rd party debuggers. function IsDebuggerPresent(): Boolean; external 'kernel32.dll'; procedure TForm1.Button1Click(Sender: TObject);
begin if IsDebuggerPresent() = True then ShowMessage( 'Debugger or IDE detected' ) else ShowMessage( 'Debugger or IDE NOT detected' ); end; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/isdebuggerpresent.asp Platform SDK: Debugging and Error Handling
IsDebuggerPresent The IsDebuggerPresent function determines whether the calling process is being debugged by a user-mode debugger. BOOL IsDebuggerPresent(void); Parameters This function has no parameters. Return Values If the current process is running in the context of a debugger, the return value is nonzero. If the current process is not running in the context of a debugger, the return value is zero. Remarks This function allows an application to determine whether or not it is being debugged, so that it can modify its behavior. For example, an application could provide additional information using the OutputDebugString function if it is being debugged. To determine whether a remote process is being debugged, use the CheckRemoteDebuggerPresent function. To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see Using the Windows Headers. | |
| lazio | 15.09.2005 - 09:39:36 |
| bu yöntemi kullanan bazı komponentler var. yani komponenti yüklüyorsunuz ide açıkken exe yi çalıştırdığınızda hiç ses çıkarmıyor ama delphi yi kapattığınızda hemen register penceresi çıkıyor :D | |