Jump to content

GUI/Tray Menu with icons and colors


Holger
 Share

Recommended Posts

If there are any problems (cause maybe of the internal changes) just please let me know.

Just one little syntax mistake :D , i sure it's just a typo :P

ModernMenu.au3(1521,37) : ERROR: syntax error

Local $hFont = CreateFont($nHeight,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: 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 Program

AutoIt_Icon_small.pngUDFs: 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
 
AutoIt_Icon_small.pngExamples: 
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 AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Just one little syntax mistake :D , i sure it's just a typo :P

I could be wrong but I think it should be

Local $hFont = CreateFont($nHeight, _

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I could be wrong but I think it should be

Local $hFont = CreateFont($nHeight, _

You are not wrong :D

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: 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 Program

AutoIt_Icon_small.pngUDFs: 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
 
AutoIt_Icon_small.pngExamples: 
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 AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

You are not wrong :D

I hope that equates to I am right because I changed my copy and haven't tested it yet.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Update 12.01.2008-2:

- Fixed: Missing underscore in "CreateMenuFontByName"-function (Font fallback function) (thanks to MsCreatoR and GEOSoft).

- Changed: If a menuitem is disabled then the rect only is showing around the item

- Added: Underscore in menutext only showing when pressing "Alt"-key

Greets

Holger

Edited by Holger
Link to comment
Share on other sites

Holger,

It seems to error our even if IsDeclared is used:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Projects\Project.AU3\Pro-S_Hardware_Professional\pro-s_hardware_installer_2.0.0.17.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>21:01:43 Starting AutoIt3Wrapper v.1.9.5.2 Environment(Language:0409 Keyboard:00000415 OS:WIN_XP/Service Pack 2 CPU:X86)

>Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3

C:\Projects\Project.AU3\Includes\ModernMenu.au3(7,70) : ERROR: $ILC_MASK previously declared as a 'Const'

If Not IsDeclared("ILC_MASK") Then Global Const $ILC_MASK = 0x0001

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Projects\Project.AU3\Includes\ModernMenu.au3(8,75) : ERROR: $ILC_COLOR32 previously declared as a 'Const'

If Not IsDeclared("ILC_COLOR32") Then Global Const $ILC_COLOR32 = 0x0020

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Or am i doing something wrong?

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

In my opinion this is a problem of "au3check" with "IsDeclared".

Other people mean it's not a problem of it.

I never used 'Scite' so I never had this problem cause I never used "au3check".

So just try to comment out the most "Global Const"-entries at the beginning of "ModernMenu.au3" with "#cs" and "#ce".

I think the "NIF_"- and "NIM_" - variables are not 'declared' in any include-file at the moment so these you should not comment.

Greets

Holger

P.S. on the next update I will maybe delete all global consts and replace all used constants directly with numbers...

Edited by Holger
Link to comment
Share on other sites

Can anyone upload a simple script with tray menu icon and WITH his modernmenu file please?

PS: What do you use, Notepad ++?

EDIT: How can the example file work and my file not. I must be doing something wrong but I can't find it. I use:

#include <ModernMenu.au3>
...
$tray_exit = $tray_exit = TrayCreateItem("Exit")
_TrayItemSetIcon($tray_exit, "D:\Documents and Settings\Administrator\My Documents\My Pictures\exit.ico", 0)

I don't see anything wrong :D

Edited by Aassdd
Link to comment
Share on other sites

...
$TrayIcon = _TrayIconCreate("Tools", "shell32.dll", 12)
_TrayCreateItem(-1, "Item")
; same as _TrayCreateItem($TrayIcon, "Item")
_TrayCreateMenu(-1, "Menu")
...

The functions begin with "underline" - just see the example in the helpfile...

Link to comment
Share on other sites

Not sure why but when ever I include ModernMenu.au3 in my script I get 15 errors.

C:\Program Files\AutoIt3\Include\ModernMenu.au3(18,72) : ERROR: $SRCCOPY previously declared as a 'Const'

If Not IsDeclared("SRCCOPY") Then Global Const $SRCCOPY = 0x00CC0020

~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(25,75) : ERROR: $WM_DRAWITEM previously declared as a 'Const'

If Not IsDeclared("WM_DRAWITEM") Then Global Const $WM_DRAWITEM = 0x002B

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(26,81) : ERROR: $WM_MEASUREITEM previously declared as a 'Const'

If Not IsDeclared("WM_MEASUREITEM") Then Global Const $WM_MEASUREITEM = 0x002C

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(28,68) : ERROR: $WM_USER previously declared as a 'Const'

If Not IsDeclared("WM_USER") Then Global Const $WM_USER = 0x0400

~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(36,71) : ERROR: $SM_CXSMICON previously declared as a 'Const'

If Not IsDeclared("SM_CXSMICON") Then Global Const $SM_CXSMICON = 49

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(37,77) : ERROR: $SM_CXMENUCHECK previously declared as a 'Const'

If Not IsDeclared("SM_CXMENUCHECK") Then Global Const $SM_CXMENUCHECK = 71

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(48,78) : ERROR: $DT_VCENTER previously declared as a 'Const'

If Not IsDeclared("DT_VCENTER") Then Global Const $DT_VCENTER = 0x00000004

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(49,83) : ERROR: $DT_SINGLELINE previously declared as a 'Const'

If Not IsDeclared("DT_SINGLELINE") Then Global Const $DT_SINGLELINE = 0x00000020

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(50,76) : ERROR: $DT_NOCLIP previously declared as a 'Const'

If Not IsDeclared("DT_NOCLIP") Then Global Const $DT_NOCLIP = 0x00000100

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(52,69) : ERROR: $COLOR_MENU previously declared as a 'Const'

If Not IsDeclared("COLOR_MENU") Then Global Const $COLOR_MENU = 4

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(53,76) : ERROR: $COLOR_MENUTEXT previously declared as a 'Const'

If Not IsDeclared("COLOR_MENUTEXT") Then Global Const $COLOR_MENUTEXT = 7

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(54,78) : ERROR: $COLOR_HIGHLIGHT previously declared as a 'Const'

If Not IsDeclared("COLOR_HIGHLIGHT") Then Global Const $COLOR_HIGHLIGHT = 13

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(55,85) : ERROR: $COLOR_HIGHLIGHTTEXT previously declared as a 'Const'

If Not IsDeclared("COLOR_HIGHLIGHTTEXT") Then Global Const $COLOR_HIGHLIGHTTEXT = 14

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(56,77) : ERROR: $COLOR_GRAYTEXT previously declared as a 'Const'

If Not IsDeclared("COLOR_GRAYTEXT") Then Global Const $COLOR_GRAYTEXT = 17

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ModernMenu.au3(57,74) : ERROR: $CLR_NONE previously declared as a 'Const'

If Not IsDeclared("CLR_NONE") Then Global Const $CLR_NONE = 0xFFFFFFFF

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\TrayMenu.au3 - 15 error(s), 0 warning(s)

Link to comment
Share on other sites

Not sure why but when ever I include ModernMenu.au3 in my script I get 15 errors.

Make a list of the line numbers in that error report (the first number in the braces)

Open the C:\Program Files\AutoIt3\Include\ModernMenu.au3 file

Comment out those lines. It happening because one of those bloody constants files has been #included someplace.

One of these days I'm going to release my code for removing the constants variable names. They're nothing but a pain in the arse.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Sorry for the constant questions but how can ModernMenu's be used with Opt("TrayOnEventMode", 1)? Iv got my tray menu built ect.. non of the MenuItems are calling my functions when using Opt("TrayOnEventMode", 1).

$ExitTray = _TrayCreateItem(-1, "Exit")
TrayItemSetOnEvent(-1, "ExitEvent")
_TrayItemSetIcon(-1, "shell32.dll", 27)

Many thanks,

GoogleDude

Edited by GoogleDude
Link to comment
Share on other sites

Sorry for the constant questions but how can ModernMenu's be used with Opt("TrayOnEventMode", 1)? Iv got my tray menu built ect.. non of the MenuItems are calling my functions when using Opt("TrayOnEventMode", 1).

$ExitTray = _TrayCreateItem(-1, "Exit")
TrayItemSetOnEvent(-1, "ExitEvent")
_TrayItemSetIcon(-1, "shell32.dll", 27)

Many thanks,

GoogleDude

I never use OnEventMode so I'm not sure here, but you might want to take a look at Opt ("TrayMenuMode") to disable the default menu. Also I have found using -1 as the control designator to be a bad practice, I always use the variable name.

TrayItemSetOnEvent($ExitTray, "ExitEvent")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

The GUI message system is used here also for creating 'pseudo' tray menus.

Lines from the samples:

$TrayHelp       = _TrayCreateItem(-1, "Help")
GUICtrlSetState($TrayHelp, $GUI_DEFBUTTON)
Edited by Holger
Link to comment
Share on other sites

Lines from the samples:

$TrayHelp       = _TrayCreateItem(-1, "Help")
GUICtrlSetState($TrayHelp, $GUI_DEFBUTTON)

So does this mean that the OnEventMode cant be used or would I just have to switch around my code to use Getmsg mode? My script is currently native to OnEventMode and its working perfect. Now I am replacing the standard autoit traymenu system with your fancy menu icons and none of my functions are being called.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...