Results 1 to 7 of 7

Thread: Drag and drop to systray

  1. #1

    Thread Starter
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    How about placing drag and drop on the image that you are placing in the system tray

  2. #2
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    maybe use the callback as
    Const WM_DROPFILES = &H233
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  3. #3
    Junior Member brind_foin's Avatar
    Join Date
    Mar 2002
    Location
    Somewhere over the rainbow
    Posts
    17

    Doesn't work

    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
    Coding is like drug... I should go on therapy...

  4. #4
    Junior Member brind_foin's Avatar
    Join Date
    Mar 2002
    Location
    Somewhere over the rainbow
    Posts
    17

    Systray... Always the same behavior

    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
    Coding is like drug... I should go on therapy...

  5. #5

    Thread Starter
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    Alright i am going to have to take this challenge up. Give me a day or so.

  6. #6
    Junior Member brind_foin's Avatar
    Join Date
    Mar 2002
    Location
    Somewhere over the rainbow
    Posts
    17

    No answer :mad:

    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
    Coding is like drug... I should go on therapy...

  7. #7
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    did anyone every get this figured out?

    I need to use something like this in my current project!

    Thanks in advance,
    /: Tim :\____________________
    \: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width