WTS Posted June 19, 2006 Share Posted June 19, 2006 Hello forumers.. I've been at autoit for weeks and I'm loving it, very addiction! I have a quick question I couldn't find in the help file.. How do I get a running process location, and icon? Link to comment Share on other sites More sharing options...
Freeze128 Posted June 19, 2006 Share Posted June 19, 2006 I'm not sure what you mean by "location" of a running process, but you can get the Process ID of a process (WinGetProcess). I have a project myself that would benefit from the ability to get the icon from a window (WinGetIcon?), but I'm not really sure how it would be stored so I could use it in my script. Every open window has an icon on the title bar, and it makes sense that the icons would have to be stored in memory somewhere, simply because the windows may need to be re-drawn at a moments notice. From what I can tell, AutoIt can display icons when they are referred to in one of two ways: 1. By filename and icon offset 2. As bitmap by filename. So far, there is no easy way that I know of to have any of the autoit functions draw an icon that is already stored somewhere in memory. Does anyone have any different exerience? Link to comment Share on other sites More sharing options...
Valuater Posted June 19, 2006 Share Posted June 19, 2006 (edited) to answer freeze $Button = GUICtrlCreateButton("", 100, 35, 73, 41, $BS_ICON) GUICtrlSetImage(-1, "my_File.exe") and $nPathButton= GUICtrlCreateButton("...", 410, 2, 25, 20, BitOr($BS_ICON, $BS_FLAT)) GUICtrlSetImage(-1, "shell32.dll", 3, 0) will set the icon of that exe on the button 8) Edited June 19, 2006 by Valuater Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 19, 2006 Moderators Share Posted June 19, 2006 http://www.autoitscript.com/forum/index.ph...ndpost&p=113711 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 More sharing options...
Freeze128 Posted June 20, 2006 Share Posted June 20, 2006 to answer freeze $Button = GUICtrlCreateButton("", 100, 35, 73, 41, $BS_ICON) GUICtrlSetImage(-1, "my_File.exe") and $nPathButton= GUICtrlCreateButton("...", 410, 2, 25, 20, BitOr($BS_ICON, $BS_FLAT)) GUICtrlSetImage(-1, "shell32.dll", 3, 0) will set the icon of that exe on the button 8) Yes, I knew that. In the examples you gave, the icon is stored in a file. But what if I wanted to display an icon and I didn't know the name of it's file, or what it's icon location in the file would be? Say that I just know that a currently open window has an icon on the left side of the title bar, and I want to display that icon along with the window title as a listview item. This would be mainly for use as a replacement to Task Manager, where it would list all the applications and their icons. Link to comment Share on other sites More sharing options...
marfdaman Posted June 20, 2006 Share Posted June 20, 2006 Yes this is something I would like to know as well...how to get the window/process icon without knowing beforehand what file it is. Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Skruge Posted June 20, 2006 Share Posted June 20, 2006 gafrost posted a nice script here that accomplishes what you're looking for (minus the icons, which others have already helped you with).Note that it was written in an older beta version, so get the latest version and change these lines:DLLStructDelete($Process) to this:$Process=0Good luck! [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now