Archived

This topic is now archived and is closed to further replies.

Verso

MSVC resources... blehhh

Recommended Posts

I made a little icon and included/compiled it as a resource. It works for the .exe icon, but not the taskbar icon. Help?!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

case WM_CREATE:
TaskBarAddIcon(hwnd, IDI_ICON,
LoadIcon (hInst, MAKEINTRESOURCE(IDI_ICON1)),"NetClip") ;

// MyTaskBarAddIcon - adds an icon to the taskbar status area.
// Returns TRUE if successful, or FALSE otherwise.
// hwnd - handle to the window to receive callback messages.
// uID - identifier of the icon.
// hicon - handle to the icon to add.
// lpszTip - tooltip text.
int TaskBarAddIcon(HWND hwnd, UINT uID, HICON hicon, LPSTR lpszTip)
{
int res;
NOTIFYICONDATA tnid={0};

tnid.cbSize = sizeof(tnid);
tnid.hWnd = hwnd;
tnid.uID = uID;
tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
tnid.uCallbackMessage = MYWM_NOTIFYICON;
tnid.hIcon = hicon;
if (lpszTip)
lstrcpyn(tnid.szTip, lpszTip, sizeof(tnid.szTip));
else
tnid.szTip[0] = ''\0'';
res = Shell_NotifyIcon(NIM_ADD, &tnid);

if (hicon)
DestroyIcon(hicon);

return res;
}

// MyTaskBarDeleteIcon - deletes an icon from the taskbar status area.
// Returns TRUE if successful, or FALSE otherwise.
// hwnd - handle to the window that added the icon.
// uID - identifier of the icon to delete.
int TaskBarDeleteIcon(HWND hwnd, UINT uID)
{
int res;
NOTIFYICONDATA tnid;

tnid.cbSize = sizeof(NOTIFYICONDATA);
tnid.hWnd = hwnd;
tnid.uID = uID;

res = Shell_NotifyIcon(NIM_DELETE, &tnid);
return res;
}



email me if you need help
cloak
ihatetheinternet@hotmail.com

Share this post


Link to post
Share on other sites
Icons like having separate device contexts for certain things (especially different sizes). If you look just over your icon editing screen there should be something that says something like: Device: Standard (32x32) in a combobox. This is your device context. 32x32 is the executable icon size. Use the combobox to change to Small (16x16) and see what it''s using. It''s possible you edited one and not the other.

-fel

Share this post


Link to post
Share on other sites