| View previous topic :: View next topic |
| Author |
Message |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Thu May 17, 2007 4:20 am Post subject: Get Directory's Icon |
|
|
Is there an easy way to get the associated icon for each directory?
i.e. The icon that Windows Explorer would show for that directory (regular folder icon, shared folders icon, web folders icon, my docs icon, my pictures icon etc). _________________ cheers
Dave |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu May 17, 2007 4:35 pm Post subject: |
|
|
Dave,
I don't know of a easy way to do this. The way that my ShellFolderMenu element gets the icon for the folders is using the SHGetFileInfo function. There is an option to get the icon location using this flag SHGFI_ICONLOCATION however I have not used this flag before. I just get the Icon handles which is all I needed to make the ShellFolderMenu element work in GadgetX. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu May 17, 2007 7:01 pm Post subject: |
|
|
Well, the icon and it's index is usually listed in the Desktop.ini file within that folder. It is a hidden system file. Shouldn't be too hard to get the icon location from that. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu May 17, 2007 7:14 pm Post subject: |
|
|
I would not depend on the desktop.ini... It has been my experience that this file is either missing for the majority of the folders or it is 0 bytes long. The only reliable way I have found is to use the Shell function I mentioned above. I think the flag to get the location is only found in version 5.0 of the shell. In the past I have used the IExtractIcon COM interface but the shell helper function above is much easier and you can get other information about the folder or file. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu May 17, 2007 7:16 pm Post subject: |
|
|
I just verified the version of the shell that the SHGFI_ICONLOCATION flag is found and it seems that it is in version 4.0 of the shell... _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sat May 19, 2007 12:15 pm Post subject: |
|
|
LiquidCode,
I've found that the desktop.ini file seems to only exist if a user has changed the default icon for that folder.
Johnny,
I installed the GadgetX demo yesterday and I've been playing with GadgetX's 'GadgetX Add,ShellFolderMenu' command. Sometimes the trial balloon pops up, other times it doesn't, some times it does but only the right and bottom borders are visible. And when there's an error the whole IDE freezes for a while, then the balloon comes up, and then closes, and then the error message finally appears. It takes around 6 or 7 seconds of frozen application and IDE before I get to see the error message and find out what went wrong.
No offence, but the slow, inconsistent, unlicensed popup balloons on starting and closing an application, that can also freeze the IDE and interfere with seeing any error message, gives the impression that gadgetx is buggy. If I didn't know otherwise I'd probably uninstall the demo and give up on gadgetx.
Getting back to ShellFolderMenu: I've noticed if you use both the following together the startup menu items are not returned:
- GadgetX Add,ShellFolderMenu,programs,#shelltest,2
- GadgetX Add,ShellFolderMenu,startup,#shelltest,7
I also get a 'file not found' error when trying to use:
- GadgetX Add,ShellFolderMenu,desktop,#shelltest,0
I've also found that this works:
DIALOG ADD,MENU,Startup,SomeMenuOption
DIALOG SHOW
GadgetX Add,ShellFolderMenu,startup,#shelltest,7
But this does not:
DIALOG ADD,MENU,Startup,
DIALOG SHOW
GadgetX Add,ShellFolderMenu,startup,#shelltest,7
BTW, IMHO restricting access to your GadgetX forum to only licensed GadgetX users prevents potential purchasers from finding out just what they can do with GadgetX.
I assume when (if?) VDS6 is released that GadgetX will be updated if needed? _________________ cheers
Dave |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat May 19, 2007 12:50 pm Post subject: |
|
|
Dave,
There are many reasons for the popups and how they popup. I know they are a pain but they are set to be random and there is a purpose for the wait. Most of which is to keep people from stealing my hard work and claiming it their own. Everyone complains about the popups in the DLL's but what choice does the developer have when at every turn people are trying to take what is not theirs. Don't get me wrong I am not upset with your observations however if you have built shareware and tried to sale it then you would understand the issues.
As for the forum the reason for it being closed to those who have not purchased the DLL is because this is part of the support benifits of purchasing GadgetX. I never intended to answer questions about GadgetX on that forum to pre-sales individual. I did take that route with the original version of GadgetX and after I answered everyones questions several people went out and built competing products and then gave the products away which deminished the need for a DLL of that kind. IMHO my demo package has as many if not more examples as any other DLL and the support I provide here and at my site is far more than most.
Now down to business of supporting you on the ShellMenu's... The constants are very OS dependent and without knowing which version of windows you are using I cannot tell you exactly why one constant does not work on you PC.
Most likely you will want to use these constants instead of the others unless you using Windows 95. I cannot remember the exact constants that I tested this with under XP since I wrote this over a year ago.
| Code: |
Define Constant,CSIDL_DESKTOPDIRECTORY,16
Define Constant,CSIDL_COMMON_STARTMENU,22
Define Constant,CSIDL_COMMON_PROGRAMS,$0017
Define Constant,CSIDL_COMMON_STARTUP,24
|
Yes in my testing when I wrote this element I remember that the following is true
I've also found that this works:
| Code: |
DIALOG ADD,MENU,Startup,SomeMenuOption
DIALOG SHOW
GadgetX Add,ShellFolderMenu,startup,#shelltest,7
|
But this does not:
| Code: |
DIALOG ADD,MENU,Startup,
DIALOG SHOW
GadgetX Add,ShellFolderMenu,startup,#shelltest,7
|
There is an additional option for this element that I purposly did not document since it acted very buggy. The element is intended to be used for sub-menus only. If there is not a sub-menu then it has nothing to replace.
I have spent over 6 years developing this 1 DLL. I assure you that the full version is everything I claim it to be. Also you can ask others on here if the DLL does not do what I say it does I fix it right then. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat May 19, 2007 1:40 pm Post subject: |
|
|
Dave,
You should also be able to use this for the common user desktop on Windows XP.
| Code: |
Define Constant,CSIDL_COMMON_DESKTOPDIRECTORY,25
|
_________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Sat May 19, 2007 2:00 pm Post subject: |
|
|
He's right, Dave. The registered version does not have any of these "delay" issues... And as far as support, I'd describe him as "Obsessive". Support is far beyond that of any other product I've purchased.... To me, I paid a one time lifetime support fee, and he threw in the DLL for free!
My $0.02,
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Sat May 19, 2007 7:38 pm Post subject: |
|
|
Unfortunately the popup is something we've all had to do when putting out dll's. There really was no other way to restrict the dll from being used without purchase; and many people did use the dll's without valid licenses until the popups started being used.
All of the dll's I have on this site are now free of charge, but the majority of them were at one time shareware and I too employed the popup method to notify the dll was in a trial mode and not to be distributed. It is an effective method which requires purchase if the dll is to be used personally and/or commercially. |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun May 20, 2007 12:12 am Post subject: |
|
|
Hooligan,
Your too kind... It's not that I am obsessive it's just that my full time job is a Software Tester. I test the performance of enterprise level software so I guess I have a high standard when it comes to software. Ok ok maybe a little obsessive but I want to make sure you get your money's worth. I knew from the start of Gadget that I would have to provide really good support. I mean the DLL does have many advanced features. I know this and well you got to provide support when you sale complex software that is if you want to sale it  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun May 20, 2007 2:55 am Post subject: |
|
|
Dave,
I am currently testing a new build of the DLL that will allow you to do.
| Code: |
DIALOG ADD,MENU,Startup,
DIALOG SHOW
GadgetX Add,ShellFolderMenu,startup,#shelltest,24
|
As soon as I have tested it I will post an update to the DLL. Currently it works transparently. This means that you will not have to modify your code. GadgetX will look at the top level menu items and if there is no submenu associated with the item it will create one for the item and append the shellmenu items to the new submenu just like shown above.
I should have it posted tomorrow or the next day.
I have also updated the @SHELLFOLDERMENU() function.
Once posted you will be able to specify a field seperator like the following code for the SHELLFOLDERMENUITEM event. If you do not specify a field seperator then GadgetX will format the values as a VDS list with @cr() between the DisplayName@cr()FileName@cr()LinkPath...
| Code: |
:SHELLFOLDERMENUITEM
# This event subroutine queries GadgetX for the ShellFolderMenu Item
# information that the user clicked.
Parse "%%DisplayName;%%FileName;%%LinkPath",@SHELLFOLDERMENU(@fsep())
if @Equal(@Ext(%%FileName),url)
#If the menu item is a URL try to navigate to the URL Link inside.
%%mURL = %%LinkPath
DIALOG SET,COMBO1,%%mURL
Shell Open,%%mURL
#Ole CallMethod,SHDocVw,"Navigate(^S)",%%mURL
elsif @Equal(@Ext(%%FileName),lnk)
# Try to get the shell to open the link path if possible.
If @Equal(@Ext(%%LinkPath),rdp)
Shell Connect,%%LinkPath
Else
Shell Open,%%LinkPath
End
elsif @Equal(@Ext(%%FileName),pif)
# Try to get the shell to open the link path if possible.
Shell Open,%%LinkPath
else
# Try to get the shell to open the file if possible.
If @Equal(@Ext(%%LinkPath),rdp)
Shell Connect,%%FileName
Else
Shell Open,%%FileName
End
end
goto evloop
|
_________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sun May 20, 2007 10:47 am Post subject: |
|
|
Well Johnny, you've convinced me. I paid for a license via PayPal earlier today. _________________ cheers
Dave |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun May 20, 2007 3:45 pm Post subject: |
|
|
Dave,
I have processed your order and the system has sent you an email with your registration information. I am currently updating the documentation for these recent changes and should be posting the new version today. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun May 20, 2007 9:46 pm Post subject: |
|
|
Ok I have updated the DLL on my website. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|