Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

MouseMove and rad sa dll-ovima

[es] :: Pascal / Delphi / Kylix :: MouseMove and rad sa dll-ovima

[ Pregleda: 2100 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

borovac
127.0.0.1

Član broj: 29278
Poruke: 220
*.as54.ze.bih.net.ba.



Profil

icon MouseMove and rad sa dll-ovima05.10.2004. u 19:49 - pre 237 meseci
1. Kako pomjeriti kursor miša na 320x445?

2. Kako znati koje funkcije podržava neki dll fajl?

3. Kako pozvati neku funkciju iz nekog dll-a?
 
Odgovor na temu

reiser

Član broj: 7895
Poruke: 2314



+102 Profil

icon Re: MouseMove and rad sa dll-ovima05.10.2004. u 19:59 - pre 237 meseci
1.
Code:
SetCursorPos(320, 445)


2. Dupli klik na neki DLL, otvori ti se Dependency Walker i vidis sve exportovane funkcije/procedure

3.
Code:
procedure MyProcedure; external 'SomeDLL.dll' name 'DLLProcedure';

I posle toga kad u kodu pozoves MyProcedure;, ti u stvari pozivas DLLProcedure iz SomeDLL.dll.
 
Odgovor na temu

borovac
127.0.0.1

Član broj: 29278
Poruke: 220
*.as54.ze.bih.net.ba.



Profil

icon Re: MouseMove and rad sa dll-ovima05.10.2004. u 20:04 - pre 237 meseci
2. Mislio sam kako dobiti nazive tih funkcija putem Delphi-a.
 
Odgovor na temu

reiser

Član broj: 7895
Poruke: 2314



+102 Profil

icon Re: MouseMove and rad sa dll-ovima05.10.2004. u 20:15 - pre 237 meseci
Code:

uses
  Forms,
  Classes,
  SysUtils,
  Dialogs,
  ImageHlp, // routines to access debug information
  Windows;

// by Dmitry Streblechenko
procedure ListDLLFunctions(DLLName: String; List: TStrings);
type
  chararr = array [0..$FFFFFF] of Char;
  var
  H: THandle;
  I,
  fc: integer;
  st: string;
  arr: Pointer;
  ImageDebugInformation: PImageDebugInformation;
begin
  List.Clear;
  DLLName := ExpandFileName(DLLName);
  if FileExists(DLLName) then
  begin
    H := CreateFile(PChar(DLLName), GENERIC_READ, FILE_SHARE_READ or
      FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    if H<>INVALID_HANDLE_VALUE then
      try
        ImageDebugInformation := MapDebugInformation(H, PChar(DLLName), nil, 0);
        if ImageDebugInformation<>nil then
          try
            arr := ImageDebugInformation^.ExportedNames;
            fc := 0;
            for I := 0 to ImageDebugInformation^.ExportedNamesSize - 1 do
              if chararr(arr^)[I]=#0 then
              begin
                st := PChar(@chararr(arr^)[fc]);
                if Length(st)>0 then
                  List.Add(st);
                if (I>0) and (chararr(arr^)[I-1]=#0) then
                  Break;
                fc := I + 1
              end
          finally
            UnmapDebugInformation(ImageDebugInformation)
          end
      finally
        CloseHandle(H)
      end
  end
end;

// the following is an example how to use the procedure
var
  List: TStrings;
  I: integer;
  S: String;

begin
  List := TStringList.Create;

  ListDLLFunctions('c:\winnt\system32\mfc42.dll', List);

  S := 'List of functions';
  for I := 0 to List.Count - 1 do
    S := S + #13#10 + List[I];
  ShowMessage(S);
  List.Free
end.


http://delphifaq.com/fq/q2133.shtml
 
Odgovor na temu

borovac
127.0.0.1

Član broj: 29278
Poruke: 220
*.as54.ze.bih.net.ba.



Profil

icon Re: MouseMove and rad sa dll-ovima06.10.2004. u 20:09 - pre 237 meseci
Hvala.
 
Odgovor na temu

[es] :: Pascal / Delphi / Kylix :: MouseMove and rad sa dll-ovima

[ Pregleda: 2100 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.