TehWhale Posted October 25, 2008 Share Posted October 25, 2008 I feel disappointed, I never told you thanks for this... Link to comment Share on other sites More sharing options...
ProgAndy Posted October 25, 2008 Share Posted October 25, 2008 (edited) Whenever I do GUICtrlSetDefBkColor(0xB9D1EA) with my GUI all of my buttons dissappear if I have ModerMenuRaw.au3 included. How can I prevent this? EDIT: It is actually anytime I set the background color for a button. Other things work but not buttons. They will disappear. Any ideas how to fix this please?As far as I know, Buttons are drawn in ownerdraw mode, if a color is set for them. Possibly ModernMenu doesn't return GUI_RUNDEFMSG, when it's no menu but a button to paint //Edit: Yes, thats the problem. Just change the beginning of the Func WM_DRAWITEM to this an it will work Func WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam) Local $nResult = "GUI_RUNDEFMSG" Local $stDrawItem = DllStructCreate("uint;uint;uint;uint;uint;dword;dword;int[4];dword", $lParam) If DllStructGetData($stDrawItem, 1) = 1 Then $nResult = FALSE Edited October 25, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
SoulA Posted October 25, 2008 Share Posted October 25, 2008 As far as I know, Buttons are drawn in ownerdraw mode, if a color is set for them. Possibly ModernMenu doesn't return GUI_RUNDEFMSG, when it's no menu but a button to paint //Edit: Yes, thats the problem. Just change the beginning of the Func WM_DRAWITEM to this an it will work Func WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam) Local $nResult = "GUI_RUNDEFMSG" Local $stDrawItem = DllStructCreate("uint;uint;uint;uint;uint;dword;dword;int[4];dword", $lParam) If DllStructGetData($stDrawItem, 1) = 1 Then $nResult = FALSE THANK YOU! Maybe an update for this program... wierd issue... can't beleive no one had this prior. Link to comment Share on other sites More sharing options...
finebbs Posted October 29, 2008 Share Posted October 29, 2008 (edited) Hi,guys,I come from China and can't speak English very well.I like this UDF,and have some questions of using it.It has some conflict with WindowsConstants.au3 and Constants.au3.I want to hide some controls(such as labels) and creat new controls(covering the hided controls).When I run the program, controls can be hided,but new created controls are not show.Please help me,thanks. Edited October 29, 2008 by finebbs Link to comment Share on other sites More sharing options...
BrettF Posted October 29, 2008 Share Posted October 29, 2008 Hi,guys,I come from China and can't speak English very well.I like this UDF,and have some questions of using it.It has some conflict with WindowsConstants.au3 and Constants.au3.I want to hide some controls(such as labels) and creat new controls(covering the hided controls).When I run the program, controls can be hided,but new created controls are not show.Please help me,thanks.Hi post a topic in General support. Remember to give lots of detail and post your code. Cheers,Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
finebbs Posted October 29, 2008 Share Posted October 29, 2008 (edited) Hi post a topic in General support. Remember to give lots of detail and post your code. Cheers, Brett The code: (when click "Change", the last two lines of _new() haven't work) expandcollapse popup#include <ModernMenuRaw.au3> #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #NoTrayIcon $hwnd = GUICreate("Test ", 200, 100, -1, -1) $Label1 = GUICtrlCreateLabel("Today is: "&@YEAR&@MON&@MDAY, 10, 10) $Label2 = GUICtrlCreateLabel("This is a test.", 10, 40) $Button1=GUICtrlCreateButton("Change",20,70,60,25) GUISetState() $nTrayIcon1 = _TrayIconCreate("Test", "shell32.dll", -40) _TrayIconSetClick($nTrayIcon1, 16) _TrayIconSetState() $bUseAdvTrayMenu = FALSE $nTrayMenu1 = _TrayCreateContextMenu() $nSideItem3 = _CreateSideMenu($nTrayMenu1) _SetSideMenuText($nSideItem3, "Test") _SetSideMenuColor($nSideItem3, 0x00FFFF) _SetSideMenuBkColor($nSideItem3, 0x802222) _SetSideMenuBkGradColor($nSideItem3, 0x4477AA) $help= _TrayCreateItem("Help") _TrayItemSetIcon($help , "shell32.dll", -15) $About = _TrayCreateItem("About") _TrayItemSetIcon($About, "shell32.dll", -25) $TrayExit = _TrayCreateItem("Exit") _TrayItemSetIcon($TrayExit, "shell32.dll", -28) _TrayIconSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE _TrayIconDelete($nTrayIcon1) Exit Case $msg = $Button1 _new() Case $msg = $TrayExit _TrayIconDelete($nTrayIcon1) Exit EndSelect WEnd Func _new() GUICtrlSetState($Label1,$GUI_Hide) GUICtrlSetState($Label2,$GUI_Hide) $Label3 = GUICtrlCreateLabel(@OSVersion&@OSServicePack, 10, 10) $Label4 = GUICtrlCreateLabel(@OSBuild, 10, 40) EndFunc _TrayIconDelete($nTrayIcon1) Edited October 29, 2008 by finebbs Link to comment Share on other sites More sharing options...
ProgAndy Posted October 29, 2008 Share Posted October 29, 2008 (edited) Just add GUISwitch($hwnd) after _TrayIconCreate() (ModernMenu creates a GUI forto receive Messages from Tray Icons. So you mustn't foget to reset the GUI for GUICtrl functions after the first call of _TrayIconCreate ) Edited October 29, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
finebbs Posted October 30, 2008 Share Posted October 30, 2008 Just add GUISwitch($hwnd) after _TrayIconCreate()(ModernMenu creates a GUI forto receive Messages from Tray Icons. So you mustn't foget to reset the GUI for GUICtrl functions after the first call of _TrayIconCreate )Thank you vrey much! Link to comment Share on other sites More sharing options...
abushcrafter Posted November 10, 2008 Share Posted November 10, 2008 (edited) How do you show the tray menu with a hotkey? Please HELP I AM DESPERATE! ps I love what you have done Edited November 10, 2008 by abushcrafter [center]I click you, you click me!The Home Of abushcrafter[/center] Link to comment Share on other sites More sharing options...
jennico Posted November 13, 2008 Share Posted November 13, 2008 this is extraordinary ! thx j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted November 17, 2008 Share Posted November 17, 2008 i played around with your udf quite a lot. everything seems to work excellently. just one question left:could you explain _TrayIconSetClick ? what are the params ?ok, just in this moment i found the answer:Case $WM_LBUTTONDOWN $nClick = 1 case $WM_LBUTTONUP $nClick = 2 case $WM_LBUTTONDBLCLK $nClick = 4 case $WM_RBUTTONDOWN $nClick = 8 case $WM_RBUTTONUP $nClick = 16 case $WM_RBUTTONDBLCLK $nClick = 32 case $WM_MOUSEMOVE $nClick = 64i think this hint is very hard to find, should be explained in the _TrayIconSetClick function.and let me add: parameter 0 will never open the tray menu,while, if you leave away _TrayIconSetClick, it will be opened on any trayevent.right ?cheers j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted November 18, 2008 Share Posted November 18, 2008 another question:i can't get the icon flashing; To activate flashing use _TrayIconSetState($ID, 4)doesn't seem to work.any idea ?j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
abushcrafter Posted November 18, 2008 Share Posted November 18, 2008 another question: i can't get the icon flashing doesn't seem to work. any idea ? j. I think the $IDoÝ÷ Úö«n&¥v®¶sbõG&6öå6WE7FFRb33c´BÂB is ment to be your tray-icon vabiale? [center]I click you, you click me!The Home Of abushcrafter[/center] Link to comment Share on other sites More sharing options...
jennico Posted November 18, 2008 Share Posted November 18, 2008 (edited) ah, someone here. yes thats clear, it's the icon ID. but does not flash. i tried inserting _TrayIconSetState($ID, 4) in the example scripts, nothing. i hope this can be fixed. state 1 (show) and 2 (hide) are working though. j. Edited November 18, 2008 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
GEOSoft Posted November 18, 2008 Share Posted November 18, 2008 ah, someone here. yes thats clear, it's the icon ID.but does not flash.i tried inserting _TrayIconSetState($ID, 4) in the example scripts, nothing. i hope this can be fixed.state 1 (show) and 2 (hide) are working though.j.Just going from bad memory here but I think that function is for the icons on tray items and tray menus themselves. As far as I know the only one that can be flashed is the main icon in the system tray. 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 More sharing options...
abushcrafter Posted November 18, 2008 Share Posted November 18, 2008 (edited) ah, someone here. yes thats clear, it's the icon ID.Sorry to be stupid! *Banging head hard!*but dose any one have a clue with my hotkey problem? Edited November 18, 2008 by abushcrafter [center]I click you, you click me!The Home Of abushcrafter[/center] Link to comment Share on other sites More sharing options...
jennico Posted November 18, 2008 Share Posted November 18, 2008 (edited) @GEOSoft:but... the function does the following: it creates an empty icon and sets a timer to exchange blank and icon according to flashtime interval. in this way it should be working for the tray icon itself, too. i can do that "manually", so maybe it's the script and not a basic problem.but dose any one have a clue with my hotkey problem?sorry ? what problem ? Edited November 18, 2008 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
abushcrafter Posted November 18, 2008 Share Posted November 18, 2008 (edited) sorry ? what problem ? This problem,My very 1st post. 8 posts before this one! How do you show the tray menu with a hotkey? Please HELP I AM DESPERATE! ps I love what you have done Also how do you do this with the "TrayCreate..." auotit commands? as well as the cool menu functions of this thread. [edit:]oh I am also using the unicode one by the way. Edited November 18, 2008 by abushcrafter [center]I click you, you click me!The Home Of abushcrafter[/center] Link to comment Share on other sites More sharing options...
jennico Posted November 18, 2008 Share Posted November 18, 2008 do you mean like this: $visible=0 GUICreate("") GUICtrlCreateLabel("Hit Enter Key",20,20,100,30) GUISetState() HotKeySet("{Enter}","_TrayIcon") Do $msg=GUIGetMsg() Until $msg=-3 Func _TrayIcon() $visible=($visible=0) Opt("TrayIconHide",$visible) EndFunc this is very basic. i think you should learn how to use the helpfile first. j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
abushcrafter Posted November 18, 2008 Share Posted November 18, 2008 (edited) do you mean like this: $visible=0 GUICreate("") GUICtrlCreateLabel("Hit Enter Key",20,20,100,30) GUISetState() HotKeySet("{Enter}","_TrayIcon") Do $msg=GUIGetMsg() Until $msg=-3 Func _TrayIcon() $visible=($visible=0) Opt("TrayIconHide",$visible) EndFunc this is very basic. i think you should learn how to use the helpfile first. j. Sorry but that's not what I mean. I would like to show the TRAY MENU (the pop up menu when you click the tray icon.) I can do the HotKeySet bit fine. But what I am struggling with is in the function that you call with HotKeySet, What func do you have there? E.G HotKeySet("#^t", "ShowTheDarnMenu" Func ShowTheDarnMenu() ;The unknow func to have here???... EndFunc If you what I can post my source code? AND I do use the help file, In fact IT IS ALWAYS RUNNING WHEN THE EDITOR IS RUNNING. Edited November 18, 2008 by abushcrafter [center]I click you, you click me!The Home Of abushcrafter[/center] 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