 |
|
 |
Error 1 error C3867: 'CBalloonHelp::KeyboardHookProc': function call missing argument list; use '&CBalloonHelp::KeyboardHookProc' to create a pointer to member c:\downloads\ctrayiconposition_src\balloonhelp.cpp 205
Error 2 error C3867: 'CBalloonHelp::MouseHookProc': function call missing argument list; use '&CBalloonHelp::MouseHookProc' to create a pointer to member c:\downloads\ctrayiconposition_src\balloonhelp.cpp 206
Error 3 error C3867: 'CBalloonHelp::CallWndRetProc': function call missing argument list; use '&CBalloonHelp::CallWndRetProc' to create a pointer to member c:\downloads\ctrayiconposition_src\balloonhelp.cpp 207
Error 4 error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CBalloonHelp::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)' c:\downloads\ctrayiconposition_src\balloonhelp.cpp 1085
Any ideas?
"The true sign of intelligence is not knowledge but imagination." - Albert Einstein
|
|
|
|
 |
|
 |
I know this is several years too late, but for future reference and as a general comment, why not do what the error messages tell you to?
For errors 1-3 change the signature of the calls
In the case of error 4, change the return value from UINT to LRESULT
--
http://www.coruscant.co.uk/
|
|
|
|
 |
|
 |
Just change the statement
KeyboardHookProc
MouseHookProc
CallWndRetProc
to
&CBalloonHelp::KeyboardHookProc
&CBalloonHelp::MouseHookProc
&CBalloonHelp::CallWndRetProc
World is vivid!
|
|
|
|
 |
|
|
 |
|
 |
how to delete the trayicon started by another app.
I only have the Trayicon App's HWND, and i do not know its uid and callback function ect...
can anyone help me for deleting the trayicon by using my own App.? i appreciate for
if it is deleted, how to restore the trayicon just being deleted
I know the MSN plug-in can hide the trayicon and the windows of the MSN.
It really convenience that officer can use this to hide the MSN when the manager coming when they're using MSN to contact with friends.(because the manager thought MSN was a waste of working time)
I thought [ShellRegisterCallbacks] could do this.
Using this callback function can forward the [Shell_NotifyIcon] function to a custom shell.
But this way can only work when the MSN runs after the app, I don't know how to do this when the MSN has already run.
hi
|
|
|
|
 |
|
|
 |
|
 |
I suspect you can. You need just to pass a valid HWND of window that created an icon and the icon id (so this class could be modified to do the trick).
Cheers!
Check out my software at: http://www.ireksoftware.com
|
|
|
|
 |
|
 |
Hi,
I am facing one problem: In my application I want to delete my printer Queue document. I am able to delete successfully. \
Now my problem is, the system Tray Icon's tool tip text is not updating the status. it is showing some document is pending in the printer queue.
So I am planning to delete/refresh the printer Icon from the system tray, if any one could help in this then it will be great!...
My mail ID Sebastin_saji@hotmail.com
T.Sebastin.T
|
|
|
|
 |
|
|
 |
|
 |
yeah, any .net language would be great... Have u tried yet Peter?
All your source are belong to us!
|
|
|
|
 |
|
 |
Some months ago I had ported about 80% of the code to C# (using both managed and p/invoke calls). Things came up and so I never got around to finishing it. I will see what I can do and post and article on it sometime in the future.
|
|
|
|
 |
|
 |
Hello,
First, excuse my bad english (it's not my native language, I'm French).
Then, I'm a studient and I have to create a programm which could hide/unhide any icons in the systray (even extern processes' icons) in VB or in C/C++. Do you know a way to do it?
|
|
|
|
 |
|
 |
