Mercurial > dwindows
comparison win/dw.c @ 487:d6e07d292145
Implemented taskbar icons on windows, so I can keep feature for feature
with InJoy Firewall.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 08 Nov 2003 15:30:19 +0000 |
parents | 97c2c560f829 |
children | a9a09514dd56 |
comparison
equal
deleted
inserted
replaced
486:3bc712d2c362 | 487:d6e07d292145 |
---|---|
1411 msg = WM_LBUTTONUP; | 1411 msg = WM_LBUTTONUP; |
1412 else if(msg == WM_HSCROLL) | 1412 else if(msg == WM_HSCROLL) |
1413 msg = WM_VSCROLL; | 1413 msg = WM_VSCROLL; |
1414 else if(msg == WM_KEYDOWN) /* && mp1 >= VK_F1 && mp1 <= VK_F24) allow ALL special keys */ | 1414 else if(msg == WM_KEYDOWN) /* && mp1 >= VK_F1 && mp1 <= VK_F24) allow ALL special keys */ |
1415 msg = WM_CHAR; | 1415 msg = WM_CHAR; |
1416 else if(msg == WM_USER+2) | |
1417 msg = (UINT)mp2; | |
1416 | 1418 |
1417 if(result == -1) | 1419 if(result == -1) |
1418 { | 1420 { |
1419 /* Avoid infinite recursion */ | 1421 /* Avoid infinite recursion */ |
1420 command_active = 1; | 1422 command_active = 1; |
6967 free(text); | 6969 free(text); |
6968 } | 6970 } |
6969 } | 6971 } |
6970 | 6972 |
6971 /* | 6973 /* |
6974 * Inserts an icon into the taskbar. | |
6975 * Parameters: | |
6976 * handle: Window handle that will handle taskbar icon messages. | |
6977 * icon: Icon handle to display in the taskbar. | |
6978 * bubbletext: Text to show when the mouse is above the icon. | |
6979 */ | |
6980 void dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext) | |
6981 { | |
6982 NOTIFYICONDATA tnid; | |
6983 | |
6984 tnid.cbSize = sizeof(NOTIFYICONDATA); | |
6985 tnid.hWnd = handle; | |
6986 tnid.uID = icon; | |
6987 tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; | |
6988 tnid.uCallbackMessage = WM_USER+2; | |
6989 tnid.hIcon = (HICON)icon; | |
6990 if(bubbletext) | |
6991 strncpy(tnid.szTip, bubbletext, sizeof(tnid.szTip)); | |
6992 else | |
6993 tnid.szTip[0] = 0; | |
6994 | |
6995 Shell_NotifyIcon(NIM_ADD, &tnid); | |
6996 } | |
6997 | |
6998 /* | |
6999 * Deletes an icon from the taskbar. | |
7000 * Parameters: | |
7001 * handle: Window handle that was used with dw_taskbar_insert(). | |
7002 * icon: Icon handle that was used with dw_taskbar_insert(). | |
7003 */ | |
7004 void dw_taskbar_delete(HWND handle, unsigned long icon) | |
7005 { | |
7006 NOTIFYICONDATA tnid; | |
7007 | |
7008 tnid.cbSize = sizeof(NOTIFYICONDATA); | |
7009 tnid.hWnd = handle; | |
7010 tnid.uID = icon; | |
7011 | |
7012 Shell_NotifyIcon(NIM_DELETE, &tnid); | |
7013 } | |
7014 | |
7015 /* | |
6972 * Creates a rendering context widget (window) to be packed. | 7016 * Creates a rendering context widget (window) to be packed. |
6973 * Parameters: | 7017 * Parameters: |
6974 * id: An id to be used with dw_window_from_id. | 7018 * id: An id to be used with dw_window_from_id. |
6975 * Returns: | 7019 * Returns: |
6976 * A handle to the widget or NULL on failure. | 7020 * A handle to the widget or NULL on failure. |