網路城邦
上一篇 回創作列表 下一篇   字體:
SideMenu by autoit
2014/08/24 14:23:51瀏覽405|回應0|推薦0

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#include <StaticConstants.au3>
#include <IE.au3>
#include <file.au3>
#include <MyINet.au3>
#include <Array.au3>

Global $hide_state = 0, $btn_state = 0, $pass = 0, $side = "left"
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$Auto_PATH =  IniRead("C:\HTSMini\menu.ini","settings","Auto_PATH","error") 
$HTS_PATH = IniRead("C:\HTSMini\menu.ini","settings","HTS_PATH","error")
$HTS_PASSWORD = IniRead("C:\HTSMini\menu.ini","settings","HTS_PASSWORD","error")       
$HTSTrade_PATH = IniRead("C:\HTSMini\menu.ini","settings","HTSTrade_PATH","error") 
$HTSTrade_name = IniRead("C:\HTSMini\menu.ini","settings","HTSTrade_name","error") 
$HTSTrade_WIN = IniRead("C:\HTSMini\menu.ini","settings","HTSTrade_WIN","error") 
$4_PATH = IniRead("C:\HTSMini\menu.ini","settings","4_PATH","error")   
$4_name = IniRead("C:\HTSMini\menu.ini","settings","4_name","error")
$4_WIN =  IniRead("C:\HTSMini\menu.ini","settings","4_WIN","error")
$5_PATH = IniRead("C:\HTSMini\menu.ini","settings","5_PATH","error")                 ;
$5_name = IniRead("C:\HTSMini\menu.ini","settings","5_name","error")
$5_WIN =  IniRead("C:\HTSMini\menu.ini","settings","5_WIN","error")
$6_PATH = IniRead("C:\HTSMini\menu.ini","settings","6_PATH","error")                 ;
$6_name = IniRead("C:\HTSMini\menu.ini","settings","6_name","error")
$6_WIN =  IniRead("C:\HTSMini\menu.ini","settings","6_WIN","error")
$7_PATH = IniRead("C:\HTSMini\menu.ini","settings","7_PATH","error")                 ;
$7_name = IniRead("C:\HTSMini\menu.ini","settings","7_name","error")
$7_WIN =  IniRead("C:\HTSMini\menu.ini","settings","7_WIN","error")
;-----------------------------------------------------------------------------------------------------
$mL1 = 20
$mL2 = 110
$mL3 = 200
$mL4 = 290
$mL5 = 380
$mL6 = 470
$mT1 = 40
$mT2 = 65
$mT3 = 90
$mT4 = 115

$hwnd= GUICreate("SideMenu", 603, 170, -588, -1, -1,  BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_ACCEPTFILES))

$Show = GUICtrlCreateButton(">", 585, 8, 17, 155, BitOR($BS_CENTER, $BS_FLAT))
GUISetState(@SW_HIDE, $hwnd)

