WinAPI WinMessage
WinAPI WinMessage
WINDOWS
PROGRAMMING
Dương Xuân Hiệp
Email: [email protected]
MVS
11/21/2023 Windows Programming 2
Content
o Windows API
o What is API ?
o Windows API
o Windows Messages
o Events
Content
o MFC Programming
o Programming Interface
o Example
- Dialog example
- Menu example
- Message example
o Homework
11/21/2023 Windows Programming 4
What is API ?
What is API ?
Windows API
Windows API
Windows API
11/21/2023 Windows Programming 12
Windows Messages
A GUI application must respond to events from the user
and from the operating system.
• Events from the user include all of the ways that
someone can interact with your program: mouse clicks,
key strokes, touch-screen gestures, and so forth
Windows Messages
11/21/2023 Windows Programming 14
Windows Messages
• A message is simply a numeric code that designates a
particular event. For example, if the user presses the left
mouse button, the window receives a message with the
following message code
MFC Programming
• An MFC program is an executable application for
Windows that is based on the Microsoft Foundation Class
(MFC) Library.
MFC Programming
• Programming Interface
11/21/2023 Windows Programming 18
MFC Programming
• Message example
11/21/2023 Windows Programming 19
MFC Programming
• Menu example
11/21/2023 Windows Programming 20
Homework
• 1. Xây dựng một main dialogue
như sau:
• Có thanh Menu
• Quản lý các bạn theo từng
nhóm
• Có avatar
• Hiển thị status ứng với mỗi bạn
( sử dụng MFC )
11/21/2023 Windows Programming 21
Homework
• 2. Xây dựng giao diện cho phép Add/Block Friend
(Giao diện tùy ý)
( sử dụng MFC )
11/21/2023 Windows Programming 22
Homework
• 3. Xây dựng giao diện chat như hình. ( sử dụng MFC )
• - Thực hiện được việc tự chat và hiển thị lên dialog của
mình. ( có avatar )
- Thực hiện việc chat giữa 2 người ( sử dụng Windows
Message).
- Chat sử dụng Emotion.
11/21/2023 Windows Programming 23
Homework
• Các yêu cầu khác:
• Quản lý danh sách friend/block của mỗi người theo database ( Đã
học )
• Quản lý Message ( tin nhắn đã nhận hoặc lịch sử chat phải được
lưu lại vào database)
• Thời hạn: 23/11/2015 – 04/12/2015
• Tham khảo:
• www.google.com
• MFC examples:
https://msdn.microsoft.com/en-us/library/482ck6x8(v=vs.90).aspx
11/21/2023 Windows Programming 24