How to display window icons on WinCe's taskbar

xiaoxiao2021-03-06  41

Studying the programming under WinCe is still in short, and it is much more likely to write a program under Windows, but Wince is just a subset of Windows, many of the APIs supported under Windows, not supported under Wince. This day, I found my own WinCe program, whether in the task bar, or in the task switch list, only the title defined by the title on the left side of the title, and some of the program you write in Microsoft, there are some When the manufacturer writes, when running, it is displayed in the taskbar and the icon and title text, which is strange, and written several programs yourself, find that Wince Wince SDK, or the MFC program does not display this icon. . Search in the Internet, I don't know if this problem is too simple. The heroes don't charge to express your guidance. On the MSDN, browse the message starting with WM, finally gave me a message: WM_SETICON, look from the name, is the icon. WM_SETICON WPARAM = (wparam) fTYPE; // icon type lparam = (lparam) (HICON) Hicon; // Handle to icon two parameters One is fType, used to specify the large icon or small icon, respectively Icon_big and icon_small are specified; the other is Hicon, which is the handle of the icon, which is generally loaded with loadicon (). Look at the platform supported by this message, Windows CE: Requires Version 1.0 or Later. It seems to support all WinCE systems. The next thing is good, in the callback function of the main window, respond to the WM_CREATE message, add a statement: sendMessage (hwnd, wm_seticon, icon_small, (lparam) loadicon (hinst, (lpctstr) idi_mysmallicon); get it. The third parameter icon_small is displayed on the taskbar. Loadicon () Load icon resources, idi_mismall is the ID of your defined small icon, usually 16 * 16 size. Run the program, look at the taskbar, is it the small icon you defined on the left side of the title?

转载请注明原文地址:https://www.9cbs.com/read-60145.html

New Post(0)