Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Trucos (https://www.clubdelphi.com/foros/forumdisplay.php?f=52)
-   -   Protección de componentes en el IDE de Delphi (https://www.clubdelphi.com/foros/showthread.php?t=80653)

dec 01-07-2006 00:02:39

Protección de componentes en el IDE de Delphi
 
Generalmente, los autores de componentes ofrecen versiones Trial usando una "protección" que consta en testear si Delphi se está ejecutando o no, con este código, podrás craquear y simular la ejecución de Delphi, sólo deberás colocar esta unit en la clausula "Uses".

Código Delphi [-]
function IsDelphiRunning : boolean;
begin
  Result := (FindWindow('TAppBuilder',nil) > 0) and
            (FindWindow('TPropertyInspector',nil) > 0) and
            (FindWindow('TAlignPalette',nil) > 0);
end;

(******************************************************************************
DSim 1.2  Simulación de la ejecucion de Delphi
Copyright (C) 2001 Antarlac Software
******************************************************************************)

unit DSim;

interface


implementation

uses Windows;

const

  AppBuilderWindowClass :TWndClass =
  (
    style :0;
    lpfnWndProc :@DefWindowProc;
    cbClsExtra :0;
    cbWndExtra :0;
    hInstance :0;
    hIcon :0;
    hCursor :0;
    hbrBackground :0;
    lpszMenuName :NIL;
    lpszClassName :'TAppBuilder'
  );

  PropertyInspectorWindowClass :TWndClass =
  (
    style :0;
    lpfnWndProc :@DefWindowProc;
    cbClsExtra :0;
    cbWndExtra :0;
    hInstance :0;
    hIcon :0;
    hCursor :0;
    hbrBackground :0;
    lpszMenuName :NIL;
    lpszClassName :'TPropertyInspector'
  );

  AlignPaletteWindowClass :TWndClass =
  (
    style :0;
    lpfnWndProc :@DefWindowProc;
    cbClsExtra :0;
    cbWndExtra :0;
    hInstance :0;
    hIcon :0;
    hCursor :0;
    hbrBackground :0;
    lpszMenuName :NIL;
    lpszClassName :'TAlignPalette'
  );

var
  AppBuilderHWND :HWND;
  PropertyInspectorHWND :HWND;
  AlignPaletteHWND :HWND;


initialization

  { TAppBuilder }
  if FindWindow(AppBuilderWindowClass.lpszClassName,NIL) = 0 then
  begin
    RegisterClass(AppBuilderWindowClass);
    AppBuilderHWND := CreateWindowEx(0, AppBuilderWindowClass.lpszClassName,
                                     '', 0, 0, 0, 0, 0, 0, 0, HInstance, NIL);
  end;
  { TPropertyInspector }
  if FindWindow(PropertyInspectorWindowClass.lpszClassName,NIL) = 0 then
  begin
    RegisterClass(PropertyInspectorWindowClass);
    PropertyInspectorHWND := CreateWindowEx(0, PropertyInspectorWindowClass.lpszClassName,
                                            '', 0, 0, 0, 0, 0, 0, 0, HInstance, NIL);
  end;
  { TAlignPalette }
  if FindWindow(AlignPaletteWindowClass.lpszClassName,NIL) = 0 then
  begin
    RegisterClass(AlignPaletteWindowClass);
    AlignPaletteHWND := CreateWindowEx(0, AlignPaletteWindowClass.lpszClassName,
                                       '', 0, 0, 0, 0, 0, 0, 0, HInstance, NIL);
  end;


finalization

  { TAppBuilder }
  UnregisterClass(AppBuilderWindowClass.lpszClassName, HInstance);
  if AppBuilderHWND <> 0 then
    DestroyWindow(AppBuilderHWND);
  { TPropertyInspector }
  UnregisterClass(PropertyInspectorWindowClass.lpszClassName, HInstance);
  if PropertyInspectorHWND <> 0 then
    DestroyWindow(PropertyInspectorHWND);
  { TAlignPalette }
  UnregisterClass(AlignPaletteWindowClass.lpszClassName, HInstance);
  if AlignPaletteHWND <> 0 then
    DestroyWindow(AlignPaletteHWND);

end.


La franja horaria es GMT +2. Ahora son las 14:23:29.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi