Thread In Taskleiste verschwinden lassen (44 answers)
Opened by Froschpopo at 2005-04-04 23:59

zipster
 2005-04-22 09:56
#43218 #43218
User since
2004-09-06
458 Artikel
BenutzerIn
[default_avatar]
Das Win32::Gui Fenster siehst du doch garnicht.
Und Tk-Fenster müßtest du damit auch steuern könne.

Ich habe das ja auch benutzt um Dienste zu starten usw.

Sei doch froh das so etwas überhaupt in Perl geht.

/Edit
Was auch noch ne Lösung wäre, wenn du es mit Win32::API machst. Damit müßte man eigentlich auch ein TrayIcon erstellen können

/nochmal EDIT
;)

Ich war mal so frei und hab in der Win32 Programmer's Reference nachgeschaut wie die API funktion lautet.


Quote
You add an icon to the taskbar status area by filling a NOTIFYICONDATA structure and then sending the structure through the NIM_ADD message. The structure members must specify the handle of the window that is adding the icon, as well as the icon identifier and icon handle. You can also specify ToolTip text for the icon. If you need to receive mouse messages for the icon, specify the identifier of the callback message that the system should use to send the message to the window procedure.

The function in the following example demonstrates how to add an icon to the taskbar.
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// MyTaskBarAddIcon - adds an icon to the taskbar status area.  
// Returns TRUE if successful or FALSE otherwise.
// hwnd - handle of the window to receive callback messages
// uID - identifier of the icon
// hicon - handle of the icon to add
// lpszTip - ToolTip text
BOOL MyTaskBarAddIcon(HWND hwnd, UINT uID, HICON hicon, LPSTR lpszTip)
{
BOOL res;
NOTIFYICONDATA tnid;

tnid.cbSize = sizeof(NOTIFYICONDATA);
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;
}


To delete an icon from the taskbar status area, fill a NOTIFYICONDATA structure and send it to the system when you send a NIM_DELETE message. When deleting a taskbar icon, specify only the cbSize, hWnd, and uID members, as the following example shows.
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// MyTaskBarDeleteIcon - deletes an icon from the taskbar  
// status area.
// Returns TRUE if successful or FALSE otherwise.
// hwnd - handle of the window that added the icon
// uID - identifier of the icon to delete
BOOL MyTaskBarDeleteIcon(HWND hwnd, UINT uID)
{
BOOL res;
NOTIFYICONDATA tnid;

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

res = Shell_NotifyIcon(NIM_DELETE, &tnid);

return res;
}


Aber ich denke nicht das sich der Aufwand lohnt es per Win32::API zumachen.

Versuch lieber per Win32::Gui auf TK zuzugreifen\n\n

<!--EDIT|zipster|1114150595-->

View full thread In Taskleiste verschwinden lassen