I have learned how to use TraySetIcon icon and toggle between icons that I added as resources using
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files (x86)\AutoIt3\Icons\au3.ico My current work around is
Doit() Func Doit() Local $TestIcon = @ScriptDir&"\Test.ico" Local $ProdIcon = @ScriptDir&"\Prod.ico" Local $Test = "Test" Local $Prod = "Prod" Local $Current = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program","Location") If $Current = $Prod Then FileCreateShortcut($Test,@DesktopCommonDir&"\TestLink.lnky",Default,Default,"Test Link",$TestIcon) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program",$Test) Else FileCreateShortcut($Test,@DesktopCommonDir&"\TestLink.lnky",Default,Default,"Test Link",$ProdIcon) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program",$Prod) EndIf EndFunc I did a bit of quick cutting, from my working program. Basically it creates an link on the desktop, and then deletes it and creates a new one each time it is run. If you where wondering, I made it a .lnky file so that I could add a custom right click menu for it.
This example came from a something I am using to switch between prod and test environments, so the actual link created does not launch the script. You can right-click on the link and run the script to change environments. The icon lets me know at a glance which environment I am currently set for.
What I am trying to figure out is if there is a way to change the icon of the executable of the script only using the resources compiled within that script. What would be nice would be to have a ScriptSetIcon function.
Not the most eloquent nor efficient, to be sure, but with the following functionality:
MULTI_BAR Features: ----------------------------------------------------------------
* Floating MULTIBAR Toolbar with four(4) Docking Positions
* Drag MULTI bar to Dock at any Edge position
* Drag Edge bar to screen center to Float as a MULTI bar
* FADING EDGE BARS for LEFT, TOP-LEFT, TOP-RIGHT, RIGHT Sides
* All 4 EDGE BARS and MULTI BAR can exist and execute at one time
* All Toolbars use common INI file format
* Any Toolbar can be displayed by any positional Service EXE
* All ToolBars have common Controls
Return to calling BAR [ORIGIN}
Manual Edit the INI file [INIEDIT]
Create and place a NEW Toolbar on a button [NEWBAR]
Search Icon Initiator - search for a Toolbar or a Button Function
Set AUTO mode for EDGE bar show/fade on cursor or click, [AUTOSW]
Set AUTO mode for FLOAT bar to close or stay open on button click [AUTOSW]
Rotate thru 3 button sizes, small, medium and large w/label [B-SIZE]
EXIT this bar [EXIT]
* User specifies Number of BUTTONS and Number of ROWS
* Change Dynamically Number of BUTTONS or ROWS
via NEWBAR Function Specifying SAME BARNAME with Changed BUTTONS & ROWS
* Three(3) Button sizes - User can change on demand
* Shrink to Fit - Will Auto reduce Button size on DOCKING if Bar too long
* Buttons can be any File OPEN function, web link, or Open another TOOLBAR_BAR
* ToolBars can be cascaded down(DRILL DOWN - Button points to another ToolBar) to additional Toolbars
with Return to previous Toolbar via Origin Function
* 2 BAR TYPES:
ACTION(Buttons do TOOLBAR, FILE or URL OPENS)
User drops a Link on Button
DROP(Buttons are Folder Targets)dropped files are sorted to destination
MOVE or COPY: FILE, FILE(s) or FOLDERS(DIRs) to Button target
Recycle Bin(a Shortcut) is supported as a DROP target for FILE, FILE(s) or FOLDERs
* Button Context functions
DELETE the current function - empty the button
EDIT the TOOLTIP for this Button
EDIT the LABEL displayed on Large Button
PLUCK this Button for move to new location on this bar -or-
ANY other Bar (in this TOOLBOX)
PLACE any PLUCKED Button, or PLACE any NEW TOOL_BAR
OPEN file location of Button file
UNZIP the attached to a folder which will be the folder for all toolbar definitions
and executables. THIS FOLDER IS YOUR TOOLBOX.
TOOLBOX\MULTIBAR\]README.doc or ]README.pdf provides detail on functions and implementing.
Appreciate all the SILENT help from the AUTOIT community for this and my many projects. Thanks to all menbers who have provided the best self help book on applied AutoIt.
Please advise on errors or suggestions. MULTIBAR was developed on Windows 10. Other targets or themes may present errors.For your personal use. Accept no responsibility for its functionality. Enjoy, olbitpicker
Good evening guys,
i'm having a problem, not about the code (i'm only thinking about it at the moment) but about the way i can do it.
I have a webpage (photo N.1) it has some elements in it.
I need only the table (photo N.2), looking at the code and with _IEFunctions i can easy find the table but how i can i "copy" it?
As i said it's really easy to found with a script but what should i do then? Copy the source? And how can i display it to the user?
In my head i'd like to display it inside a GUI, is that possible?
Thanks in advance
Edit: Posted 2 times same photo. Now should be OK
I have a working program currently driven largely through menu selections. I would like to add a toolbar where most of the tollbar button actions are basically the same as menu items, but quicker to access. I have been wading around in toolbar examples, MSDN pages etc, it's clearly going to be a bit of a slog to get everything right, including tooltips etc. I thought I would start with something simple to prove the principle.
Using bits from the help file examples I have a small program that successfully displays a toolbar. However, what seemed like the most elegant way to deal with the button commands does not seem to work. My understanding was that a toolbar button fires a WM_COMMAND message, with the command Id set by the second parameter in the call to
_GUICtrlToolbar_AddButton ( $hWnd, $iID, $iImage)
so I though it would be a good idea to set this Id to the same value as my menu item Id; then it would run the same task which is what I wanted. This did not work. I am using message loop mode and would like to stick with this because some of my scripts run hardware at the same time as the gui; it is easier if I don't have to worry about code being interrupted with the hardware in an unknown state . So I added a handler for WM_COMMAND, with some cribbed display code to try and see why. The toolbar button defintely fired a WM_COMMAND message and the Id looked the same, so no explanation there.
I guess the issue is with GUIGetMsg() which may be constructed to ignore all but a limited number of control handles, i.e. those made with the GuiCtrlCreate... commands; this is speculation.
I would dearly love to find a tidy way to get around this. Having some controls handled in the message loop and some in a WM_COMMAND handler, performing the same task, feels ugly. I would be very grateful for further insight from someone experienced with handling a toolbar. Perhaps I should be trying to fire the menu item. I have attached a code snippet to try and illustrate the issue.
I came here with maybe too specific questions about uncommon things, but as people says, I don't lose anything trying to asking here
There's long time that I have a little "experimental" idea: Use windows desktop and it icon system like old videogame consoles (where "sprites" are used to draw things on screen, can be manipulated/animated to make interesting things happen). Some of that inspiration came from another experiments from demoscene.
Researching the possibilities of doing something like that (maybe not so intense) I found that the Windows Desktop uses a GuiListView to show and arrange icons (and of course, AutoIt provides UDF's for that ). So, I'm used that UDF to create dummy icons (not putting files on Desktop, just modifiying the "GUI layer" of desktop for put non-working icons), setting custom values like coordinates, name and Icon (from a list of loaded icons in the GuiListView). As you can see in next image works well in Windows XP... even in Windows 95 (that's not the case from Windows Vista to 10, but I already posted another question here about that... anyways, for now I'm working that with a isolated XP machine... sigh).
Another video doing an animation with that:
How I make that custom icons? Here:
$hWnd = ControlGetHandle("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]") $newItem = _GUICtrlListView_AddItem ( $hWnd, "TEST", 32 ) ; with an icon of index 32 _GUICtrlListView_SetItemPosition ( $hWnd, $newItem, 300, 300 ) ; set some example property. Put in X=300 Y=300 Okay, so the next phase was changing the icons with custom ones. And here starts the issues. As AutoIT help says, icons from GuiListView came from a loaded GUIImageList, which, seeing past images I conclude that it's already preloaded with some sort of most used icons (something like an icon cache?). But If I modify it (or create another GUIImageList and then put into the GuiListView) the icons became corrupted and replaced with blank ones. (can be reverted deleting IconCache.db, just like when windows shows wrong icons in desktop).
How I change icons? Here
$hImage = _GUIImageList_Create(48, 48, 5) ; create an image list for 48x48 icons $newIcon = _GUIImageList_AddIcon($imageList, @SystemDir & "\shell32.dll", 110) ; just adding a new icon in the image list _GUICtrlListView_SetImageList($hWnd, $hImage, 0) ; $hwnd is the desktop hwnd Another option as workaround for setting icons was getting the desktop GUIImageList, and modifiyng it directly. I otbtain a GUIImageList handle, but ... without any images inside! (That's strange beacuse, when I set desktop item icons without altering the GUIImageList, it applies correctly). And finally if I try to add new ones, it returns -1 with @error setted.
How I'm trying to get desktop GUIImageList? Here.
$imageList = _GUICtrlListView_GetImageList ( $hWnd, 0 ) MsgBox(0,_GUIImageList_GetImageCount ( $imageList ), $imageList) ; getting image count and GUIImageList handle $newIcon = _GUIImageList_AddIcon($imageList, @SystemDir & "\shell32.dll", 110) ; adding icons without success So, what is the question? There's something wrong I'm doing while trying to set the new icon set on desktop? Or desktop icons work in different way than the rest of the GuiListView's? Or there's something really stupid that I can't saw before that corrupts the icons?
Also... if there's not known solution for that, do you have some idea for doing a workaround for that? Or another crazy idea? (Maybe putting real files instead dummy icons could be a solution ... a very slow one). Or even maybe (maybe not, I sure about that xD) do you want to help with this "experiment".
Thanks in advance, have a good day