473,672 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dropping folder on desk top icon

Normally I have some idea of where in the MSDN to start looking but on this
one I have absolutely no idea.

A fellow who uses my 'toy' asked if would be possible to drop a folder of
files / folders to be processed onto the desktop icon ( well, of course it
would ;) ) My question is how do I detect that in a vb 2005 program??

//al

(( Cor, I'm working of the question .... ))
Nov 30 '06 #1
5 1297
al jones <al**********@s hotmail.comwrot e:
>A fellow who uses my 'toy' asked if would be possible to drop a folder of
files / folders to be processed onto the desktop icon ( well, of course it
would ;) ) My question is how do I detect that in a vb 2005 program??
When the windows shell has items dropped on an executable (or shortcut
to an executable), then it launches the executable and passes the
names of those items as command-line arguments. So:

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
For Each fn As String In My.Application. CommandLineArgs
TextBox1.Append Text(fn & vbCrLf)
Next
End Sub

--
Lucian
Nov 30 '06 #2
On Wed, 29 Nov 2006 19:51:36 -0800, Lucian Wischik wrote:
al jones <al**********@s hotmail.comwrot e:
>>A fellow who uses my 'toy' asked if would be possible to drop a folder of
files / folders to be processed onto the desktop icon ( well, of course it
would ;) ) My question is how do I detect that in a vb 2005 program??

When the windows shell has items dropped on an executable (or shortcut
to an executable), then it launches the executable and passes the
names of those items as command-line arguments. So:

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
For Each fn As String In My.Application. CommandLineArgs
TextBox1.Append Text(fn & vbCrLf)
Next
End Sub
Ah, okay, thanks. That prompts "what happens to any command line switched
that I might already have set", but I can deal with that.

Thank you sir //al
Nov 30 '06 #3
On Wed, 29 Nov 2006 19:51:36 -0800, Lucian Wischik wrote:
al jones <al**********@s hotmail.comwrot e:
>>A fellow who uses my 'toy' asked if would be possible to drop a folder of
files / folders to be processed onto the desktop icon ( well, of course it
would ;) ) My question is how do I detect that in a vb 2005 program??

When the windows shell has items dropped on an executable (or shortcut
to an executable), then it launches the executable and passes the
names of those items as command-line arguments. So:

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
For Each fn As String In My.Application. CommandLineArgs
TextBox1.Append Text(fn & vbCrLf)
Next
End Sub
Okay, Lucian, you got me into this.... :)
I was already checking for some command line arguements of my own so making
this addition was easy - once I knew where to look.

But now for the dumb logic portion of this - I process the command
arguments in formload. What I want is to bypass the 'Run' button if they
drop a folder on the program icon, just take the existing options, use this
folder and go from there.

No, not being reasonable (I deleted my first attempt here) I'd like to
display the form as I do have progress bars, etc on it. But I'd also like
it set so that they don't have to click on anything - they've already given
me what I need - so I'd just like to load everything and pretend they
clicked 'Run'.

aside: I should probably move the command line processing to a seperate
function (it's beginning to get to be unwieldly) but I still have to return
to form load which will expect input .... suggestions???

//al
Nov 30 '06 #4


"al jones" <al**********@s hotmail.comwrot e in message
news:1l******** *************** ******@40tude.n et...
On Wed, 29 Nov 2006 19:51:36 -0800, Lucian Wischik wrote:
>al jones <al**********@s hotmail.comwrot e:
>>>A fellow who uses my 'toy' asked if would be possible to drop a folder of
files / folders to be processed onto the desktop icon ( well, of course
it
would ;) ) My question is how do I detect that in a vb 2005 program??

When the windows shell has items dropped on an executable (or shortcut
to an executable), then it launches the executable and passes the
names of those items as command-line arguments. So:

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventAr gs) Handles MyBase.Load
For Each fn As String In My.Application. CommandLineArgs
TextBox1.Append Text(fn & vbCrLf)
Next
End Sub

Okay, Lucian, you got me into this.... :)
I was already checking for some command line arguements of my own so
making
this addition was easy - once I knew where to look.

But now for the dumb logic portion of this - I process the command
arguments in formload. What I want is to bypass the 'Run' button if they
drop a folder on the program icon, just take the existing options, use
this
folder and go from there.

No, not being reasonable (I deleted my first attempt here) I'd like to
display the form as I do have progress bars, etc on it. But I'd also like
it set so that they don't have to click on anything - they've already
given
me what I need - so I'd just like to load everything and pretend they
clicked 'Run'.

aside: I should probably move the command line processing to a seperate
function (it's beginning to get to be unwieldly) but I still have to
return
to form load which will expect input .... suggestions???

//al
1.) Before loading your form, in the apps Main method, parse all of your
command-line switches (and yes, I would break this out into a separate
method or even class if it is getting larger).

2.) Create a new constructor for your form that accepts the argument(s) that
are passed from the command-line. Initialize any members to these arguments
if required.

3.) Instead of having your processing code in the "Start" buttons event
handler, move this logic into a separate method.

4.) In your "Start" buttons event handler, call the method created in step
3.

5.) In your forms load event handler, check to see if all the required
values are present via members/properties set in step #2. If they are set,
call the form's Show method and then call the method created in step 3.

