Hello again! So this is mostly something for fellow eVB programmers to play with. This is a module and accompanying example project that enables your eVB program to have an icon in the CE taskbar.
Usage is very simple, just add the module and an ImageList to your project and add the image
(s
) to the ImageList as per normal. Add a form-level variable to hold the icon
(s
), and then call the
TaskbarIcon_Let function from
Form_Load or anytime you want to change the icon. When your application ends, make sure to call
TaskbarIcon_Destroy specifying the variables you created to hold the icons to allow Windows to free them from memory.
A complete application could look like this:
Option Explicit
Private LargeIcon As Long
Private SmallIcon As Long
Private Sub Form_Load()
ImageList.Add "icon_small.bmp"
ImageList.Add "icon_large.bmp"
SmallIcon = TaskbarIcon_Let(hwnd, ImageList.hImageList, 0, tbSmallIcon)
LargeIcon = TaskbarIcon_Let(hwnd, ImageList.hImageList, 1, tbLargeIcon)
End Sub
Private Sub Form_Unload(Cancel As Integer)
TaskbarIcon_Destroy LargeIcon
TaskbarIcon_Destroy SmallIcon
End Sub
Currently this is bound to the same limitations as other icons represented by the eVB ImageList, most notably, transparency is not allowed. I am however working on a lightweight ImageList replacement to hopefully solve these issues.
I have attached a screenshot of the example application with the icon visible in the taskbar.
Links:
GitHub RepoEdited by WinCEDev 2023-02-10 10:57 PM
(CAPT0000.png) Attachments
----------------
CAPT0000.png (2KB - 1 downloads)