ConsultingJoe Posted October 8, 2007 Posted October 8, 2007 I've been looking at msdn and searching around, I though maybe I can put a input as an entry into the traymenu but it's not working a bit, here something I tried. #NoTrayIcon Opt("TrayMenuMode",1) $exititem = TrayCreateItem("Exit") $handle = TrayItemGetHandle( 0 ) $form = GUICreate( "df", 12, 12, 0, 0,-1, -1, $handle ) GUICtrlCreateInput( "dfs", 0, 0 ) TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $exititem ExitLoop EndSelect Sleep(10) WEnd Exit Thanks guys Check out ConsultingJoe.com
McGod Posted October 8, 2007 Posted October 8, 2007 very tricky, but possible. Your best bet to go at this is to create a GUI that appears when someone clicks the tray icon. There's an example somewhere in the Example Scripts you could use. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
PsaltyDS Posted October 8, 2007 Posted October 8, 2007 (edited) I don't understand the bizarre little GUI. Here's another shot at it: $form = GUICreate("df", 120, 120, 100, 100) $Input = GUICtrlCreateInput("dfs", 10, 10, 100, 20) $Button = GUICtrlCreateButton("Enter", 20, 80, 80, 30) Opt("TrayMenuMode", 1) $inputitem = TrayCreateItem("Input") $exititem = TrayCreateItem("Exit") TraySetState() While 1 Switch TrayGetMsg() Case $inputitem _GetInput() Case $exititem Exit EndSwitch Sleep(10) WEnd Func _GetInput() GUISetState(@SW_SHOW, $form) While 1 If GUIGetMsg() = $Button Then MsgBox(64, "Input", "Input was: " & GUICtrlRead($Input)) GUISetState(@SW_HIDE, $form) Return EndIf WEnd EndFunc ;==>_GetInput Edited October 8, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
ConsultingJoe Posted October 8, 2007 Author Posted October 8, 2007 I don't understand the bizarre little GUI. Here's another shot at it: $form = GUICreate("df", 120, 120, 100, 100) $Input = GUICtrlCreateInput("dfs", 10, 10, 100, 20) $Button = GUICtrlCreateButton("Enter", 20, 80, 80, 30) Opt("TrayMenuMode", 1) $inputitem = TrayCreateItem("Input") $exititem = TrayCreateItem("Exit") TraySetState() While 1 Switch TrayGetMsg() Case $inputitem _GetInput() Case $exititem Exit EndSwitch Sleep(10) WEnd Func _GetInput() GUISetState(@SW_SHOW, $form) While 1 If GUIGetMsg() = $Button Then MsgBox(64, "Input", "Input was: " & GUICtrlRead($Input)) GUISetState(@SW_HIDE, $form) Return EndIf WEnd EndFunc ;==>_GetInput I wanted the Input in the actual menu. Thanks though. @Chip Yeah I was going to do that but I wanted to know if it can be done the nicer, more standard way. That was it's cleaner and I don't have to write the entire behavior of how its going to be placed, etc. Plus I can't figure out how to make the buttons rollover highlight and be completely flat without border. Thanks Check out ConsultingJoe.com
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