API (Application Programming Interface) is a set of commands, which interfaces the programs with the processors. The most commonly used set of external procedures are those that make up Microsoft Windows itself. The Windows API contains thousands of functions, structures, and constants that you can declare and use in your projects. Those functions are written in the C language, however, so they must be declared before you can use them. The declarations for DLL procedures can become fairly complex. Specifically to C# it is more complex than VB. You can use API viewer tool to get API function declaration but you have to keep in mind the type of parameter which is different in C#. API(應用編程介面)是程式與處理器介面的命令集。最常用的就是在外部調用微軟WINDOWS內部的進程。WINDOWS API包括成千的你可以使用的函數、結構、常量。這些函數是用C語言寫的,在使用他們之前,你必須聲明。 定義Dll的進程將相當的複雜,甚至比VB還複雜。你可以使用API Viewer工具得到API函數的聲明,但是必須注意的是,它的參數類型跟C#的不一樣。 Most of the advanced languages support API programming. The Microsoft Foundation Class Library (MFC) framework encapsulates a large portion of the Win32 (API). ODBC API Functions are useful for performing fast operations on database. With API your application can request lower-level services to perform on computer's operating system. As API supports thousands of functionality from simple Message Box to Encryption or Remote computing, developers should know how to implement API in their program. 大部分的進階語言都支援API,微軟函數類庫(MFC)封裝了大部分的Win32 API。ODBC API對提高資料庫的操作速度大有好處。使用API,可以請求更底層的系統服務。API從簡單的對話方塊到複雜的加密運算都提供支援。開發人員應該知道如何在他們程式中使用API API has many types depending on OS, processor and functionality. API有許多類型,(針對不同的作業系統、處理器…………) OS specific API:作業系統特有API: Each operating system has common set of API's and some special e.g. Windows NT supports MS-DOS, Win16, Win32, POSIX (Portable Operating System Interface), OS/2 console API and Windows 95 supports MS-DOS, Win16 and Win32 APIs, 每種作業系統都有一套公用API和專有API。比如:Windows NT 支援MS-DOS, Win16, Win32, POSIX (攜帶型作業系統介面),OS/2 console API ;同時Windows 95 supports MS-DOS, Win16 和Win32 API。 Win16 和 Win32 API:Win16 is an API created for 16-bit processor and relies on 16 bit values. It has platform independent nature e.g. you can tie Win16 programs to MS-DOS feature like TSR programs. WIN16 是基於16位的處理器,並使用16位的值,它是一個獨立的平台。比如:你可以運行TSR 程式在MS-DOS環境下。 Win32 is an API created for 32-bit processor and relies on 32 bit values. It is portable to any operating system, wide range of processors and platform independent nature. WIN32 是基於32位的處理器,並使用32位的值。他可用於任何作業系統,它的使用範圍更廣。 Win32 API has 32 prefix after the library name e.g. KERNEL32, USER32 etc? Win32 API的DLL一般都具有32的尾碼,比如:KERNEL32, USER32等。 All APIs are implemented using 3 Libraries. 所有的API都在下面3個DLL中實現的。
|