$hwnd2 = GUICreate("ToolMenu", 603, 170, 0, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
 
 
  GUICtrlCreateTab(10, 10, 570, 133)
    GUICtrlCreateTabItem("JP")
   $JPSingle = GUICtrlCreateButton("JPSingle", $mL1, $mT1, 80, 22)
   $JPDouble = GUICtrlCreateButton("JPDouble", $mL2, $mT1, 80, 22)
   $JPThree = GUICtrlCreateButton("JPThree", $mL3, $mT1, 80, 22)
   $JPMusic = GUICtrlCreateButton("JPMusic", $mL4, $mT1, 80, 22)
   $JPvedio = GUICtrlCreateButton("JPvedio", $mL5, $mT1, 80, 22)
   $JPRSS = GUICtrlCreateButton("JPRSS", $mL6, $mT1, 80, 22)
   $JPText = GUICtrlCreateButton("JPText", $mL1, $mT2, 80, 22)
   $JPShowAllText = GUICtrlCreateButton("JPShowAllText", $mL2, $mT2, 80, 22)
   $JPLib = GUICtrlCreateButton("JPLib", $mL3, $mT2, 80, 22)
   $JPMyData = GUICtrlCreateButton("JPMyData", $mL4, $mT2, 80, 22)
   $editLib = GUICtrlCreateButton("editLib", $mL2, $mT3, 80, 22)
   $JPLib = GUICtrlCreateButton("JPLib", $mL1, $mT3, 80, 22)

  $shutdown = GUICtrlCreateButton("shutdown", $mL1, $mT4, 80, 22)

    GUICtrlCreateTabItem("EXE")
  $LiveMail = GUICtrlCreateButton("LiveMail", $mL1, $mT1, 80, 22)
  $Spider = GUICtrlCreateButton("Spider", $mL2, $mT1, 80, 22)
  $SaveToHtml = GUICtrlCreateButton("SaveToHtml", $mL3, $mT1, 80, 22)

    GUICtrlCreateTabItem("Blog")
      $Gmail = GUICtrlCreateButton("Gmail", $mL1, $mT1, 80, 22)
   $01bs = GUICtrlCreateButton("01bs", $mL2, $mT1, 80, 22)
   $02bs = GUICtrlCreateButton("02bs", $mL3, $mT1, 80, 22)
   $03bs = GUICtrlCreateButton("03bs", $mL4, $mT1, 80, 22)
   $001bs = GUICtrlCreateButton("001bs", $mL5, $mT1, 80, 22)
   $002bs = GUICtrlCreateButton("002bs", $mL6, $mT1, 80, 22)

GUICtrlCreateTabItem("LifeType")
      $Wordpress = GUICtrlCreateButton("Wordpress", $mL1, $mT1, 80, 22)
      $LifeType1 = GUICtrlCreateButton("LifeType1", $mL2, $mT1, 80, 22)
      $LifeType2 = GUICtrlCreateButton("LifeType2", $mL3, $mT1, 80, 22)

  
    GUICtrlCreateTabItem("HTS")
   $HTS = GUICtrlCreateButton("HTS", $mL1, $mT1, 80, 22)
    $HTSTrade = GUICtrlCreateButton("HTSTrade", $mL2, $mT1, 80, 22)
    $BuySell4 = GUICtrlCreateButton("BS4(Hand)", $mL3, $mT1, 80, 22)
    $AutodanRC16 = GUICtrlCreateButton("AutoDan", $mL4, $mT1, 80, 22)
    $BuySell5 = GUICtrlCreateButton("BS5", $mL5, $mT1, 80, 22)
    $BuySell6 = GUICtrlCreateButton("BS6", $mL6, $mT1, 80, 22)
    $BuySell7 = GUICtrlCreateButton("BS7", $mL1, $mT2, 80, 22)
  
   

    GUICtrlCreateTabItem("Search")
   $searchjava = GUICtrlCreateButton("searchjava", $mL1, $mT1, 80, 22)
   $searchSwing = GUICtrlCreateButton("searchSwing", $mL2, $mT1, 80, 22)
   $searchJavaKing = GUICtrlCreateButton("searchJavaKing", $mL3, $mT1, 80, 22)
   $searchaspx = GUICtrlCreateButton("searchaspx", $mL4, $mT1, 80, 22)
   $SearchHTML5 = GUICtrlCreateButton("SearchHTML5", $mL5, $mT1, 80, 22)
  
   $SearchJQ = GUICtrlCreateButton("SearchJQ", $mL1, $mT2, 80, 22)
   $SearchUI = GUICtrlCreateButton("SearchUI", $mL2, $mT2, 80, 22)
   $SearchMyData = GUICtrlCreateButton("SearchMyData", $mL3, $mT2, 80, 22)
   $SearchLib = GUICtrlCreateButton("SearchLib", $mL4, $mT2, 80, 22)
  
   $SearchAndroid1 = GUICtrlCreateButton("SearchAndroid1_API", $mL1, $mT3, 80, 22)
   $SearchAndroid2 = GUICtrlCreateButton("SearchAndroid2", $mL2, $mT3, 80, 22)
   $SearchAndroid3 = GUICtrlCreateButton("SearchAndroid3", $mL3, $mT3, 80, 22)
  
    GUICtrlCreateTabItem("Others")
  
    GUICtrlCreateTabItem("") ; end tabitem definition


  

$Hide = GUICtrlCreateButton("<", 585, 8, 17, 140, BitOR($BS_CENTER, $BS_FLAT, $BS_MULTILINE))
;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd2, "int", 100, "long", 0x00040001);slide in from left
GUISetState()

