Windows icon: Something you may not know

Source: Internet
Author: User
One day, myProgramIt looks like this in the taskbar application. It is strange that my icons are not like this. In the resource manager folder, my Icons can be displayed normally, and in the taskbar of the desktop, they can also be displayed normally, it is abnormal only in the task manager. Although it is not a big problem, if a product is released, it will make people feel very unprofessional and have a negative impact. This icon is a bit like a program without an icon. It uses the default icon of the system or the icon displayed when the program cannot respond. Application icons are very important UI elements that are displayed in many places. These locations can be divided into two types:
 
 
    • Static display means that the program is not running. For example, in the resource manager folder, desktop shortcut, Start Menu, etc.
    • Dynamic Display is after the program runs. For example, the desktop taskbar, task manager, and program window title bar.
Static display: because the program is not running, the operating system can only obtain the icons of the application from the file information. A Windows program has a resource zone that stores resources in files in binary format, and the EXE executable file is a formatted file with a certain format, windows certainly knows the resource location. It finds the icon resource from the resource and displays it. This function can be implemented using the shgetfileinfo function. If you change any other file, such as the TXT file to the EXE extension, Windows resource manager will try to find the icon resource. Of course, the default icon is displayed, such as the displayed icon. Therefore, many DOS Programs Display the default icons in windows. Dynamic display. The program is running and window messages can be accepted. In addition, the top-level window is displayed in the desktop taskbar and task manager. Different icons and titles can be displayed in each window, so it is impossible to read the file information to obtain the icon display. Obviously, the title can be obtained through getwindowtext across processes. What about the window icon? Window Icons can also be obtained across processes. For example, send wm_geticon to the window and use getclasslong to obtain the window class icon. That is to say, the desktop and Task Manager programs may use these methods to obtain icons for display. That is to say, static display displays application icons, dynamic display, and window icons. My program is not displayed normally in the task manager, it should be that the window icon is not displayed normally. So I tried to check my programs one by using the icon acquisition method that the task manager may use. Wm_geticon messages are generally processed by default and should be okay. Getclasslong is used to obtain window class information, so I checked my window Registration Code No window icon is set. (Because the UI interface library is used and some default window classes are registered in it, no icons are set. In this UI library, all UIS are self-painted, the title bar is not a Windows title bar. It is a self-drawn icon and title, so the window display icon is normal ). After the window icon is added, the task manager is displayed normally. Although it is a small problem, if the train of thought is incorrect, it may take a long time for a veteran with many years of development experience to solve the problem. In particular, the various libraries and frameworks are widely used. Many new users do not even know the registration window class .... In fact, it is worthwhile to take some time to fully understand windows icons. Some technical implementations of Windows icons are still interesting: 1. How is the shortcut implemented? 2. How is the number on the icon implemented? Some programs display a number on the desktop application icon. For example, the software management program will tell you several software updates in this way, and the user experience is very good. 3. How does SVN change the icon? SVN will change the folder. The file icon is to add some information on the original icon, such as the changed and checked out .. 4. New features released by QQ include portraits of people who chat frequently on the desktop. Click QQ to start chatting.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.