Mercurial > dwindows
changeset 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 | 3bc712d2c362 |
children | 6aa93935d2c7 |
files | dw.h dwtest.c gtk/dw.c os2/dw.c win/dw.c |
diffstat | 5 files changed, 93 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/dw.h Sun Oct 19 07:15:37 2003 +0000 +++ b/dw.h Sat Nov 08 15:30:19 2003 +0000 @@ -992,6 +992,8 @@ int API dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count); void API dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data); void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon); +void dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext); +void dw_taskbar_delete(HWND handle, unsigned long icon); int API dw_screen_width(void); int API dw_screen_height(void); unsigned long API dw_color_depth(void);
--- a/dwtest.c Sun Oct 19 07:15:37 2003 +0000 +++ b/dwtest.c Sat Nov 08 15:30:19 2003 +0000 @@ -326,7 +326,7 @@ int DWSIGNAL browse_callback(HWND window, void *data) { char *tmp; - tmp = dw_file_browse("test string", NULL, "c", DW_FILE_OPEN ); + tmp = dw_file_browse("test string", NULL, "c", DW_DIRECTORY_OPEN ); if ( tmp ) { if ( current_file )
--- a/gtk/dw.c Sun Oct 19 07:15:37 2003 +0000 +++ b/gtk/dw.c Sat Nov 08 15:30:19 2003 +0000 @@ -5474,6 +5474,29 @@ } /* + * Inserts an icon into the taskbar. + * Parameters: + * handle: Window handle that will handle taskbar icon messages. + * icon: Icon handle to display in the taskbar. + * bubbletext: Text to show when the mouse is above the icon. + */ +void dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext) +{ + /* TODO */ +} + +/* + * Deletes an icon from the taskbar. + * Parameters: + * handle: Window handle that was used with dw_taskbar_insert(). + * icon: Icon handle that was used with dw_taskbar_insert(). + */ +void dw_taskbar_delete(HWND handle, unsigned long icon) +{ + /* TODO */ +} + +/* * Creates a rendering context widget (window) to be packed. * Parameters: * id: An id to be used with dw_window_from_id.
--- a/os2/dw.c Sun Oct 19 07:15:37 2003 +0000 +++ b/os2/dw.c Sat Nov 08 15:30:19 2003 +0000 @@ -6943,6 +6943,29 @@ } /* + * Inserts an icon into the taskbar. + * Parameters: + * handle: Window handle that will handle taskbar icon messages. + * icon: Icon handle to display in the taskbar. + * bubbletext: Text to show when the mouse is above the icon. + */ +void dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext) +{ + /* TODO */ +} + +/* + * Deletes an icon from the taskbar. + * Parameters: + * handle: Window handle that was used with dw_taskbar_insert(). + * icon: Icon handle that was used with dw_taskbar_insert(). + */ +void dw_taskbar_delete(HWND handle, unsigned long icon) +{ + /* TODO */ +} + +/* * Creates a rendering context widget (window) to be packed. * Parameters: * id: An id to be used with dw_window_from_id.
--- a/win/dw.c Sun Oct 19 07:15:37 2003 +0000 +++ b/win/dw.c Sat Nov 08 15:30:19 2003 +0000 @@ -1413,6 +1413,8 @@ msg = WM_VSCROLL; else if(msg == WM_KEYDOWN) /* && mp1 >= VK_F1 && mp1 <= VK_F24) allow ALL special keys */ msg = WM_CHAR; + else if(msg == WM_USER+2) + msg = (UINT)mp2; if(result == -1) { @@ -6969,6 +6971,48 @@ } /* + * Inserts an icon into the taskbar. + * Parameters: + * handle: Window handle that will handle taskbar icon messages. + * icon: Icon handle to display in the taskbar. + * bubbletext: Text to show when the mouse is above the icon. + */ +void dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext) +{ + NOTIFYICONDATA tnid; + + tnid.cbSize = sizeof(NOTIFYICONDATA); + tnid.hWnd = handle; + tnid.uID = icon; + tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; + tnid.uCallbackMessage = WM_USER+2; + tnid.hIcon = (HICON)icon; + if(bubbletext) + strncpy(tnid.szTip, bubbletext, sizeof(tnid.szTip)); + else + tnid.szTip[0] = 0; + + Shell_NotifyIcon(NIM_ADD, &tnid); +} + +/* + * Deletes an icon from the taskbar. + * Parameters: + * handle: Window handle that was used with dw_taskbar_insert(). + * icon: Icon handle that was used with dw_taskbar_insert(). + */ +void dw_taskbar_delete(HWND handle, unsigned long icon) +{ + NOTIFYICONDATA tnid; + + tnid.cbSize = sizeof(NOTIFYICONDATA); + tnid.hWnd = handle; + tnid.uID = icon; + + Shell_NotifyIcon(NIM_DELETE, &tnid); +} + +/* * Creates a rendering context widget (window) to be packed. * Parameters: * id: An id to be used with dw_window_from_id.