Slide_out()
While 1
    $msg1 = GUIGetMsg()
 
   Select
   Case $msg1=$GUI_EVENT_CLOSE
   ExitLoop
   Case $msg1=$Hide
   Slide_out()
   Case $msg1=$Show
   Slide_in()
 ;---------------------------------------------------
   Case $msg1=$HTS
   Slide_out()
   ToHTS()
   Case $msg1=$HTSTrade
   Slide_out()
   ToHTSTrade()
   Case $msg1=$BuySell4
   Slide_out()
   ToBuySell4()
   Case $msg1=$BuySell5
   Slide_out()
   ToBuySell5()
   Case $msg1=$BuySell6
   Slide_out()
   ToBuySell6()
   Case $msg1=$BuySell7
   Slide_out()
   ToBuySell7()
   Case $msg1=$AutodanRC16
   Slide_out()
   ToAutodanRC16()
   ;---------------------------------------------------
  
   Case $msg1 = $LiveMail
   Slide_out()
   Run("C:\\Program Files (x86)\\Windows Live\\Mail\\wlmail.exe")
   Case $msg1 = $Spider
   Slide_out()
   Run("C:\\Users\\USER\\Desktop\\spider.exe")
 
 Case $msg1 = $SaveToHtml
   Slide_out()
   Run("C:\\HTSMini\\SaveToHtml.exe")
 
   ;---------------------------------------------------
   Case $msg1 = $Gmail
   Slide_out()
   Run("C:\\HTSMini\\MyBlog\\Gmail.exe")
  
  
  ;-----------------------------------------------------------
 Case $msg1 = $wordpress
   Slide_out()
   Local $oIE = _IECreate("http://localhost:8088/wordpress",1,1,0)
 Case $msg1 = $LifeType1
   Slide_out()
   Local $oIE = _IECreate("http://localhost:8088/LifeType/index.php?blogId=1",1,1,0)
 Case $msg1 = $LifeType2
   Slide_out()
   Local $oIE = _IECreate("http://localhost:8088/LifeType/index.php?blogId=3",1,1,0)
 ;-------------------------------------------------------------------------------
 Case $msg1 = $JPText
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPText.html",1,1,0)
 Case $msg1 = $JPShowAllText
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPShowAllText.html",1,1,0)
 Case $msg1 = $JPSingle
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPSingle.html",1,1,0)
   Case $msg1 = $JPLib
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPLib.html",1,1,0)
   Case $msg1 = $JPMyData
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPMyData.html",1,1,0)
 Case $msg1 = $JPDouble
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPDouble.html",1,1,0)
 Case $msg1 = $JPThree
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPThree.html",1,1,0)
 Case $msg1 = $JPRSS
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPRSS.html",1,1,0)
 Case $msg1 = $JPMusic
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPMusic.html",1,1,0)
 Case $msg1 = $JPVedio
   Slide_out()
   Local $oIE = _IECreate("http://localhost/JPVedio.html",1,1,0)
  Case  $msg1 = $EditLib
   Slide_out()
   $oIE = _IECreate ("http://localhost/EditLib.aspx",1,1,0)
 Case $msg1=$shutdown
   Slide_out()
   Toshutdown()
   ;---------------------------------------------------------------
   Case  $msg1 = $searchjava
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/searchjava.html",1,1,0)
  
     Case  $msg1 = $searchSwing
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/searchSwing.html",1,1,0)
  
   Case  $msg1 = $searchJavaKing
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/searchJavaKing.html",1,1,0)
  
  Case  $msg1 = $searchaspx
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/searchaspx.html",1,1,0)
  
  Case  $msg1 = $SearchAndroid1
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchAndroid1.html",1,1,0)
  
   Case  $msg1 = $SearchAndroid2
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchAndroid2.html",1,1,0)
  
   Case  $msg1 = $SearchAndroid3
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchAndroid3.html",1,1,0)  
  
  Case  $msg1 = $SearchHTML5
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchHTML5.html",1,1,0)

   Case  $msg1 = $SearchJQ
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchJQ.html",1,1,0)
  
  Case  $msg1 = $SearchUI
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchUI.html",1,1,0)
  
   Case  $msg1 = $SearchLib
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchLib.html",1,1,0)
  
  Case  $msg1 = $SearchMyData
   Slide_out()
   $oIE = _IECreate ("http://localhost/00search/SearchMyData.html",1,1,0)

  
  
 
   EndSelect

 
   
