|
|
Comments and Discussions
|
|
 |
|
|

|
Thank You - I was trying to make one myself and ran across this!
|
|
|
|

|
Nice tool, I managed to modify the code to properly handle multi-threaded Windows operations, but I found that the extracted icons, nearly 20000 of them, all have poor colour depth. What can be the cause for such low colour output?
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
|
|
|
|
|

|
This is a really good app, I have been looking for something that does this sort of thing as a batch process, and I think I have found it!
For some reason, a few of the icons that were extracted were quite distorted, any ideas why?
|
|
|
|

|
Very sloppy code but i still appreciate your contribution.
In the future perhaps you could do a few things:
1) Use Option Strict so you actually use correct data types
2) Design your classes more flexible so that they may be used more generically.
Having to create the class, for example, by passing a ByRef Form object is rediculous.
Put the ability to extract and save icons as methods and allow properties such as where to save to, where to look from, etc..
|
|
|
|
|

|
This is a really cool app! Nice work! I need to know how to replace a folders icon through my code. Any ideas?
|
|
|
|

|
i want to make a program put it icon on desktop to droped file on it like recyclebin whin droped the file on icon give me messege in path of file droped
thanks
|
|
|
|

|
That is a bit outside of the scope of this article, but... just call Command() in your form load or Main() entry point. That will give you the whole command line. You'll need to parse it out yourself using substring or something. Otherwise, if you use C#, you'll get a function static void Main(string[] args) which gives you an array of all the items sent to the exe. This works for drag/drop files, or you could just run the application from the command line with the argurment (i.e. myprogram.exe "C:\myfile.abc". Good luck.
|
|
|
|

|
Awesome.....
FANTASTIC....
This is a GREAT tool....
Grumpy Aero Guy
|
|
|
|

|
Thanks, I appreciate that.
|
|
|
|

|
Can you develop/point me to API's to extract cursors instead?
|
|
|
|
|

|
There will always be critisism but thats how we continue to learn...The project is great and will help alot of other programers. Thanks for sharing
Pablo
|
|
|
|

|
I wanted to know if it was legal to use an icon from another program, library, etc...
|
|
|
|

|
Of course it is not legal, but for the purpose of "Know How", I guess no problem;).
|
|
|
|

|
If you dont sell the content the it is ok.
|
|
|
|

|
Actually whether you sell it or not does not matter - it is illegal to use the icon unless the owner has expressly given the permission.
Cool tool either way.
|
|
|
|

|
Hi,
I've just started learning VB.Net and I downloaded this code. It had to be converted to VB.Net 2005. I'm getting an error in the UpdateUI subroutine at the line lblFolder.Text = folder
The error is as follows Cross thread operation not valid : Control lblFolder accessed from a thread other than the thread it was created on
Any ideas how this can be fixed? As I said I'm new to VB.Net and I don't have any idea how to do this myself.
Thanks very much,
dlarkin77
|
|
|
|
|

|
Thanks for pointing me to that article. Does this mean that I should have a seperate function/subroutine for each UI component that needs to be updated?
|
|
|
|

|
That seems to be the case. I haven't played too much with VS 05, so I'm not sure. It looks like if a separate thread tries to update the UI control, then yes, you'll need a separate function to handle it that is thread safe.
|
|
|
|

|
I've played a bit with threads in VB 05. You don't have to have a seperate Sub/Function for each control.
You can use 1 Sub/Function for all cros-thread operations you'll ever use!
'A delegate for the cross-thread operations
Private Delegate Sub CrossThreadDelegate(ByVal WhatToDo As String)
Private Sub CrossThread(ByVal WhatToDo As String)
Select Case WhatToDo
'Insert Case Statements and Code
End Select
End Sub
Whenever you use a cross-thread operation use the following:
If [ControlToUpdate].InvokeRequired Then
Dim del As New CrossThreadDelegate(AddressOf CrossThread)
[ControlToUpdate].Invoke(del, New Object() {Arguments for Sub here. In this case the string 'WhatToDo' argument.})
Else
'Normal Code Here (That would be contained in sub)
End If
You could also make 1 sub for each control whose text you need to cange, etc...
|
|
|
|

|
Adding to the last reply:
Heres an example:
Private Delegate Sub SetTextThreadSafe(ByVal ControlToSet As Control, ByVal SetTo As String)
Private Sub ChangeText(ByVal Control As Control, SetTo As Strimg)
Control.Text = SetTo
End Sub
Private Sub CallThisFromAnotherThread()
'This assumes that there is a label called lblLabel
'And a textbox called txtText
Dim del As New SetTextThreadSafe(AddressOf ChangeText)
If lblLabel.InVokeRequired Then
lblLabel.Invoke(del, New Object {lblLabel, "New Text"})
'lblLabel.Invoke can be any Invoke Method
Else
lblLabel.Text = "New Text"
End If
'Do the same for the textbox
If txtText.InvokeRequired Then
txtText.Invoke(del, New Object() {txtText, "Text box text"})
Else
txtText.Text = "Text box text"
End If
End Sub
Hope it helps.
-- modified at 13:49 Friday 26th May, 2006
|
|
|
|

|
The easiest fix for this app is: add the line
System.Windows.Forms.Form.CheckForIllegalCrossThreadCalls = False
to Form1_Load (in Form1.vb)
|
|
|
|

