1. Trang chủ
  2. » Giáo Dục - Đào Tạo

107 api intro kho tài liệu training

13 32 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 13
Dung lượng 624,2 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

 Your program lives together with other programs on the same computer.. ◦ Which program gets to read the mouse movements at a specific moment?.  Your program has no direct access to th

Trang 1

Windows API introduction

Assembly language programming

Trang 2

 Your program lives together with other programs on the same computer

 How do the programs get along?

◦ How can more than one program run on the same processor?

◦ Which program gets to read the mouse movements at a specific moment?

◦ Who gets to write to a specific pixel on the screen?

 The operation system has full control over the computer

◦ It shares the resources between the programs

◦ Programs have to send “requests” to the operation system

Trang 3

Operation System

Program 1

monitor mouse keyboard Processor time

Program 2

Memory

Program N …

Trang 4

 Your program has no direct access to the system resources

◦ In the past, programs did have such direct access

 Instead, programs can only communicate with the operation system

 Communication is done using special functions called API functions

◦ API – Application Programming Interface

Trang 5

Operation System

Program

monitor mouse keyboard Processor time

Memory

Trang 6

Operation System

Program

monitor mouse keyboard Processor time

Memory

API

Trang 7

 A set of functions provided by the Windows operation system

◦ Used to communicate with the Windows operation system

 Show up in the form of DLL files

 Follow the STDCALL convention

 Almost every windows program relies on a few API functions

Trang 8

 DLL – Dynamic Link Library

 An executable file (PE) without an entry point

◦ Contains functions

 Other programs can “link” to DLL files

◦ In order to use their functions

 Shared libraries

◦ Only one instance of a DLL is loaded to physical

memory – To save space

Trang 9

 DLLs are loaded to physical memory only once

 One DLL could be used by many different programs at the same time:

Program 1

Kernel32.dll

Program 2

Trang 10

 Not every DLL belongs to the operation system

 You could even create DLLs yourself

 Not every DLL supplies windows API

Trang 11

 kernel32.dll

◦ File systems, Memory management, Processes, Threads, Error handling

 user32.dll

◦ Windows GUI: windows, buttons, mouse and keyboard input etc

 gdi32.dll

◦ Graphics: Outputting to monitors, printers etc

 There are much more

Trang 12

 Microsoft Developer Network (msdn)

◦ Contains full documentation for the windows API

Trang 13

 Programs do not have direct access to the system resources

◦ They have to talk to the operation system

◦ This is done using API function calls

 Windows API access is done by calling

functions inside specific DLL files

the Windows API

Ngày đăng: 17/11/2019, 08:22

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN