How about placing drag and drop on the image that you are placing in the system tray
Printable View
How about placing drag and drop on the image that you are placing in the system tray
maybe use the callback as
Const WM_DROPFILES = &H233
I tried
TrayI.ucallbackMessage = WM_DROPFILES
but I think Systray don't allow us to drop anything into it's child control. It always show the "No drop" sign.
Since Systray is the parent control of my image (I think) is there a way I can enable Systray to accept drop files ?
Or maybe by using subclassing. I don't know how to do it.
If you have code example, it will be a great help for me.
Thanks guys
Brind
I looked into API calls...
I'm able to retrieve the Systray hWnd. Using the ShowWindow API, I'm able to hide or show it. Now I know that I have the right handle to work with, I decided to tell it to accept files. This is the portion of my code:
'In declaration
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Const GWL_STYLE = (-16)
Const WS_EX_ACCEPTFILES = &H10&
'In code
Private Sub Form_Load()
Dim sWnd As Long
sWnd = FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString)
sWnd = FindWindowEx(lngWindow, 0, "TrayNotifyWnd", vbNullString)
SetWindowLong sWnd, GWL_STYLE, WS_EX_ACCEPTFILES
I always have the same problem, nothing work at all.
'Still always need your help !
Brind
Alright i am going to have to take this challenge up. Give me a day or so.
I didn't have any good answer to my post...
Maybe it's to hard for you guys ?!?! ;)
This is a good challenge!!
We have to put an icon to the systray then beeing able to fire an event when something is drop on the icon. Simple to say but hard to do...
I tried a lot of codes but nothing's good. I've play also with C++ but it's even harder. I want to keep my code in VB.
So, I'm waiting for you, I don't know where to go with that.
See ya!
Brind
did anyone every get this figured out?
I need to use something like this in my current project!
Thanks in advance, :)