:(How to enumerate the icons in the Systray???And How to Get the programe who founds the button in systray? for instance,sound Icon and its button,who founds them??? how to get?
|
|
|
|
 |
|
 |
I can suggest one more approach (not perfect, but worth considering, I think).
Having found the tray window you can send WM_MOUSEMOVE to it with different coordinates trying to guess the icon location. As soon the message is forwarded to your application (wrapped in the message specified when calling Shell_NotifyIcon) you have found it.
Regards,
Sergei.
|
|
|
|
 |
|
|
 |
|
 |
Oops! Sorry, somehow I have missed that part.
|
|
|
|
 |
|
 |
Thanks to the article,I acquired some knowledges from this.but I have a problem:how to get the tip of the icon in the system tray, and how to get the index of the certain icon in the system tray?
|
|
|
|
 |
|
 |
if the taskbar is hided the arrow of the balloontip appears outside screen, and it should call the taskbar up, like any normal infotips displayed in the taskbar (eg. see how the XP SP2 security warning does). This ballon instead points to the outside of the screen and it's not painted entirely.
otherwise it's a great control.
|
|
|
|
 |
|
 |
I would like to force my tray icon to be always the first in tray.
How can I achieve that ?
|
|
|
|
 |
|
 |
you can modify a direct traking metchod to check if your icon is the first in the toolbar and when it's not - just remove it and then add again - It will land at the first position.
Check out my software at: http://www.ireksoftware.com
|
|
|
|
 |
|
 |
Sounds like a race condition if 2 apps starts doing this
- thomasa88
|
|
|
|
 |
|
 |
Does anyone know if there is an official mechanism (or have unofficial ideas;)) to keep a tray icon active so that Windows XP does not "hide" the inactive icon? I assume that by updating the icon periodically, I can keep it "active", but that seems inefficient.
Thanks,
Dave
|
|
|
|
 |
|
 |
If you use a custom dpi in your display settings, say 120 then the code will always fail because windows will scale the icon in the tray area.
|
|
|
|
 |
|
 |
Hmmm... my display settings are actually "big fonts" (120 dpi) and it seems to work perfect.
Scaling the icon is not a problem for this code since plain black icon scaled to be larger will also be a black icon.
Check out my software at: http://www.ireksoftware.com
|
|
|
|
 |
|
 |
That was the only reason i could come up with for it not working on my Win XP system. the only other variable is that I have the task bar at the top of the screen. Anyway I've worked out a way to do the same, without any image processing, See below.
The codes is in vb6 but you should be able to easily convert it. The call to GethWndTray (which gets the tray's toolbar control has been ommited for compactness.
Private Type TrayData
hWnd As Long
ID As Long
End Type
Public Function GetSystemTrayItemRect(ByVal hWnd As Long, ByVal ID As Long) As RECT
Dim hWndTray As Long
Dim hProc As Long
Dim pid As Long
Dim vaPtr As Long
Dim ret As Long
Dim tbut As TBBUTTON
Dim cButtons As Long
Dim td As TrayData
Dim i As Long
Dim rc As RECT
hWndTray = GethWndTray
If hWndTray = 0 Then Exit Function
Call GetWindowThreadProcessId(hWndTray, pid)
If pid = 0 Then Exit Function
hProc = OpenProcess(PROCESS_VM, 0, pid)
If hProc = 0 Then Exit Function
vaPtr = VirtualAllocEx(hProc, ByVal 0&, Len(tbut), MEM_COMMIT, PAGE_READWRITE)
If vaPtr = 0 Then GoTo cleanup
cButtons = SendMessage(hWndTray, TB_BUTTONCOUNT, ByVal 0&, ByVal 0&)
On Error GoTo cleanup
For i = 0 To cButtons - 1
Call SendMessage(hWndTray, TB_GETBUTTON, i, ByVal vaPtr)
Call ReadProcessMemory(hProc, ByVal vaPtr, tbut, Len(tbut), ret)
If Not tbut.dwData = 0 Then
Call ReadProcessMemory(hProc, ByVal tbut.dwData, td, Len(td), ret)
If hWnd = td.hWnd Then
If ID = td.ID Then
Call SendMessage(hWndTray, TB_GETITEMRECT, i, ByVal vaPtr)
Call ReadProcessMemory(hProc, ByVal vaPtr, rc, Len(rc), ret)
Exit For
End If
End If
End If
Next
Call MapWindowPoints(hWndTray, 0&, rc, 2)
GetSystemTrayItemRect = rc
cleanup:
If hProc Then
If vaPtr Then
Call VirtualFreeEx(hProc, ByVal vaPtr, 0&, MEM_RELEASE)
End If
End If
If hProc Then CloseHandle (hProc)
End Function
|
|
|
|
 |