OmarElAsd Posted April 6, 2011 Share Posted April 6, 2011 Hi AllIam Making a Program , but the Tray Menu Doesn't WorkI Mean : If i Press ( Info Tray Item ) it should be a MsgBox appearand the Problem with all TrayItemsHelp Me with Code :==========================================================================================================expandcollapse popup#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=C:\Users\Acer\Desktop\NetCutter.by.OmarElAsd\Source\icon.ICO #AutoIt3Wrapper_outfile=NetCutter.by.OmarElAsd.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Comment=NetCutter.by.OmarElAsd #AutoIt3Wrapper_Res_Description=NetCutter.by.OmarElAsd #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_Res_ProductVersion=1.0 ;Product Version. Default is the AutoIt3 version used. #AutoIt3Wrapper_Res_Language=English ;Resource Language code . default 2057=English (United Kingdom) #AutoIt3Wrapper_Res_LegalCopyright=OmarElAsd ;Copyright field #AutoIt3Wrapper_Res_Icon_Add=C:\Users\Acer\Desktop\NetCutter.by.OmarElAsd\Source\icon.ICO #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiImageList.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. Opt("TrayAutoPause",0) ; Script will not be paused when clicking the tray icon. Global Const $MIM_APPLYTOSUBMENUS = 0x80000000 Global Const $MIM_BACKGROUND = 0x00000002 ;Run NetCut MouseMove( 150,120,9999) ProcessClose ("AntiARP.exe") Run('C:\Program Files\netcut\netcut.exe') MouseMove( 150,120,9999) ProcessClose ("AntiARP.exe") MouseMove( 150,120,9999) #region;GUI $Form1 = GUICreate("NetCutter.OmarElAsd", 306, 176, 1, 1) GUISetBkColor(0x000000) GUISetFont(20, 1500, 1, "Courier New") GUICtrlCreateLabel("Net Cutter", 80, 10, 273, 25) GUICtrlSetColor(-1, 0xFF0000) GUISetFont(20, 350, 1, "Arial") GUICtrlCreateIcon( @ProgramFilesDir & "\netcut\netcut.exe",-1, 20, 10, 32, 32) GUICtrlCreateIcon( @ProgramFilesDir & "\netcut\netcut.exe",-1, 260, 10, 32, 32) GUICtrlCreateLabel(" Waiting Time :", 65, 130, 93, 25) GUICtrlSetColor(-1, 0xFFFF00) GUICtrlSetFont( -1 ,10, 350, 1, "Arial") $WAIT = GUICtrlCreateInput("5000", 164, 128, 51, 21) GUICtrlSetColor(-1, 0xFFFF00) GUICtrlSetFont(-1, 10) GUICtrlSetBkColor(-1, 0x8B008B) Local $hImage, $y = 70, $iIcon = 125, $btn[6], $aImageListInfo $hImage = _GUIImageList_Create(32, 32, 5, 3, 6) For $x = 6 To 11 _GUIImageList_AddIcon($hImage, "shell32.dll", $x, True) Next $btn[0] = GUICtrlCreateButton("Start", 16, 55, 275, 68) GUICtrlSetCursor (-1, 14) _GUICtrlButton_SetImageList($btn[0], $hImage) For $x = 1 To 5 _GUICtrlButton_SetImageList($btn[$x], _GetImageListHandle("shell32.dll", $iIcon + $x, True), $x) $y += 60 Next For $x = 0 To 5 $aImageListInfo = _GUICtrlButton_GetImageList($btn[$x]) Next GUISetFont(10, 350, 1, "Arial") GUICtrlCreateLabel(" Press ''Insert'' to ''Exit'' , Made by OmarElAsd", 16, 155, 273, 25) GUICtrlSetColor(-1, 0xA2EB30) iF WinFlash( "Arcai.com's netcut Software 2.0" , "" ) Then WinActivate("NetCutter.OmarElAsd") WinActivate("NetCutter.OmarElAsd") EndIf ProcessClose ("AntiARP.exe") ;Tray TraySetIcon(@ScriptFullPath, 5) TraySetToolTip("NetCutter by OmarElAsd@YaHoo.CoM") local $mHIDENC = TrayCreateItem("Hide NetCut") TrayCreateItem("") local $mSHOWNC = TrayCreateItem("Show NetCut") TrayCreateItem("") local $mInfo = TrayCreateItem("Info") TrayItemSetOnEvent( $mInfo , "InfoFN" ) TrayCreateItem("") local $mBye = TrayCreateItem("Exit") SetMenuColor(0, 0x66BB99) TraySetState() GUISetState(@SW_SHOW) #endregion Global $Paused HotKeySet( "{INSERT}","ins") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ProcessClose ( "netcut.exe") sleep(50) Exit Case $btn[0] RRs() EndSwitch WEnd Func sendtext() $Paused = NOT $Paused While $Paused TrayItemSetOnEvent( $mInfo , "InfoFN" ) $client = "Arcai.com's netcut Software 2.0" ControlClick($client,"","Button1","left",1, 3, 10 ) ControlClick($client,"","Button1","left",1, 3, 10 ) $WAITREAD = GuiCtrlRead($WAIT) Sleep( $WAITREAD ) ControlClick($client,"","Button2","left",1, 3, 10 ) ControlClick($client,"","Button2","left",1, 3, 10 ) Sleep( 12000 ) WEnd EndFunc Func ins() ProcessClose ( "netcut.exe") Run('C:\Program Files\ColorSoft\AntiARP\AntiARP.exe') Exit EndFunc Func RRs() ProcessClose ("AntiARP.exe") ProcessClose ("AntiARP.exe") Sleep ( 1000 ) WinActivate("Arcai.com's netcut Software 2.0") WinActivate("Arcai.com's netcut Software 2.0") sleep(500) WinActivate("Arcai.com's netcut Software 2.0") WinActivate("Arcai.com's netcut Software 2.0") $DOWN = "{DOWN}" ControlSend("Arcai.com's netcut Software 2.0" , "" , "" ,$DOWN) ControlSend("Arcai.com's netcut Software 2.0" , "" , "" ,$DOWN) ControlSend("Arcai.com's netcut Software 2.0" , "" , "" ,$DOWN) ControlSend("Arcai.com's netcut Software 2.0" , "" , "" ,$DOWN) ControlSend("Arcai.com's netcut Software 2.0" , "" , "" ,$DOWN) sleep(70) ControlSend("Arcai.com's netcut Software 2.0" , "" , "" ,"{SHIFTDOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{SHIFTUP}") sleep(1000) $client = "Arcai.com's netcut Software 2.0" ControlClick($client,"","Button1","left",1, 3, 10 ) ControlClick($client,"","Button1","left",1, 3, 10 ) $WAITREAD = GuiCtrlRead($WAIT) Sleep( $WAITREAD ) ControlClick($client,"","Button2","left",1, 3, 10 ) ControlClick($client,"","Button2","left",1, 3, 10 ) Sleep(500) WinSetState("Arcai.com's netcut Software 2.0","",@SW_MINIMIZE) sleep(50) WinSetState("Arcai.com's netcut Software 2.0","",@SW_HIDE) WinSetState("NetCutter.OmarElAsd","",@SW_HIDE) sendtext() EndFunc Func SetMenuColor($nMenuID, $nColor) $hMenu = TrayItemGetHandle($nMenuID) ; Get the internal menu handle $hBrush = DllCall("gdi32.dll", "hwnd", "CreateSolidBrush", "int", $nColor) $hBrush = $hBrush[0] Local $stMenuInfo = DllStructCreate("dword;dword;dword;uint;dword;dword;ptr") DllStructSetData($stMenuInfo, 1, DllStructGetSize($stMenuInfo)) DllStructSetData($stMenuInfo, 2, BitOr($MIM_APPLYTOSUBMENUS, $MIM_BACKGROUND)) DllStructSetData($stMenuInfo, 5, $hBrush) DllCall("user32.dll", "int", "SetMenuInfo", "hwnd", $hMenu, "ptr", DllStructGetPtr($stMenuInfo)) EndFunc Func _GetImageListHandle($sFile, $nIconID = 0, $fLarge = False) Local $iSize = 16 If $fLarge Then $iSize = 32 Local $hImage = _GUIImageList_Create($iSize, $iSize, 5, 3) If StringUpper(StringMid($sFile, StringLen($sFile) - 2)) = "BMP" Then _GUIImageList_AddBitmap($hImage, $sFile) Else _GUIImageList_AddIcon($hImage, $sFile, $nIconID, $fLarge) EndIf Return $hImage EndFunc ;==>_GetImageListHandle Func InfoFN() MsgBox(0, "Info (NetCutter)", "wWw.OmarElAsd.eG.vG & OmarElAsd@YaHoo.CoM") EndFunc ;~ Func ASD() ;~ $Paused = NOT $Paused ;~ While $Paused ;~ $msg = TrayGetMsg() ;~ Switch $msg ;~ Case $mHIDENC ;~ WinSetState("Arcai.com's netcut Software 2.0","",@SW_HIDE) ;~ Case $mSHOWNC ;~ WinSetState("Arcai.com's netcut Software 2.0","",@SW_SHOW) ;~ WinActivate( "Arcai.com's netcut Software 2.0") ;~ Case $mBye ;~ ProcessClose ( "netcut.exe") ;~ sleep(50) ;~ Exit ;~ Case $minfo ;~ MsgBox(0, "Info (NetCutter)", "wWw.OmarElAsd.eG.vG & OmarElAsd@YaHoo.CoM"); ;~ EndSwitch ;~ WEnd ;~ DSA() ;~ EndFunc ;~ Func DSA() ;~ $Paused = NOT $Paused ;~ While $Paused ;~ $client = "Arcai.com's netcut Software 2.0" ;~ ;~ ControlClick($client,"","Button1","left",1, 3, 10 ) ;~ ;~ ControlClick($client,"","Button1","left",1, 3, 10 ) ;~ Sleep( 5000 ) ;~ ControlClick($client,"","Button2","left",1, 3, 10 ) ;~ ControlClick($client,"","Button2","left",1, 3, 10 ) ;~ Sleep( 12000 ) ;~ WEnd ;~ EndFunc Link to comment Share on other sites More sharing options...
AutoBert Posted April 6, 2011 Share Posted April 6, 2011 Just add TrayGetMsg() to your loop: While 1 $nMsgGui = GUIGetMsg() Switch $nMsgGui Case $GUI_EVENT_CLOSE ProcessClose("netcut.exe") Sleep(50) Exit Case $btn[0] RRs() EndSwitch $nMsgTray = TrayGetMsg() Switch $nMsgTray() Case $mHIDENC GUISetState(@SW_HIDE) Case $mSjowNC GUISetState(@SW_Sjow) Case $mBye Exit EndSwitch WEnd mfg autoBert Link to comment Share on other sites More sharing options...
OmarElAsd Posted April 6, 2011 Author Share Posted April 6, 2011 Thank u for your Replaybefore u post your Replayi saw (( TrayItemSetOnEvent( $mHIDENC , "HideFN" ) ))and i used and its workingthx again 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