| View previous topic :: View next topic |
| Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Sep 11, 2003 7:17 pm Post subject: Drag and Drop to Folder or Desktop |
|
|
I want to be able to drag and drop a file from a VDS app to a folder or to the desktop. I am having a hard time getting it to work. Any Ideas?
Thanks _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Sep 11, 2003 7:26 pm Post subject: |
|
|
A first look at the problem suggests it may be very difficult in VDS as you can't access anything as a object (again COM etc.)
But there may be workarounds ? _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Sep 12, 2003 2:18 am Post subject: |
|
|
I think I have some idea how this could be done though not the actual code to do it.
In your app you should use the GetKeyState API* under a timer or Repeat-Until so that you can know when the mouse button is down and up.(@mousedown() cannot do that as it is not a global function +buggy)
So on clicking your list(you can use a shift click using the same trick above) say you will copy the path of file to a variable and change the global cursor**.
Then when you release the mouse button use with @mousepos get the X and Y coordinates and feed the value to @winatpoint to get the handle of the window which should be of class #SysListView32. Get it's parent which should be of the class #CabinetWClass. Now you should cycle thorugh the child windows of the #CabinetWClass window (use handles you obtained using class will never work as all the folders have the same class (classname is to make sure you have hit on the right window and nothing else so prevent errors) using vds or API and match the one that belongs to Edit class. Now get the text of this window which is the path to copy/move your file and use VDS File commands to copy or move your file.
Cleanup: reset the cursor and delete thr item from the list etc to mark the end of the function.
All above is in XP. I don't know if class names are slighly different in win 9x which I hardly use if at all.
* and ** both things are implemented in my dialog designer assist and I remember it has source code(I mostly give source codes for users benefit)
Hope this helps. If U want to drop into a particular folder in the syslist view I fear that it needs a object oriented langauge. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Fri Sep 12, 2003 12:29 pm Post subject: |
|
|
Thanks for the info! I'll give that a try. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Sep 12, 2003 2:13 pm Post subject: |
|
|
I think desktop should be easier since it has several unique identifiers.
Good Luck _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
|