GoogleDude Posted February 23, 2008 Posted February 23, 2008 This stuff just gets better and better. Thanks a ton! Pretty soon il know what im doing!
Holger Posted February 23, 2008 Author Posted February 23, 2008 (edited) Update 23./24.02.2008- Fixed: GDI object overload when bold font is usedEveryone who is using a "Default" menu item (state: $GUI_DEFBUTTON - which is drawn with bold font) should update! GreetsHolger Edited February 24, 2008 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Achilles Posted February 24, 2008 Posted February 24, 2008 Update 23./24.02.2008- Fixed: GDI object overload when bold font is usedEveryone who is using a "Default" menu item (state: $GUI_DEFBUTTON - which is drawn with bold font) should update! GreetsHolgerSweet, thanks for these great function... I'm planning on updating Multiple Desktops to have a menu using this... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Achilles Posted February 25, 2008 Posted February 25, 2008 (edited) After using AutoIt 3.2.11.0 I'm getting tons of errors... Lots more errors with previously declared constants and undefined @unicode macro. Edit: Also, could this work with on event some how? I tried TrayItemSetOnEvent just in case, but as I expected it didn't work. Edited February 25, 2008 by Achilles My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
GoogleDude Posted February 28, 2008 Posted February 28, 2008 Edit: Also, could this work with on event some how? I tried TrayItemSetOnEvent just in case, but as I expected it didn't work.I feel your pain. I have a lot of Tray and GUI based Scripts that are based on EventMode and thus far I had to re-write a lot of code to get it to work with the icons and images. But nice UDF none-the-less.GoogleDude
Holger Posted February 28, 2008 Author Posted February 28, 2008 (edited) Ok, one more time: the whole thing uses the GUI message procedure so if you want to use any commands for the items you have to use the GUI commands.So, use GUICtrlSetOnEvent here. With the next changes I will also include a "GUIOnEvent"-sample too. For the @Unicode problem you could try something like: If @AutoitVersion <= "3.2.10.0" Then $bUnicode = @Unicode Else $bUnicode = @AutoItUnicode EndIf Just insert it at the beginning of the "ModernMenu(Raw).au3" and replace all other "@Unicode" with "$bUnicode". However, the au3check will fail of the unknown macro. Just ignore that messages. Greets Holger Edited February 28, 2008 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
redsleeves Posted March 14, 2008 Posted March 14, 2008 This is a great script and I'm still playing with and learning from it. Are there any plans to include more than the two states available in "_TrayIconSetState()"? "TraySetState" has five possible states including show, hide, flash, stop flashing and reset; will these be incorporated here? Or am I completely off? What I am trying to do is test a condition that when false will cause the tray icon to flash until the condition tests true. Right now I am just cycling between the icon set in "_TrayIconCreate()" and an icon that is completely transparent set with "_TrayIconSetIcon()". "_TrayIconSetState($nTrayIcon1, 2)" creates a hole in the tray while the transparent one leaves an empty space. Is there is an easier way to accomplish this? Thank you.
GoogleDude Posted March 16, 2008 Posted March 16, 2008 Are there any plans to include more than the two states available in "_TrayIconSetState()"? "TraySetState" has five possible states including show, hide, flash, stop flashing and reset; will these be incorporated here? Or am I completely off?I like that Idea. I second that! (Kinda wish I had the AutoIt Skills to make those types of changes myself).GoogleDude
redsleeves Posted March 17, 2008 Posted March 17, 2008 I program PLC's and other types of industrial controls for a living so I'm kind of like the fat kid thrashing around in the deep end here; please forgive my ignorance. I really don't do Windows either so this has been both fun and painful; kind of like getting a lap dance from a 300 pound stripper. The NotifyIconData structure is used to pass pointers to the Shell_NotifyIcon function in Shell32.dll. $NIM_MODIFY, $NIM_ADD and $NIM_DELETE already exist but you have only defined $NIM_ADD = 1 and $NIM_DELETE = 2. Is this correct? I am trying to understand this so I can learn from it. I have been playing with this for days now and have been able to absorb quite a bit more than when I first started. As I had mentioned in a previous post, I am able to cycle a transparent icon with the default icon to simulate the icon flashing. Is this really all that $NIM_MODIFY would potentially do or is there more that I am missing? Thank you for your efforts.
nickston Posted March 21, 2008 Posted March 21, 2008 Hi outthere here is my script-stuff to create ownerdrawn menuitems with icons and colors.It uses GUIRegisterMsg() and WM_DRAWITEM / WM_MEASUREITEM - messages proceeding.Feel free to read/modify/delete it Hi, Holger. Your script have some bugs:1) The array $arMenuItems is constantly grown up. ie if I will dinamic create several Trays (or menu and so on) programm will crash because limit of items is equal 40002) The array $arMenuItems is constantly grown up, and he is don't clean up then if I in the beginning is create some tray and then destroy them, and again I is create tray like first he will not wokring.3) And in the end this MODERN MENU is good thing, but this is not good work with dinamic trays. In this case raise some bugs in addition to 1 and 2 point, which I didn't determine for the present/
MrCreatoR Posted March 21, 2008 Posted March 21, 2008 The array $arMenuItems is constantly grown upNope, the last version (and all the previouse if i am not wrong) have predefined the size of items array: ; Store here the ID/Text/IconIndex/ParentMenu/Tray/SelIconIndex Global $arMenuItems[4000][7] $arMenuItems[0][0] = 0 programm will crash because limit of items is equal 4000It crashes because the array have reached the created number of elements. You could create a dinamycaly array, as i did in the GetFolderToMenu UDF. and he is don't clean up then if I in the beginning is create some tray and then destroy them, and again I is create tray like first he will not wokring.I think for that purposes there is need to set the main array ($arMenuItems) dynamicly, and create a functions like _TrayDeleteMenu(), _TrayDeleteItem(), _GUICtrlDeleteODMenu(), _GUICtrlDeleteODMenuItem() - in those functions ReDim the array as needed (searching thru array for needed id/handle)...  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team
Holger Posted March 21, 2008 Author Posted March 21, 2008 Already in progress... (even how can someone has so much items in a _menu_, I understand for _some_ dynamics ie. recent files or something but for a normal menu...how knows... ) Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
nickston Posted March 21, 2008 Posted March 21, 2008 Nope, the last version (and all the previouse if i am not wrong) have predefined the size of items array: ; Store here the ID/Text/IconIndex/ParentMenu/Tray/SelIconIndex Global $arMenuItems[4000][7] $arMenuItems[0][0] = 0 Yes. I will a few not accurately, I mean counter of items in this array grown up and never grown down or clear array or rebuild array. This fact will raise crash. I think for that purposes there is need to set the main array ($arMenuItems) dynamicly, and create a functions like _TrayDeleteMenu(), _TrayDeleteItem(), _GUICtrlDeleteODMenu(), _GUICtrlDeleteODMenuItem() - in those functions ReDim the array as needed (searching thru array for needed id/handle)...Again You read my mind. Or in other side, searching items in array from end of array instead of searching from begin. I describe situation in which program will crash, and for present moment I don't know where is bug. I can only exactly say what bug placed not in my script. My program dinamicaly create "Trays". At first, tray all looks good and work with no problem. Secondly, visual can be damaged, I add script which clear $arMenuItems and solve this problem. But some buttons can work and some can raise crash. Why?
MrCreatoR Posted March 21, 2008 Posted March 21, 2008 Already in progress...Good news Holger!searching items in array from end of array instead of searching from begin.I don't think there is a different, any way the array must be changed if the id/handle is found.  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team
Holger Posted March 21, 2008 Author Posted March 21, 2008 Update: 21.03.2008- Changed: dynamic array sizing of the saved menu items- Added: _TrayDeleteItem(menuID), _GUICtrlODMenuItemDelete($nID) - please delete (tray) menu (items) with these commands- Added: _TrayIconSetState() modes 4 and 8 for flashing and flashstopping of tray icons- Added: _SetFlashTimeOut([timeOut]) to set the flash timeout- Added: OnEvent samplePlease let me know about problems and suggestions.Greets Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
nickston Posted March 22, 2008 Posted March 22, 2008 Good news Holger!I don't think there is a different, any way the array must be changed if the id/handle is found.It's a big difference. Items having similar id are stored periodically, but have different order number. Search finds the first coincidence of id in array, but real id is stored much long away in this array.If search begins from the end then will find real id.
nickston Posted March 22, 2008 Posted March 22, 2008 Update: 21.03.2008 - Changed: dynamic array sizing of the saved menu items - Added: _TrayDeleteItem(menuID), _GUICtrlODMenuItemDelete($nID) - please delete (tray) menu (items) with these commands - Added: _TrayIconSetState() modes 4 and 8 for flashing and flashstopping of tray icons - Added: _SetFlashTimeOut([timeOut]) to set the flash timeout - Added: OnEvent sample Please let me know about problems and suggestions. Greets Holger That's good news. I will try these changes.
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