tailieunhanh - Lecture Computer organization and assembly language - Lecture 29: Win32 console programming-02
In this lecture, students will be able to understand: Win32 API Functions that create, read, and write to files; console window manipulation functions; time and date functions; graphical window functions. | CSC 221 Computer Organization and Assembly Language Lecture 29: Win32 Console Programming-02 Lecture 28: Review Macros Introducing Macros Defining Macros Invoking Macros Windows 32 Console Programming Background Information Win32 Console Programs API and SDK Windows Data Types Standard Console Handles Console Input Console Output Lecture Outline Win32 API Functions that create, read, and write to files: CreateFile ReadFile WriteFile SetFilePointer Console Window Manipulation Functions Screen buffer Console window Controlling the cursor Controlling the text color Lecture Outline Time and Date Functions GetLocalTime, SetLocalTime GetTickCount, Sleep GetDateTime SYSTEMTIME Structure Creating a Stopwatch Timer Graphical Window Functions POINT, RECT Structures MSGStruct, WNDCLASS Structures MessageBox Function WinMain, WinProc Procedures (cont.) File Manipulation Win32 API Functions that create, read, and write to files: CreateFile ReadFile WriteFile SetFilePointer CreateFile (1 of 5) . | CSC 221 Computer Organization and Assembly Language Lecture 29: Win32 Console Programming-02 Lecture 28: Review Macros Introducing Macros Defining Macros Invoking Macros Windows 32 Console Programming Background Information Win32 Console Programs API and SDK Windows Data Types Standard Console Handles Console Input Console Output Lecture Outline Win32 API Functions that create, read, and write to files: CreateFile ReadFile WriteFile SetFilePointer Console Window Manipulation Functions Screen buffer Console window Controlling the cursor Controlling the text color Lecture Outline Time and Date Functions GetLocalTime, SetLocalTime GetTickCount, Sleep GetDateTime SYSTEMTIME Structure Creating a Stopwatch Timer Graphical Window Functions POINT, RECT Structures MSGStruct, WNDCLASS Structures MessageBox Function WinMain, WinProc Procedures (cont.) File Manipulation Win32 API Functions that create, read, and write to files: CreateFile ReadFile WriteFile SetFilePointer CreateFile (1 of 5) CreateFile either creates a new file or opens an existing file. If successful, it returns a handle to the open file; otherwise, it returns a special constant named INVALID_HANDLE_VALUE. Prototype: CreateFile PROTO, pFilename:PTR BYTE, ; ptr to filename desiredAccess:DWORD, ; access mode shareMode:DWORD, ; share mode lpSecurity:DWORD, ; ptr to security attribs creationDisposition:DWORD, ; file creation options flagsAndAttributes:DWORD, ; file attributes htemplate:DWORD ; handle to template file If the file was created successfully, EAX contains a valid file handle. CreateFile (2 of 5) Parameter Description lpFileName Points to a null-terminated string containing either a partial or fully qualified filename (drive:\path\filename). dwDesiredAccess Specifies how the file will be accessed (reading or writing). dwShareMode Controls the ability for multiple programs to access the file while it is open. lpSecurityAttributes Points to a security structure controlling security rights. .
đang nạp các trang xem trước