|
.NET 2.0 will detect and halt the invalid declaration, 1.1 doesn't care
The last parameter should be an Integer or a Uint, not a Long.
|
|
|
|

|
Hello all,
I need to export a SQL table to the CSV file with it's headings on button click event in vb.net. Can anyone tell me how would I do it.
Any help would be really appreciated,
Thanks,
-A
|
|
|
|

|
You're really posting this in the wrong place, but it is quite easy to do. Run your query and put it into a dataReader object. Follow the code on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnhcvs04/html/vs04g6.asp[^] for getting column names and looping through each row of data. It should be relatively easy to write each value in quotes, followed by a comma, and at the end of a row append a carriage return. SQL Enterprise Manager can let you export data as CSV as well, but I see you're trying to do it at a button event. Good luck.
|
|
|
|

|
I spent a good while last night trying to extract the icons from my shell32.dll using some poxy software that done it all wrong.
This is innovative stuff, you have software out there that does many things, but yours is simple and does exactly what is says on the tin.
5 stars mate.
Life Saver
Gav
|
|
|
|

|
I saw u used this procedure to save the icon to a file....
THIS........
Dim stream As New IO.MemoryStream
Icon.Save(stream)
Dim b(CInt(stream.Length)) As Byte
stream.Position = 0
stream.Read(b, 0, CInt(stream.Length))
stream.Close()
Dim fs As New IO.FileStream(FileName, IO.FileMode.CreateNew)
fs.Write(b, 0, b.Length)
fs.Close()
OR THIS.........
Icon.Save(sfd.OpenFile)
I tried the code out thinking maybe that this is the workaround for the Icon.Save function, but obviously it works exactly the same. could it be u dont know about Icon.Save?
|
|
|
|

|
Could it do/find icon Strip images (not sure if bmp, ico, other) or other images in dlls, ocx, msc, etc.
That would be cool. Nice program. Cheers!
William Stacey - MVP
|
|
|
|

|
The current program always initializes the intIconNumber value to zero. To allow unique file names each time the program is run, add the following to the LoadCurrentIcons() method.
Private Sub LoadCurrentIcons()
...
try
'find name with largest icon number
n = CInt(System.IO.Path.GetFileNameWithoutExtension(f.FullName))
If n >= intIconNumber Then
intIconNumber = n + 1
End If
...
|
|
|
|
|

|
Hello.
I haven't tested it, but I think you can do that... The new constructor of the icon class takes a stream as a parameter, so I imageine that's the way to do it... Try something like: ImageList1.Images.Add(new Icon(stream)). Good luck!
|
|
|
|

|
Icon isn't inherited from image so you can't use Imagelist1.Images.Add(Icon).
Use:
Imagelist1.Images.Add(Icon.ToBitmap)
|
|
|
|

|
In my computer, after running the extractor, all icons are with 16 colors only .. shouldn´t they be as the originals?
|
|
|
|

|
This is as designed with the ExtractIcon API. The API extracts the icon that best suits the settings of the machine (see http://www.pcmag.com/article2/0,1759,1167144,00.asp for details). If you know a way to get the highest resolution icon out of the file, please post it here. Thanks!
|
|
|
|

|
I'd like to recommend you to refer to one of the Platform SDK sample,
'IconPro'.
Although it was written in C using Win32 SDK API, I guess it would be a great help to anyone who is interested in the ICON interface.
Have a nice day!
|
|
|
|

|
Very nice tool. I have been looking for something like this...
Just one comment: I started the tool and everything looked fine, I just couldn't find the output directory. After poking around in the sources, I determined, that it was hard coded to 'c:\icons2', which might not work for people that have no c: drive, not enough space on it, etc...
Maybe you could make it a command line parameter or a form field for a future release? But on the other hand, with the source code in hand, people could do this themselves.
Fine work!
|
|
|
|

|
Ah yes... I forgot to pull that c:\icons2 variable out, and make it into a user defined variable... but true, if you have the source, it's easy enough to change. Thanks!
|
|
|
|

|
Cool, I was going to write something like this myself. Now I don't have to bother with it!
|
|
|
|

|
Thanks Mark. I appreciate your comment... I hope you find this tool useful.
dom
|
|
|
|

|
This definately is a time saver!
Thank you Domenic
Glen
--------------------------
from: bug_Chas3r@myway.com
--------------------------
|
|
|
|

|
Same comment.
Cool Code and App
|
|
|
|

|
I saw u used this procedure to save the icon to a file....
THIS........
Dim stream As New IO.MemoryStream
Icon.Save(stream)
Dim b(CInt(stream.Length)) As Byte
stream.Position = 0
stream.Read(b, 0, CInt(stream.Length))
stream.Close()
Dim fs As New IO.FileStream(FileName, IO.FileMode.CreateNew)
fs.Write(b, 0, b.Length)
fs.Close()
OR THIS.........
Icon.Save(sfd.OpenFile)
I tried the code out thinking maybe that this is the workaround for the Icon.Save function, but obviously it works exactly the same. could it be u dont know about Icon.Save?
|
|
|
|

|
Yes, I do know about the icon.save method. I remember trying to use that at one point, but had some issue with it. I can't recall what it was. If it works for you, then great.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
An Icon Extractor coded in VB.NET
| Type | Article |
| Licence | |
| First Posted | 12 Apr 2004 |
| Views | 207,827 |
| Bookmarked | 103 times |
|
|