zoukankan      html  css  js  c++  java
  • Delphi程序API申明调用及参数传址与传值

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
    
    type
      TForm1 = class(TForm)
        btn1: TButton;
        procedure apitest(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    function MB(hWnd: Integer; lpText, lpCaption: string; uType: Integer): Integer;
    stdcall; external 'user32.dll' name 'MessageBoxA';
    
    function FW(ClassName, WindowName: string ): Integer;
    stdcall; external 'user32.dll' name 'FindWindowA';
    
    function getthpid(jubing:Integer;var lpid: Integer ): Integer;
    stdcall; external 'user32.dll' name 'GetWindowThreadProcessId';
    {$R *.dfm}
    
    procedure TForm1.apitest(Sender: TObject);
    var i,pid:Integer;
    begin
        MB(0,'HellO WorlD','Shellcode的博客',0);
        i:=FW('扫雷','扫雷');
        getthpid(i,pid);
        ShowMessage(IntToStr(pid));
        GetWindowThreadProcessId(i,@pid);
        ShowMessage(IntToStr(pid));
    end;
    
    end.
  • 相关阅读:
    前端调用后台接口下载word文档的两种方法
    Layui form表单提交注意事项
    JavaScript_Util_01
    心理
    小例子
    SQL分割字符串
    绘制10种不同颜色的散点图
    绘制散点图
    subplot的使用
    绘制正弦余弦
  • 原文地址:https://www.cnblogs.com/qq32175822/p/3141142.html
Copyright © 2011-2022 走看看