Delphi程序API申明调用及参数传址与传值
2013-06-17 21:29
399 查看
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.
相关文章推荐
- Delphi程序流程三(1)(while)PS:顺便写了个最简单的任务管理器(包含申明API 自己申明参数为结构型API 组件LISTVIEW的用法)
- 一个DELPHI程序要调用DLL,而DLL中的函数名,参数个数,参数类型为不定
- C# 调用带有复杂参数的C++ ,delphi dll 注意事项备注。(C++ dll 怎么回调C# 程序,参数怎么写?)
- C# 使用 Environment.GetCommandLineArgs 方法 制作*.exe和参数 供其他程序调用
- 对程序调用API变形的一点认识
- Java 调用新浪微博API int64类型 参数传入方法
- 程序调用飞信API发送免费短信(JAVA例子,其他语言一样用)
- Xcode:如何在调用Mac程序时传递参数
- 调用Java系统API获取当前程序占用内存
- VS2005调用Delphi编写的COM程序
- 关于delphi调用vc编写的dll中参数类型有关问题
- js调用winform程序(带参数)
- IScroll5 中文API参数说明和调用方法
- Delphi调用java开发的WebService,传入参数出错
- Delphi调用VC的类并引用(参数,执行类方法等)
- Delphi中调用C约定不定参数函数的调用方法.
- 函数的参数不一定是要程序传值进去的,它也有可能不用传值,而是作为返回值,比如out
- 如何为外部程序调用时,可传入参数?如何调试?
- Delphi调用外部程序并等待其运行结束
- 如何用Baas快速在腾讯云上开发小程序-系列3 :实现腾讯云COS API调用