最近学DELPHI,它调用API需要声明吗,

解决方案 »

  1.   

    Windows单元声明了大部分的Windows API。
      

  2.   

    不用,不过得加入声明api的单元,一般有windows就行了
      

  3.   

    setwindowryn好像不行
    RUN的时候,显示找不到HRYN类型
      

  4.   

    一般的api只要用windows就可以了,其他的请参阅一些资料,一般要用的东东都在/lib文件夹里
      

  5.   

    当然要,API本质上就是都是写在Window自己的一个DLL中,和访问一般的DLL中的函数一样,不过Delphi的一些单元中已经封装(也就是申明了这些函数)这些API
      

  6.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, //只要你看到有这个Windows,就行了。
      

  7.   

    这是从Windows单元摘下来的DLL函数申明:
    function GetThreadTimes; external kernel32 name 'GetThreadTimes';
    function GetTickCount; external kernel32 name 'GetTickCount';
    function GetTimeFormat; external kernel32 name 'GetTimeFormatA';
    function GetTimeFormatA; external kernel32 name 'GetTimeFormatA';
    function GetTimeFormatW; external kernel32 name 'GetTimeFormatW';
    function GetTimeZoneInformation; external kernel32 name 'GetTimeZoneInformation';
    function GetUserDefaultLCID; external kernel32 name 'GetUserDefaultLCID';
    function GetUserDefaultLangID; external kernel32 name 'GetUserDefaultLangID';
    function GetVersion; external kernel32 name 'GetVersion';
    function GetVersionEx; external kernel32 name 'GetVersionExA';
    function GetVersionExA; external kernel32 name 'GetVersionExA';
    function GetVersionExW; external kernel32 name 'GetVersionExW';
      

  8.   

    windows公开函数都不用声明!
    未公开的就难说了!
      

  9.   

    delphi中已有的就不用申明了
    没有的当然就要申明
      

  10.   

    Delphi 中的APi用法是所有工具中最方便的一个,绝大部分都可以直接用
      

  11.   

    不用任何声明!
    所以说“聪明的程序员用Delphi”嘛。:)
      

  12.   

    呵呵 windows.pas 把
    kernel32. user32. 和 GDI32 (好像是这三个)
    的绝大多数(99%)API均申明啦!