Hi,
Does anyone know how I would be able to drag a single file onto my
applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the apps
form) and perform the necessary actions then give a confirmation when these
actions are done then quit.
Any ideas?
Cheers,
Paul 8 3993
See Command function in help. When you drop a file on your app's icon, your
app will start & Command will hold the filename. So in the form's load
event, you can
FileName = Command
'do whatever
"Paul" <12************ **@btinternet.c om> wrote in message
news:bj******** **@sparta.btint ernet.com... Hi,
Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the
apps form) and perform the necessary actions then give a confirmation when
these actions are done then quit.
Any ideas? Cheers, Paul
What about if I wanted to drag some text from a web page onto my form Icon
and then process the text.
k_zeon
"Norm Cook" <no******@cable one.net> wrote in message
news:vl******** ****@corp.super news.com... See Command function in help. When you drop a file on your app's icon,
your app will start & Command will hold the filename. So in the form's load event, you can
FileName = Command 'do whatever
"Paul" <12************ **@btinternet.c om> wrote in message news:bj******** **@sparta.btint ernet.com... Hi,
Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the apps form) and perform the necessary actions then give a confirmation when these actions are done then quit.
Any ideas? Cheers, Paul
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003
"k_zeon" <k_****@hotmail .com> wrote What about if I wanted to drag some text from a web page onto my form Icon and then process the text.
Do you see any application that can do that?
LFS
Thanks Norm
"Norm Cook" <no******@cable one.net> wrote in message
news:vl******** ****@corp.super news.com... See Command function in help. When you drop a file on your app's icon,
your app will start & Command will hold the filename. So in the form's load event, you can
FileName = Command 'do whatever
"Paul" <12************ **@btinternet.c om> wrote in message news:bj******** **@sparta.btint ernet.com... Hi,
Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the apps form) and perform the necessary actions then give a confirmation when these actions are done then quit.
Any ideas? Cheers, Paul
When I assign Command to FileName I get, for example, "C:\Program
Files\MyApp\Fil eToDrop.txt"
I already know how to remove the quotation marks from the string but is
there any way of splitting the path and the filename and assigning them to a
different string?
e.g
FileName = "FileToDrop.txt "
Path = "C:\Program Files\MyApp\"
Thanks
Paul
"Norm Cook" <no******@cable one.net> wrote in message
news:vl******** ****@corp.super news.com... See Command function in help. When you drop a file on your app's icon,
your app will start & Command will hold the filename. So in the form's load event, you can
FileName = Command 'do whatever
"Paul" <12************ **@btinternet.c om> wrote in message news:bj******** **@sparta.btint ernet.com... Hi,
Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the apps form) and perform the necessary actions then give a confirmation when these actions are done then quit.
Any ideas? Cheers, Paul
Paul,
You might try the SPLIT command. Dim a variant to recieve the values and
then address it as a zero-based array.
Dim vPathData as Variant
vPathData = Split(Path,"\")
At this point you have:
vPathData(0) = "C:"
vPathData(1) = "Program Files"
vPathData(2) = "MyApp"
etc....
Hope this helps,
Jim
"Paul" <12************ **@btinternet.c om> wrote in message
news:bj******** **@hercules.bti nternet.com... When I assign Command to FileName I get, for example, "C:\Program Files\MyApp\Fil eToDrop.txt"
I already know how to remove the quotation marks from the string but is there any way of splitting the path and the filename and assigning them to
a different string?
e.g
FileName = "FileToDrop.txt " Path = "C:\Program Files\MyApp\" Thanks Paul "Norm Cook" <no******@cable one.net> wrote in message news:vl******** ****@corp.super news.com... See Command function in help. When you drop a file on your app's icon, your app will start & Command will hold the filename. So in the form's load event, you can
FileName = Command 'do whatever
"Paul" <12************ **@btinternet.c om> wrote in message news:bj******** **@sparta.btint ernet.com... Hi,
Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the apps form) and perform the necessary actions then give a confirmation when these actions are done then quit.
Any ideas? Cheers, Paul
I always use the following function for this. You could use it as is
or just pull out the bits useful for your app.
Regards,
Andrew
' Written by: Office Developer Edition Code Librarian
' Revised by:
' Purpose: Takes a file path and returns either the path, file,
drive or
' file extension portion depending on which constant was
passed in
' Dependencies:
' Comments:
' Error constants
Public Const ERR_SUBSCRIPT As Long = 9
' Enumeration constants
Public Enum opgParsePath
FILE_ONLY
PATH_ONLY
DRIVE_ONLY
FILEEXT_ONLY
End Enum
Public Function ParsePath(strPa th As String, lngPart As opgParsePath)
As String
Dim lngPos As Long
Dim strPart As String
Dim blnIncludesFile As Boolean
' Check that this is a file path. Find the last path separator.
lngPos = InStrRev(strPat h, "\")
' Determine whether portion of string after last backslash contains
a period
blnIncludesFile = InStrRev(strPat h, ".") > lngPos
If lngPos > 0 Then
Select Case lngPart
' Return file name.
Case opgParsePath.FI LE_ONLY
If blnIncludesFile Then
strPart = Right$(strPath, Len(strPath) - lngPos)
Else
strPart = ""
End If
' Return path.
Case opgParsePath.PA TH_ONLY
If blnIncludesFile Then
strPart = Left$(strPath, lngPos)
Else
strPart = strPath
End If
' Return drive.
Case opgParsePath.DR IVE_ONLY
strPart = Left$(strPath, 3)
' Return file extension.
Case opgParsePath.FI LEEXT_ONLY
If blnIncludesFile Then
' Take three characters after period.
strPart = Mid(strPath, InStrRev(strPat h, ".") + 1,
3)
Else
strPart = ""
End If
Case Else
strPart = ""
End Select
End If
ParsePath = strPart
ParsePath_End:
Exit Function
End Function
"Paul" <12************ **@btinternet.c om> wrote in message news:<bj******* ***@hercules.bt internet.com>.. . When I assign Command to FileName I get, for example, "C:\Program Files\MyApp\Fil eToDrop.txt"
I already know how to remove the quotation marks from the string but is there any way of splitting the path and the filename and assigning them to a different string?
e.g
FileName = "FileToDrop.txt " Path = "C:\Program Files\MyApp\" Thanks Paul "Norm Cook" <no******@cable one.net> wrote in message news:vl******** ****@corp.super news.com... See Command function in help. When you drop a file on your app's icon, your app will start & Command will hold the filename. So in the form's load event, you can
FileName = Command 'do whatever
"Paul" <12************ **@btinternet.c om> wrote in message news:bj******** **@sparta.btint ernet.com... Hi,
Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code.
What I want is to drop an .mp3 file onto my applications icon (not the apps form) and perform the necessary actions then give a confirmation when these actions are done then quit.
Any ideas? Cheers, Paul
> When I assign Command to FileName I get, for example, "C:\Program Files\MyApp\Fil eToDrop.txt"
I already know how to remove the quotation marks from the string but is there any way of splitting the path and the filename and assigning them to
a different string?
e.g
FileName = "FileToDrop.txt " Path = "C:\Program Files\MyApp\"
StringToParse = "C:\Program Files\MyApp\Fil eToDrop.txt"
LastSlash = InStrRev(String ToParse, "\")
If LastSlash Then
FileName = Mid$(StringToPa rse, LastSlash + 1)
Path = Left$(StringToP arse, LastSlash)
Else
Colon = InStr(StringToP arse, ":")
FileName = Mid$(StringToPa rse, Colon + 1)
Path = Left$(StringToP arse, Colon)
End If
Rick - MVP This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mark Sisson |
last post by:
Hi gurus.
I created a CustomControl starting from a c# Web Control Library
Project. I immediately compiled it in Release mode without touching a
line of code. Next, I went to another instance of VS.NET where I have
a web page up in design mode. I went to the Toolbox, selected
CustomizeToolbox, and browsed to add my new WebControlLibrary1.dll.
The default cog icon showed up for my WebCustomControl1 but then when
I went to drag it onto...
|
by: Clyde |
last post by:
I am trying to implement the user feedback provided by
Windows Explorer when draggng a filename from one place to
another.
I have the drag and drop action worked out but have had no
luck in finding how to capture the piece of the screen
into a bitmap to simulate the movement. I know this could
be done with the Windows API but can't find any way to do
it with .Net functions.
Any help is appreciated.
|
by: Yavuz Bogazci |
last post by:
Hi,
i have build a form with a listbox and the function that
he user can drag and drop files from the windows explorer
in this listbox. this works for me when i start it on my
localmachine.
But when i put my Apps .exe file on my WebServers WWWROOT
directory and call it from the internet explorer. the
application starts with the following error message.
|
by: Pete Mitchell |
last post by:
I have an application that parses a file and creates a new
one based on the contents of the original file.
What do I need to do so that a user could drag the source
file from Windows Explorer and drop it onto a desktop
shortcut icon of my .exe and have it execute ?
Thanks in advance..
Pete
|
by: Mark |
last post by:
hi...
i have a program that opens a couple files and performs some operations
on them.
i wanted to modify my program so that if you drag and drop a file onto
the exe via windows, it will open this file and use it instead.
however, without even modifying my code first, if i drag and drop a
file onto the exe it no longer opens/writes to the files specified by
the program. but when no file is dragged onto it, it runs fine as
| |
by: Darren |
last post by:
I'm trying to create a file using drag and drop.
I want to be able to select a listview item drag it to the shell and create a file.
Each icon in the listview represents a blob in a database.
When I drop onto the shell I want a file created with a specified name containing the data from the database.
I've looked at the FileDrop format but it look to have only the filename and not the data.
TIA
|
by: Staal |
last post by:
My C# application supports drag and drop of files, folders, shortcuts and
links from other applications into mine. This all works pretty nicely,
except that I am trying to get a little more information when a web link is
dropped onto my application from Internet Explorer.
When you drag the link in the Address bar of Internet Explorer to your
desktop, the desktop shortcut that gets created has the Title of the web page
as it’s name,...
|
by: =?Utf-8?B?Um9i?= |
last post by:
Hi all,
I want to fire the drag events when someone drags a file over the
application's icon. This means the application has not opened yet.
Scenario would be:
1. user selects file they want to open through the app
2. user drags file onto the app's icon (desktop) or from "Send To" popup
3. app opens upon "drop"
4. app recognized the file that was dropped on it and opens the file from
|
by: John |
last post by:
Howdy,
I havn't been using VB.NET just a whole lot, and am finally making the
transistion from VB6 to dotnet. (Yeah it is pretty sad, I know.)
Anyhow, I have created several apps in vb6 that I allowed the user to drag
and drop a file onto the executable. The executable would grab the path and
filename of the dropped file and store it in a variable. I could then use
the variable to access and manipulate the file.
I also used the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |