1. If you want to write your own general information manager, write a system tray,
2. For future convenience, the shell_policyicon API is encapsulated in a class and a hidden window is added to receive the callback message of the tray,
I didn't want to generate a custom window.
A class inherited from cwnd cannot be used as its create function. It is an encapsulation of sub-Windows, so createex is used, but this requires the system to register wndclass for the window class, I wanted to use the simplest MFC to encapsulate afxregisterwndclass, but I wanted to review the win api. After all, I did not write anything for two years. CodeBut failed all the time. After tracking, createmediawex always returns 0, but getlasterror is always 0, which makes me angry. So the simplest and safest afxregisterwndclass is still a failure, angry, This is not bullying. I haven't written code for a long time,
Another check, day, I overwrote the windowproc of cwnd, and thought, it must be a bit famous here. Before the window is generated, the message will still respond to several messages. Sure enough, rewrite it to the default windowproc. Everything is OK,
It's really a tiger's ass. Essay, in order to make such a mistake later.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.