WEnd
GUIDelete()

Exit
;-----------------------------------------------------------------------------------------------------

Func Slide_in()
 $hide_state = 0
 ;Btn_reset()
 GUISetState(@SW_HIDE, $hwnd)
 If $side = "left" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd2, "int", 100, "long", 0x00040001);slide in from left
 WinActivate($hwnd2)
 WinWaitActive($hwnd2)
EndFunc   ;==>Slide_in
;-----------------------------------------------------------------------------------------------------

Func Slide_out()
 $hide_state = 1
 ;Btn_reset()
 If $side = "left" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd2, "int", 100, "long", 0x00050002);slide out to left
 GUISetState(@SW_SHOW, $hwnd)
 WinActivate($hwnd)
 WinWaitActive($hwnd)
EndFunc   ;==>Slide_out
;-----------------------------------------------------------------------------------------------------
Func Toshutdown()
 If WinExists("Information", "") Then
   WinActivate("Information", "")
   ControlClick("Information", "","[Class:TButton; Instance:1; ClassnameNN:TButton1]", "left")
  
  Sleep(1000)
  IF ProcessExists("JSCOM.EXE") Then
     ProcessClose("JSCOM.EXE")
     ProcessClose("JSHTSMain.exe")
     Sleep(1000)
  EndIf
 EndIf
 If ProcessExists($HTSTrade_name) Then
  ProcessClose($HTSTrade_name)
  Sleep(1000)
 EndIf
 Run("Shutdown -s -f")
;Shutdown(11)

EndFunc
;-----------------------------------------------------------------------------------------------------

Func ToAutodanRC16()
 Run($Auto_PATH)  
EndFunc
;-----------------------------------------------------------------------------------------------------


Func ToBuySell7()
If ProcessExists($7_name) Then
 ProcessClose($7_name)
 Sleep(1000)
EndIf
Run($7_PATH)  
Sleep(1000)
WinActivate($7_WIN, "")  


EndFunc
;-----------------------------------------------------------------------------------------------------

Func ToBuySell6()
If ProcessExists($6_name) Then
 ProcessClose($6_name)
 Sleep(1000)
EndIf
Run($6_PATH)  
Sleep(1000)
WinActivate($6_WIN, "")  


EndFunc
;-----------------------------------------------------------------------------------------------------

Func ToBuySell5()

If ProcessExists($5_name) Then
 ProcessClose($5_name)
 Sleep(1000)
EndIf
Run($5_PATH)  
Sleep(1000)
WinActivate($5_WIN, "")  


EndFunc
;-----------------------------------------------------------------------------------------------------

Func ToBuySell4()

 If ProcessExists($4_name) Then
  ProcessClose($4_name)
  Sleep(1000)
 EndIf
 Run($4_PATH)  
 WinActivate($4_WIN, "")  


EndFunc
;-----------------------------------------------------------------------------------------------------


 

( 知識學習隨堂筆記 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=ezkang3245&aid=16574796