AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Looking 4 help

Ein Thema von Mr.Sade · begonnen am 25. Feb 2003 · letzter Beitrag vom 27. Feb 2003
 
Mr.Sade

Registriert seit: 25. Feb 2003
17 Beiträge
 
Delphi 6 Enterprise
 
#8
  Alt 27. Feb 2003, 18:48
Hello people

I think all is working now.
I haven't try it with delphi, because I am at school right now,
but I will do it later, when I get home.
I have ported my delphi code to assembly language, MASM32
and I have change some parts and it works good

the parts that I changed are:
Delphi-Quellcode:
procedure NotepadCreated(Handle: HWND);
var
  OldPtr: Integer;
begin
  { invoke  SetWindowLong, Handle, GWL_WNDPROC, ADDR NotepadProc
    invoke  SetWindowLong, Handle, GWL_USERDATA, eax  }


  { lets subclass it and assign pointer }
  OldPtr := SetWindowLong(Handle, GWL_WNDPROC, Integer(@NotepadProc));
  SetWindowLong(Handle, GWL_USERDATA, OldPtr);
end;
and when cleaning everything:
Delphi-Quellcode:
{ EnumWins proc Handle:DWORD, lParam:LPARAM
    invoke  RtlZeroMemory, ADDR Buffer, 256
    invoke  GetClassName, Handle, ADDR Buffer, 256
    invoke  lstrcmpi, ADDR Buffer, ADDR Notepad
    .IF eax == 0
        invoke  SendMessage, Handle, WM_STOPSUBCLASSING, 0, 0
    .ENDIF
    mov    eax, TRUE
    ret
EnumWins endp }

function EnumWins(Handle: HWND; lParam: LPARAM): Boolean;
    stdcall;
var
  szClass: array [0..256] of Char;
begin
  ZeroMemory(@szClass, 256);
  GetClassName(Handle, szClass, 256);
  if szClass = 'Notepadthen
    SendMessage(Handle, WM_STOPSUBCLASSING, 0, 0);
  Result := True;
end;

Inside NotepadWndProc:
Delphi-Quellcode:
  { Msg == WM_STOPSUBCLASSING
      invoke  GetWindowLong, Handle, GWL_USERDATA
      invoke  SetWindowLong, Handle, GWL_WNDPROC, eax  }

  WM_STOPSUBCLASSING:
  begin
    OldPtr := GetWindowLong(Handle, GWL_USERDATA);
    SetWindowLong(Handle, GWL_WNDPROC, OldPtr);
  end;

so if it works with MASM, it should work with Delphi6
Thank You for your time
Mr.Sade
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:28 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz