IanN1990 Posted November 21, 2012 Share Posted November 21, 2012 Orginally this code was in its own exe, so when the exe closed then all the memory / varaibles and such get realeased. But now it is merged into code that runs 24/7. The idea behind this code is to display two menus "Menu 1 and 2", wait 2.5 seconds, delete the menus and then re-make them with new menu names #NoTrayIcon #include Local $ContextMenu Local $MainContextMenu $ContextMenu = GUICreate('',0, 0, 0, 0, -2147483648, 128) $MainContextMenu = GUICtrlCreateContextMenu() _GUICtrlMenu_SetMenuStyle(GUICtrlGetHandle($MainContextMenu), BitXOR(_GUICtrlMenu_GetMenuStyle(GUICtrlGetHandle($MainContextMenu)), $MNS_MODELESS)) GUICtrlCreateMenuItem("Menu 1", $MainContextMenu) GUICtrlCreateMenuItem("Menu 2", $MainContextMenu) ControlClick("", "", $ContextMenu, "Right", 1, 0, 0) sleep(2500) ; Delay GUIDelete($ContextMenu) GUICtrlDelete($MainContextMenu) sleep(2500) ; Delay $ContextMenu = GUICreate('',0, 0, 0, 0, -2147483648, 128) $MainContextMenu = GUICtrlCreateContextMenu() _GUICtrlMenu_SetMenuStyle(GUICtrlGetHandle($MainContextMenu), BitXOR(_GUICtrlMenu_GetMenuStyle(GUICtrlGetHandle($MainContextMenu)), $MNS_MODELESS)) GUICtrlCreateMenuItem("Menu 3", $MainContextMenu) GUICtrlCreateMenuItem("Menu 4", $MainContextMenu) ControlClick("", "", $ContextMenu, "Right", 1, 0, 0) sleep(2500) ;Delay The first Menu is made, and it does delete but the second never appears. So am i doing something wrong ? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 21, 2012 Moderators Share Posted November 21, 2012 Have you tried just naming your variables differently? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
IanN1990 Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) Not really an option. The full code is alot more complex, but basicly when the context menu is run depending on how the user interacts with it. It will add alot more menus 2 do it. So when the menu is finished, if these are not cleared away then the next time the menu is opened, it would still have all the lasted opened menus showing rather then just showing the default ones *Edit, Ok it is a option ^^ but one i would rather avoid. As it means the longer the code is run, and the more items are being stored in unused varaibles have no purpose as they should be deleted once the menu is finished. Edited November 21, 2012 by IanN1990 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