Author Topic: Use "Windows Icon Selector" via AutoLisp  (Read 3576 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 654
Use "Windows Icon Selector" via AutoLisp
« on: February 02, 2015, 04:00:34 PM »
I want to select Icon(group) and the iconnumber plus Preview via Lisp to get a result like "moreicons.dll,32". So my cascading questions are:

1) Is there a basic function in Lisp?
2) If not, is there a feature in a common, additional software (like DosLib)?
3) If not, how to use the "Windows Standard Icon selector" (sorry - don't know the correct name) - see attachment?

Thanks and regards
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #1 on: February 02, 2015, 04:23:40 PM »
What do you want to do with the ICON once identified, use in toolbar etc...

BlackBox

  • King Gator
  • Posts: 3770
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #2 on: February 02, 2015, 04:36:50 PM »

3) If not, how to use the "Windows Standard Icon selector" (sorry - don't know the correct name) - see attachment?

You can launch Visual Studio to code yourself a .NET plug-in that implements a new LispFunction Method for this... Otherwise I have the same question as to what you're planning to do with your newly selected Icon?  :|
"How we think determines what we do, and what we do determines what we get."

Peter2

  • Swamp Rat
  • Posts: 654
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #3 on: February 03, 2015, 02:21:49 AM »
What do you want to do with the ICON once identified, use in toolbar etc...
Yes - I simply need it to create definition-files (no Cuix) and so on.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #4 on: February 03, 2015, 07:00:59 AM »
If all your looking to do is create your own dll files you can use resource hacker, just copy an existing dll file that's full of icons, delete the existing ones and add your own.

Peter2

  • Swamp Rat
  • Posts: 654
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #5 on: February 03, 2015, 07:17:41 AM »
If all your looking to do is create your own dll files ...
No - I would like to integrate the function into a lisp-software.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #6 on: February 03, 2015, 07:28:41 AM »
You need to be more specific.  What do you want this lisp routine to do with these icons? 
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

Peter2

  • Swamp Rat
  • Posts: 654
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #7 on: February 03, 2015, 09:48:09 AM »
The basic idea behind it was to create "desktop.ini" files, where the icons are defined like this:
Code - Auto/Visual Lisp: [Select]
  1. [.ShellClassInfo]
  2. IconResource=C:\Windows\syswow64\shell32.dll,27
  3.  

Of course the next question will be: "Why the hell he wants to abuse AutoCAD for that crazy stuff? Create an EXE or download the tool XY from ....."

So why this "abuse"?
a)
- "The user" (low level user) does not want tools and exes and dialogues. He wants a button to press or a function in the background.
- The Sysadmin and the IT-security do not want that the crazy CAD guy installs or uses any EXE-stuff on local drive or in network - and have locked the system.
- I want a system (=Autolisp code) which runs (rather) out of many security-locks, prohibited installation and which can be controlled by me.

b)
If it is solved for this usage it can be used for others too.

So I want:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:myfolderconfig ()
  2.    (if "something bad happens to folder A"
  3.         (change folder-icon to red   and comment to "Alert")
  4.         (change folder-icon to green and comment to "Everything's OK")
  5.     )
  6. )
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #8 on: February 03, 2015, 10:12:07 AM »
Code - Auto/Visual Lisp: [Select]
  1. (acet-ui-message "Stop icon. Button OK" "Alert" 16)
  2. (acet-ui-message "Stop icon. Button OK-CANCEL" "Alert" 17)
  3. (acet-ui-message "Stop icon. Button ABORT-RETRY-IGNORE" "Alert" 18)
  4. (acet-ui-message "Stop icon. Button YES-NO-CANCEL" "Alert" 19)
  5. (acet-ui-message "Stop icon. Button YES-NO" "Alert" 20)
  6. (acet-ui-message "Stop icon. Button RETRY-CANCEL" "Alert" 21)
  7.  
  8. (acet-ui-message "Question icon. Button OK" "Alert" 32)
  9. (acet-ui-message "Question icon. Button OK-CANCEL" "Alert" 33)
  10. (acet-ui-message "Question icon. Button ABORT-RETRY-IGNORE" "Alert" 34)
  11. (acet-ui-message "Question icon. Button YES-NO-CANCEL" "Alert" 35)
  12. (acet-ui-message "Question icon. Button YES-NO" "Alert" 36)
  13. (acet-ui-message "Question icon. Button RETRY-CANCEL" "Alert" 37)
  14.  
  15. (acet-ui-message "Warning icon. Button OK" "Alert" 48)
  16. (acet-ui-message "Warning icon. Button OK-CANCEL" "Alert" 49)
  17. (acet-ui-message "Warning icon. Button ABORT-RETRY-IGNORE" "Alert" 50)
  18. (acet-ui-message "Warning icon. Button YES-NO-CANCEL" "Alert" 51)
  19. (acet-ui-message "Warning icon. Button YES-NO" "Alert" 52)
  20. (acet-ui-message "Warning icon. Button RETRY-CANCEL" "Alert" 53)
  21.  
  22. (acet-ui-message "Information icon. Button OK" "Alert" 64)
  23. (acet-ui-message "Information icon. Button OK-CANCEL" "Alert" 65)
  24. (acet-ui-message "Information icon. Button ABORT-RETRY-IGNORE" "Alert" 66)
  25. (acet-ui-message "Information icon. Button YES-NO-CANCEL" "Alert" 67)
  26. (acet-ui-message "Information icon. Button YES-NO" "Alert" 68)
  27. (acet-ui-message "Information icon. Button RETRY-CANCEL" "Alert" 69)
  28.  

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #9 on: February 03, 2015, 10:32:43 AM »

Peter2

  • Swamp Rat
  • Posts: 654
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #10 on: February 03, 2015, 11:00:41 AM »
 :? As if I see it right the solutions from Lee Mac and ElpanovEvgeniy are messages from inside AutoCAD, but not to display and to select icons from Exe, Dlls and so on??
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #11 on: February 03, 2015, 11:30:09 AM »
Peter, why not eliminate the icon selection altogether and just hardcode various desktop.ini files (or allow end users to change it via some configuration setting). I don't have a solution for icon selection, but it would be interesting to figure out how this could be done with OpenDCL.

BlackBox

  • King Gator
  • Posts: 3770
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #12 on: February 03, 2015, 12:19:35 PM »
Peter, why not eliminate the icon selection altogether and just hardcode various desktop.ini files (or allow end users to change it via some configuration setting).

1+

I feel the same, given the code description here; just identify the different 'status' levels you need for your work, and hard-code those pseudo 'red, yellow, green' procedures accordingly.

Having self-described 'low level users' spend time picking out which icon they feel is pretty each-and-every-single time they invoke this command seems to me, a waste of production time.

Cheers
"How we think determines what we do, and what we do determines what we get."

Peter2

  • Swamp Rat
  • Posts: 654
Re: Use "Windows Icon Selector" via AutoLisp
« Reply #13 on: February 03, 2015, 02:11:59 PM »
...why not eliminate the icon selection altogether ....
Yeah - it seem to be the best solution now. As always I hoped for a plug-and-play-three-line-code, but it obviously does not exist.

In Lees linked code there is a usage of "wscript.shell", but the original target is a long way.

Thanks for all contributions.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23