[Solved] Getting Access violation with AddTrayIcon
Moderators: Dorian (MJT support), JRL
Re: Getting Access violation with AddTrayIcon
It says Error in : test1
Line: 10 - Error in ModTrayIcon
Line: 10 - Error in ModTrayIcon
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Getting Access violation with AddTrayIcon
It could be the new .ico file isn't compatible. Are you able to use the new .ico file at the outset? I.e. take the second icon file that you are trying to use in ModTrayIcon and use that in the initial AddTrayIcon command. Does it work?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Getting Access violation with AddTrayIcon
Ok it worked after using a different icon on the one that was not working
Now to get clicking on ModTrayIcon to popup and also display help function at bottom.
Going to uninstall and reinstall now,
Now to get clicking on ModTrayIcon to popup and also display help function at bottom.
Going to uninstall and reinstall now,
Re: Getting Access violation with AddTrayIcon
No luck with that one - does not popup after remove + reinstall
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Getting Access violation with AddTrayIcon
I'm not sure what you are trying to do. Can you explain and provide code?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Getting Access violation with AddTrayIcon
Are you trying to create a popup menu and have it pop up when you click on the icon? If so maybe this example will help:
Code: Select all
AddTrayIcon>C:\Users\Marcus\Documents\16x16icons\ico\1.ico,newICO,click me
AddTrayHandler>newICO,OnClick,DoPopup
//Idle loop to stop macro exiting before I can do anything ...
Label>idle_loop
Wait>0.02
Goto>idle_loop
SRT>DoPopup
Let>Items=Open;Close;About;Exit
GetCursorPos>X,Y
PopupMenu>X,Y,Items,res
MessageModal>You selected item: %res%
END>DoPopup
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Getting Access violation with AddTrayIcon
I will get a couple of screenshots
Re: Getting Access violation with AddTrayIcon
Hi Marcus,
The screenshots is not working, but I will explain again:
When inside a project & Code Builders Tab is activated, under Miscellaneous when left clicking on KillProcess, it gives a new Code Bulder Window with Command reference, Insert & Cancel buttons.
Now close that window and back to Code Builders Tab when hovering over KillProcess ,a small white popup comes up with Terminates a process text.
Now moving the mouse down to ModTrayIcon just beneath and clicking on it, nothing happens and there is also no white little popup, but move the cursor to next one down is PlayWav and the white popup reappears and clicking on it gives a window popup with Wav File: and buttons.
Sorry I hope my explanation is more clear now
The screenshots is not working, but I will explain again:
When inside a project & Code Builders Tab is activated, under Miscellaneous when left clicking on KillProcess, it gives a new Code Bulder Window with Command reference, Insert & Cancel buttons.
Now close that window and back to Code Builders Tab when hovering over KillProcess ,a small white popup comes up with Terminates a process text.
Now moving the mouse down to ModTrayIcon just beneath and clicking on it, nothing happens and there is also no white little popup, but move the cursor to next one down is PlayWav and the white popup reappears and clicking on it gives a window popup with Wav File: and buttons.
Sorry I hope my explanation is more clear now
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Getting Access violation with AddTrayIcon
Right that has nothing to do with your code! I thought you were talking about getting your own pop up menu to work on your own icon.
This is the code builder / syntax highlighter / syntax helper. It is just the editor and does not prevent it from working.
I already explained that all this means is that the function definitions are missing from the EDITOR syntax helper. This just a code builder and DOES NOT AFFECT ITS USE. You will just have to write the code manually.
However, I have now fixed it in 14.4.10.
This is the code builder / syntax highlighter / syntax helper. It is just the editor and does not prevent it from working.
I already explained that all this means is that the function definitions are missing from the EDITOR syntax helper. This just a code builder and DOES NOT AFFECT ITS USE. You will just have to write the code manually.
However, I have now fixed it in 14.4.10.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Getting Access violation with AddTrayIcon
My apologies for that misunderstanding.
Re: Getting Access violation with AddTrayIcon
Got it working 100% now as required:
Thank you Marcus
Code: Select all
Let>z=0
AddTrayIcon>C:\Users\John\Documents\Macro Scheduler 14\scan.ico,ClickOutlook,z
AddTrayHandler>ClickOutlook,OnClick,DoPopup
While>z<1000
WaitWindowOpen>Security Alert
//Clicks on annoying Outlook Security Alerts & counts them
UIClick>{"Security Alert"},{"Yes"}
Let>z=z+1
//When holding mouse over icon the clicked amount is displayed
ModTrayIcon>ClickOutlook,z,,True
EndWhile
//Adds option to easy exit
SRT>DoPopup
//Let>Items=Open;Close;About;Exit
Let>Items=Exit
GetCursorPos>X,Y
PopupMenu>X,Y,Items,res
If>%res%=0
Exit
Endif
END>DoPopup
Re: [Solved] Getting Access violation with AddTrayIcon
Update: I noticed the app was running at about 3% in Win Task manager and replaced the WaitWindowOpen with IfWindowOpen with a delay of 100ms and it's resource usage went below 1%:
Code: Select all
Let>z=0
Let>x=0
AddTrayIcon>C:\Users\John\Documents\Macro Scheduler 14\scan.ico,ClickOutlook,x
AddTrayHandler>ClickOutlook,OnClick,DoPopup
While>z=0
//Clicks on annoying Outlook Security Alerts & counts them
IfWindowOpen>Security Alert
UIClick>{"Security Alert"},{"Yes"}
Let>x=x+1
Endif
Wait>0.1
//When holding mouse over icon the clicked amount is displayed
ModTrayIcon>ClickOutlook,x,,True
EndWhile
//Adds option to exit with left click
SRT>DoPopup
//Let>Items=Open;Close;About;Exit
Let>Items=Exit
GetCursorPos>X,Y
PopupMenu>X,Y,Items,res
If>%res%=0
Exit
Endif
END>DoPopup