This should help get ya started to allow drag-n-drop onto the exec as well
as using the gui to specify required arguments.

HTH,
Mythran


Nov 30 '06 #5
On Thu, 30 Nov 2006 10:43:44 -0800, Mythran wrote:
"al jones" <al**********@s hotmail.comwrot e in message
news:1l******** *************** ******@40tude.n et...
>On Wed, 29 Nov 2006 19:51:36 -0800, Lucian Wischik wrote:
>>al jones <al**********@s hotmail.comwrot e:
A fellow who uses my 'toy' asked if would be possible to drop a folder of
files / folders to be processed onto the desktop icon ( well, of course
it
would ;) ) My question is how do I detect that in a vb 2005 program??

When the windows shell has items dropped on an executable (or shortcut
to an executable), then it launches the executable and passes the
names of those items as command-line arguments. So:

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventA rgs) Handles MyBase.Load
For Each fn As String In My.Application. CommandLineArgs
TextBox1.Append Text(fn & vbCrLf)
Next
End Sub

Okay, Lucian, you got me into this.... :)
I was already checking for some command line arguements of my own so
making
this addition was easy - once I knew where to look.

But now for the dumb logic portion of this - I process the command
arguments in formload. What I want is to bypass the 'Run' button if they
drop a folder on the program icon, just take the existing options, use
this
folder and go from there.

No, not being reasonable (I deleted my first attempt here) I'd like to
display the form as I do have progress bars, etc on it. But I'd also like
it set so that they don't have to click on anything - they've already
given
me what I need - so I'd just like to load everything and pretend they
clicked 'Run'.

aside: I should probably move the command line processing to a seperate
function (it's beginning to get to be unwieldly) but I still have to
return
to form load which will expect input .... suggestions???

//al

1.) Before loading your form, in the apps Main method, parse all of your
command-line switches (and yes, I would break this out into a separate
method or even class if it is getting larger).

2.) Create a new constructor for your form that accepts the argument(s) that
are passed from the command-line. Initialize any members to these arguments
if required.

3.) Instead of having your processing code in the "Start" buttons event
handler, move this logic into a separate method.

4.) In your "Start" buttons event handler, call the method created in step
3.

5.) In your forms load event handler, check to see if all the required
values are present via members/properties set in step #2. If they are set,
call the form's Show method and then call the method created in step 3.

This should help get ya started to allow drag-n-drop onto the exec as well
as using the gui to specify required arguments.

HTH,
Mythran

Thanks Mythran for the step by step; now to go and see if I understand what
I think you said.

//al
Nov 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1609
by: jhorner | last post by:
I am writing a c# app and need the ability to drag a file onto the icon - this should then run the app and do something with the file. I made the assumption that doing so would call the app with the filename as a command line argument, but this seems to go a bit weird. I added this to my Main: static void Main(string args) { if(args != null && args.Length > 0) { // Do Something here. } else { // Do something else here.
4
14398
by: yxq | last post by:
Hello I found a icon Class, i have tested the code, it can get file and drive icons, but not folder icons, How to get a folder icon? Thanks ************************************************************************* '=========================================================================== ========== ' clsIcon
16
7402
by: Phil Hey | last post by:
Hi, I can change the icon for a folder by right clicking on it > going to the customize tab > and selecting Choose Picture. Does anyone know if it is possible to do this programmatically from a windows forms application?
3
4136
by: cj | last post by:
I found a good tutorial for making a windows setup program so I'm doing that. But when I add folders to the target machine list they don't seem to have one for the all users startup folder. I assume this will be a custom location and I added one called Startup. Now I'm looking at the properties menu for it but I'm not sure how to set the properties to specify the all users startup folder--if it exists, user startup if not.
1
2235
by: Jet Jaguar | last post by:
I'm trying to find a way to set a custom folder icon in OS X. I thought that Applescript would be able to do it, but apparently it can't. Is there anything in the Macintosh libraries of Python that will allow me to take an image file (e.g., jpeg, png, tiff, etc.) and set it as the icon for a folder? Kevin D. Smith
4
1669
by: mikkoO8 | last post by:
hi. im actually making a desktop cleaner that can move the files and icons to a folder inside the listview box. i can make the listview box filled with files contains at the desktop and i can make a new folder which suppose to be move the files on that folder i have 3 problems: 1. is how to get last access time of the FILE and put it column2 of the listview 2. i want to view that are unused icon and document last week, 2weeks, 1month...
14
12770
by: Ashutosh Bhawasinka | last post by:
Hi, How can I retrieve the system icon associated with a file/folder so that I can show it in the list view adjacent to the file/folder name? Regards, Ashutosh Bhawasinka
2
11400
HillComanchy
by: HillComanchy | last post by:
I have an old blackberry 8700c, I want to create a home screen icon that takes me directly to the SMS Inbox folder, or to a specific folder from my exchange mailbox, how do I do that? I found out that pressing alt with the wheel lets me move or delete an existing icon from the homescreen, but how do I add an entirely new one ? http://www.cebst.com/blackberry+8700c.jpg That's what it look like: http://www.cebst.com/blackberry+8700c.jpg
0
8423
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,...
0
8852
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8701
tracyyun
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...
0
7482
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5725
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();...
0
4251
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...
0
4447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2847
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
2
2098
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.