delphi çalışıyormu? veya program debug halindemi

Yazdığınız makaleleri ve üyelerimizin işine yarayacağını düşündüğünüz kodlarınızı gönderebilirsiniz. Bu foruma soru sormayın!
Cevapla
Kullanıcı avatarı
mege
Admin
Mesajlar: 2360
Kayıt: 05 Şub 2004 04:32
Konum: Beşiktaş
İletişim:

delphi çalışıyormu? veya program debug halindemi

Mesaj gönderen mege »

benimde ilk aklıma gelen yöntemler : tabi oldukça basit

Kod: Tümünü seç

function IsDelphiRunning:boolean;
begin
    IsDelphiRunning:=FindWindow('TAppBuilder',nil)<>0;
end;

Kod: Tümünü seç

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';

Kod: Tümünü seç

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/defau ... resent.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.
.-.-.-.-.-.-.-. ^_^
Kullanıcı avatarı
lazio
Moderator
Mesajlar: 1527
Kayıt: 11 Tem 2003 04:55
Konum: İstanbul

Mesaj gönderen lazio »

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
DeveloperToolKit

..::|YeşilMavi|::..
Cevapla