Re: [python-win32] Finding the selected file in Windows Explorer Larry Bates wrote:
> Daniel GonÃ§alves wrote:
>> Hi!
>>
>> I need to find the selected file(s) in a Windows Explorer window from
>> another program (I'd look at the window that last had focus). 



> Daniel,
> 
> What do you mean by "find the selected files".  Give us a little more
> detail about your use case and we can help.
> 

Hi!


What I'm trying to do is to have a program that detects whenever some 
file(s) are dragged over an area of the screen. Not dropped there, but 
dragged over it (close to the screen border, for instance). AFAIK, 
Windows only generates events whenever something is dropped, which will 
be useless here.

I will be using hooks to monitor mouse events and, when the mouse is 
over the defined region, I need to find out what is being dragged. A way 
to do estimate this might be to know that the currently focused window 
is an Explorer window, and query it for the selected items (they will be 
the ones being dragged). This is only an approximation but might be 
enough for my ends, if no better way is found.

Of course, if there is a way of just asking the OS "what is being 
dragged right now", that would work even better :)



Tks!
Daniel



> One way of knowing about files that are selected is this:
> 
> If you selected several files and drag and drop them on a python program 
> the files that are selected will be passed into the program in 
> sys.argv.  I don't know if that is what you are looking for or not.
> 
> -Larry
> 
> _______________________________________________
> python-win32 mailing list
> kpitck-aew45@python.org
> http://mail.python.org/mailman/listinfo/python-win32
> 
_______________________________________________
python-win32 mailing list
kpitck-aew45@python.org
http://mail.python.org/mailman/listinfo/python-win32



