Jump to content

Graphics Assist


Dutchman
 Share

Recommended Posts

I have a small icon made from a photograph of my printer. I would like to actively change the color of this desktop printer icon based upon the state of my printer. Darkened for printer off, Normal for printer on, Green for printing, yellow for printer paper out, and red for printer jam.

Assuming I can figure out how to capture the state of the printer, and using Autoit, how can I actively manipulate the colors and alpha channels for the icon while its still displayed on screen? At some point I'd like to have the icon spit out a miniature peice of paper that then fades into the desktop while printing.

I rather have this instead of a taskbar icon that could tell me the same info. This will be the front end of my drag and drop printer script.

Link to comment
Share on other sites

  • Moderators

Are you using a GUI?

If $condition[1] = True Then 
    GUICtrlDelete($icon[1])
    $icon[2] = GUICtrlCreateIcon()
EndIf

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

My intention is to not have a GUI beyond the Icon. There is no text/numerical data to pass back to the user. I want the icon to be both the input control and its changing color/behavior as its output. Is this possible with auto-it or do I really need to build a widget with xml and javascript? If I did, would I be able to exchange info between java script and Autoit? Am I way over my head here?

Link to comment
Share on other sites

My intention is to not have a GUI beyond the Icon.

In windows, PE icons are stored as a resource internal to the PE. You describe attempting to modify the embedded resource while the program is running. Perhaps possible, but certainly not a great task for a novice.

This is one thing that system tray icons are great at. However, if you are determined that you want a desktop icon to change based on external criteria, you may find an easier route would be to modify the icon referenced in a windows shortcut to your app.

Either of these methodologies would be markedly easier than the approach outlined.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

The trashcan is an icon capable of displaying several states. We know that by changing the icon image through style changes, we affect the way the image conveys information. We do know that is possible. So lets say we alter the trashcan program, that we add 5 or 6 more state icon displays, and when we drag and drop our list of files to them, a looped script restores them, one by one, but not before printing them. Our net result: We didn't need an input box, our icon told us what was going on graphically by displaying 1 or more states, and our output was a printed file. Goal achieved.

This of course leads to the next question; Can we have more than one but seperate trashcans on a desktop, and can we modify it to display more than one state? Is trashcan a program? Hmmmm....

Any feedback on my ramblings would be appreciated.

Thx

Link to comment
Share on other sites

Maybe this gives you an idea (not the best I know :o )

While 1
    FileCreateShortCut(@WindowsDir & '\Explorer.exe', @DesktopDir & '\TestShortCut.lnk', @WindowsDir, '', '', @SystemDir & '\shell32.dll', '', Random(0, 96, 1))
    Sleep(2000)
WEnd
Link to comment
Share on other sites

@dutchman

The recycle bin icon is not an executable program. To prove this to yourself attempt to drag an executable program onto ResHack ( link included in your scite4autoit distro), then attempt the same thing w/ the recycle bin icon.

Why and how is it different, and how does the Recycle Bin work??? Beyond the scope of an Autoit forum. I went into depth as to why what you are trying to do would be hard, and gave you two ways of doing it easy.... heck, Holger even gave you the code for the "use a shortcut" method ...

You've got two suggested ways of performing your task, one w/ a desktop icon, and one using the SystemTray Icon, someone else noted that you could write an Icon Shaped GUI, pick a method and code it already.

Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

I'm disappointed by the last post. This is my journey, let me walk it, at my own pace, with my own handicaps. Trying to control and limit someone elses project and education is really beyond the scope of the autoit forum. If any discussion, leading to a clearer understanding a software systems, through destruction of my underlying myths and misguided metaphors, is being suppressed as "outside the scope," then what do you honestly hope to accomplish here. If you don't wish to contribute to this topic then by all means, move along. Thanks for your assistance already provided. I'll get to using it in earnest, shortly.

Link to comment
Share on other sites

I'm disappointed by the last post.

Sorry you're offended. However, the last time I looked, the forum was labeled:

AutoIt Forums > AutoIt v3 > v3 Support

If you want help with understanding windows internals and esoteric explorer functionality, you would be far better served to go browse MSDN and the windows api groups.

To an end user, does it *really* matter if you change the icon property of a shortcut or dynamically modify the actual icon of the application? Of course not. As long as you properly change the icon and refresh the desktop, the user won't know or care HOW you did it. You have received answers enabling you to achieve the result you have specified with autoit. If the approach is a bit different,...well... we often have to make compromises based on the tools we have at our disposal. I'm not above getting a piece of popcorn out of my teeth with a fingernail or ballpoint pen if I don't have a toothpick handy.

I wish you the best in implementing a solution you're happy with.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...