Jump to content

newsak2005

Active Members
  • Posts

    38
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

newsak2005's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Example:AutoItX3Control & WScriptShell ;============AutoItX3 & WScript Object Shell============== Local $oAutoIt, $ShellObj $oAutoIt=ObjCreate("AutoItX3.Control") $ShellObj=ObjCreate("WScript.Shell") $ShellObj.Popup ("Run Notepad", 0, "Sample", 0) $ShellObj.Run ("Notepad.exe", 1, False) $oAutoIt.WinWait("[Class:Notepad]") $oAutoIt.WinMove("[Class:Notepad]", "", 320, 270, 400, 250) $oAutoIt.Sleep(1000) $ShellObj.SendKeys ("Send text with WScript.Shell"&@CRLF) $oAutoIt.Sleep(1500) $oAutoIt.Send("Send text with AutoItX3.Control") $oAutoIt.Sleep(1500) $oAutoIt.WinClose("[Class:Notepad]") $oAutoIt.Sleep(1500) MsgBox(64, "Sample", "ExitApp", 1) $oAutoIt.Send("!N") ;=========================================================
  2. Title Clock. Use AutoItX3 Com Object. #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <Date.au3> Opt("MustDeclareVars", 1) _DateTime() Func _DateTime() GUICreate('', @DesktopWidth/3-75, @DesktopHeight/4-195, 740, 10, _ BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS), _ BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) GUISetIcon("shell32.dll", 47) GUISetState() Local $oAutoIt = ObjCreate("AutoItX3.Control") Do Local $title = $oAutoIt.WinGetTitle('') $oAutoIt.WinSetTitle($title, "",_DateDayOfWeek( @WDAY, 1)&' '& _ _DateTimeFormat( _ _NowCalc(), 1)&' '& _ _NowTime()) Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc
  3. Confirm newsak2005 is sak2005 Please know that this is a rogue aut quarrelsome
  4. Thanks. credit: JohnOne, trancexx, '================= VBS Script ========================== Dim oAutoIt Set oAutoIt = WScript.CreateObject("AutoItX3.Control") oAutoIt.ToolTip "This is some tip from AutoItX version" oAutoIt.Sleep(2000) oAutoIt.ToolTip "Bye bye now" oAutoIt.Sleep(800) '======================================================= ######################################################## ;================= AU3X Script ========================== Local $oAutoIt $oAutoIt = ObjCreate("AutoItX3.Control") $oAutoIt.ToolTip("This is some tip from AutoItX version") $oAutoIt.Sleep(2000) $oAutoIt.ToolTip("Bye bye now") $oAutoIt.Sleep(800) ;======================================================= ######################################################## //================== JS Script =========================== var oAutoIt; oAutoIt = new ActiveXObject("AutoItX3.Control"); oAutoIt.ToolTip("This is some tip from AutoItX version"); oAutoIt.Sleep(2000); oAutoIt.ToolTip("Bye bye now"); oAutoIt.Sleep(800); //========================================================
  5. Last Script. NotePad Effect. FadeIn & FadeOut. $pid = DllCall("AutoItX3.dll", "int", "AU3_Run", "str", "Notepad.exe", "str", "", "long", 0) DllCall("AutoItX3.dll", "int", "AU3_WinWait", "str", "[CLASS:Notepad]", "str", "", "long", 1) DllCall("AutoItX3.dll", "int", "AU3_WinSetTrans", "str", "[CLASS:Notepad]", "str", "", "long", 0) WinSetState("[CLASS:Notepad]", "", @SW_SHOW) DllCall("AutoItX3.dll", "int", "AU3_WinMove", "str", "[CLASS:Notepad]", "str", "", "long", 400, "long", 300, "long", 300, "long", 200) For $i = 0 To 255 Step 3 DllCall("AutoItX3.dll", "int", "AU3_WinSetTrans", "str", "[CLASS:Notepad]", "str", "", "long", $i) Sleep(1) Next DllCall("AutoItX3.dll", "int", "AU3_Sleep", "long", 500) DllCall("AutoItX3.dll", "int", "AU3_ControlSetText", "str", "[Class:Notepad]", "str", "", "str", "Edit1", "str", "FadeIn") DllCall("AutoItX3.dll", "int", "AU3_Sleep", "long", 3000) DllCall("AutoItX3.dll", "int", "AU3_ControlSetText", "str", "[Class:Notepad]", "str", "", "str", "Edit1", "str", "FadeOut") DllCall("AutoItX3.dll", "int", "AU3_Sleep", "long", 1000) For $i = 255 To 0 Step -3 DllCall("AutoItX3.dll", "int", "AU3_WinSetTrans", "str", "[CLASS:Notepad]", "str", "", "long", $i) Sleep(1) Next DllCall("AutoItX3.dll", "int", "AU3_Sleep", "long", 1000) DllCall("AutoItX3.dll", "int", "AU3_ProcessClose", "str", $pid[0]) Exit
  6. AU3 ToolTip Library Function ;==================================Start script sample========================================== Global $dll = DllOpen("AutoItX3.dll") _sample() Func _sample() Local $i = 0 Do $i +=1 _AU3_ToolTip("Timer:"&$i&'/9', 400, 300) Sleep(1000) Until $i >= 9 EndFunc ;====================================Library script============================================= Global $text, $Left, $Top Func _AU3_ToolTip($text, $Left, $Top) Local $sRet = DllCall($dll, "int", "AU3_ToolTip", "str", $text, "long", $Left, "long", $Top) If(@error)Or(Not $sRet)Then Return SetError(1, 0, 0) Return $sRet[0] EndFunc DllClose($dll) ;==================================End script sample============================================
  7. My MessageBox Function #cs==========Info============== Createdate:15/AUG/2011 Name:My MsgBox Function Sample Discript:Script in Function Design:sak2005 #ce============================ Global $flag, $title, $text, $timeout, $hwnd Func _MessageBox($flag, $title, $text, $timeout, $hwnd) Local $sRet = (MsgBox($flag, $title, $text, $timeout, $hwnd)) If(@error)Or(Not $sRet) Then Return SetError(1, 0, 0) Return $sRet EndFunc ;---------------------------------------------------------- ;Sample Script. 0x3 is hex result..Yes, No, Cancel. Do Local $btn = _MessageBox(0x3, "MsgBox Sample", "Do you wanted Test Button?", 0, $hwnd) Switch $btn Case 6 _MessageBox(64, "MsgBox Sample", "You Clicked..Yes", 0, $hwnd) Case 7 _MessageBox(64, "MsgBox Sample", "You Clicked..No", 0, $hwnd) Case Else _MessageBox(64, "MsgBox Sample", "You Clicked..Cancel to ExitApp", 0, $hwnd) ExitLoop EndSwitch Sleep(10) Until False
  8. Use ToolTip #NoTrayIcon #cs===============Info==================== Createdate:15/AUG/2011 Name:IpPackSetMouseCursor Discript:Show ip package number with mouse Design:sak2005 #ce======================================= Opt("TrayMenuMode",1) Opt("TrayOnEventMode",1) Global $sURL = 'www.google.com' _main() Func _main() If @IPAddress1 = '127.0.0.1'Then MsgBox(64, "", "Pleased First Connections") Exit Else Local $about = TrayCreateItem("About") TrayItemSetOnEvent($about,"_About") TrayCreateItem("") Local $exit = TrayCreateItem("Exit") TrayItemSetOnEvent($exit,"_ExitApp") TraySetState() TraySetIcon("shell32.dll", -47) TraySetToolTip("Exit") Do Local $iPing = Ping($sURL, 4000) Switch $iPing Case 0 ToolTip('ONLINE'&@CRLF&'No, signal') Case Else ToolTip('ONLINE'&@CRLF&'Package = '&$iPing&'.ms') EndSwitch Sleep(10) Until @IPAddress1 = '127.0.0.1' EndIf EndFunc Func _About() MsgBox(64, "", "Create by:sak2005") EndFunc Func _ExitApp() Exit EndFunc =========================================================== Use GUI (For mobile net modem) #NoTrayIcon #cs============Info================= Createdate:15/AUG/2011 Name:MobileNetMeter Style:GUI glass Discript:View Package ping indicate. DesignBy:Sak2005 #ce================================= #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #Include <WinAPI.au3> HotKeySet("{ESC}", "_hkExitApp") Global $sURL='www.google.com' $hWnd = GUICreate("Form1", 111, 58, 920, 670, _ BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_POPUP,$WS_GROUP,$WS_CLIPSIBLINGS), _ BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE,$WS_EX_LAYERED)) GUISetBkColor(0xABABAB) $Progress1 = GUICtrlCreateProgress(12, 36, 12, 12) $Progress2 = GUICtrlCreateProgress(26, 28, 14, 20) $Progress3 = GUICtrlCreateProgress(42, 24, 14, 25) $Progress4 = GUICtrlCreateProgress(58, 16, 14, 33) $Progress5 = GUICtrlCreateProgress(74, 8, 14, 41) GUISetState(@SW_SHOW) For $i = 0 To 255 Step 4 _WinAPI_SetLayeredWindowAttributes($hWnd, 0xABABAB, $i, BitOR($LWA_COLORKEY, $LWA_ALPHA)) Sleep(1) Next Do $iPing = Ping($sURL, 4000) Select Case $iPing = 0 GUICtrlSetData($Progress1, 0) GUICtrlSetData($Progress2, 0) GUICtrlSetData($Progress3, 0) GUICtrlSetData($Progress4, 0) GUICtrlSetData($Progress5, 0) Case $iPing < 300 GUICtrlSetData($Progress1, 100) GUICtrlSetData($Progress2, 100) GUICtrlSetData($Progress3, 0) GUICtrlSetData($Progress4, 0) GUICtrlSetData($Progress5, 0) Case $iPing < 400 GUICtrlSetData($Progress1, 100) GUICtrlSetData($Progress2, 100) GUICtrlSetData($Progress3, 100) GUICtrlSetData($Progress4, 0) GUICtrlSetData($Progress5, 0) Case $iPing < 500 GUICtrlSetData($Progress1, 100) GUICtrlSetData($Progress2, 100) GUICtrlSetData($Progress3, 100) GUICtrlSetData($Progress4, 100) GUICtrlSetData($Progress5, 0) Case $iPing < 600 GUICtrlSetData($Progress1, 100) GUICtrlSetData($Progress2, 100) GUICtrlSetData($Progress3, 100) GUICtrlSetData($Progress4, 100) GUICtrlSetData($Progress5, 100) EndSelect Until GUIGetMsg()=$GUI_EVENT_CLOSE Func _hkExitApp() Exit EndFunc
  9. Use ToolTip Global $sURL = 'www.google.com' HotKeySet("{ESC}", "hkExitApp") Do $iPing = Ping($sURL, 4000) If @IPAddress1 = '192.0.0.1' Then ToolTip('OFFLINE'&@CRLF&'Package = '&$iPing&'.ms') Else ToolTip('ONLINE'&@CRLF&'Package = '&$iPing&'.ms') EndIf Sleep(10) Until False Func hkExitApp() Exit EndFunc
  10. Debug, Hide Desktop & Taskbar. SafetyFirst. #NoTrayIcon #cs=============Info================ createdate:14/AUG/2011 name:DeskTask Manager type:GuiUserInterfade(Freeware Demo) skin:Glass discription:State on screen support:WindowsXP designby:Sak2005 #ce================================= #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <WinAPI.au3> #Include <GuiButton.au3> Opt("MustDeclareVars", 1) Global $title = 'DeskTask manager' Global $hForm, $Btn_HTV, $Btn_HTB, $Btn_HSB, $Btn_HDT Global $nMsg, $iButton, $btn, $i _main() Func _main() $hForm = GUICreate($title, 280, 107, 370, 213, -1, BitOR($WS_EX_TOPMOST,$WS_EX_LAYERED)) GUISetBkColor(0xABABAB) $Btn_HTV = GUICtrlCreateButton("Hide TaskViewIcon", 20, 20, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Btn_HTB = GUICtrlCreateButton("Hide Taskbar", 150, 20, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Btn_HSB = GUICtrlCreateButton("Hide Start Button", 20, 60, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Btn_HDT = GUICtrlCreateButton("Hide Desktop", 150, 60, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) GUISetState() _FadeIn() If @OSVersion <> 'Win_XP' Then MsgBox(48, "Warning!", "Support:WindowsXP") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE If _GUICtrlButton_GetText($Btn_HDT)='Show Desktop'Then MsgBox(0, "SafetyFirst", "Pleased show desktop now.") ElseIf _GUICtrlButton_GetText($Btn_HTB)='Show Taskbar' Then MsgBox(0, "SafetyFirst", "Pleased show taskbar now.") Else $btn = MsgBox(36, "", "Do you wanted to Exit?.") If $btn = 6 Then _FadeOut() Exit EndIf EndIf Case $Btn_HTV $iButton = _GUICtrlButton_GetText($Btn_HTV) Select Case $iButton='Hide TaskViewIcon' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Btn_HTV)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") _GUICtrlButton_SetText($Btn_HTV, 'Show TaskViewIcon') EndIf Case $iButton='Show TaskViewIcon' MsgBox(64, "", _GUICtrlButton_GetText($Btn_HTV)) ControlShow("[Class:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") _GUICtrlButton_SetText($Btn_HTV, 'Hide TaskViewIcon') EndSelect Case $Btn_HTB $iButton = _GUICtrlButton_GetText($Btn_HTB) Select Case $iButton='Hide Taskbar' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Btn_HTB)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", "") _GUICtrlButton_SetText($Btn_HTB, 'Show Taskbar') EndIf Case $iButton='Show Taskbar' MsgBox(64, "", _GUICtrlButton_GetText($Btn_HTB)) ControlShow("[Class:Shell_TrayWnd]", "", "") _GUICtrlButton_SetText($Btn_HTB, 'Hide Taskbar') EndSelect Case $Btn_HSB $iButton = _GUICtrlButton_GetText($Btn_HSB) Select Case $iButton='Hide Start Button' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Btn_HSB)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", 304) _GUICtrlButton_SetText($Btn_HSB, 'Show Start Button') EndIf Case $iButton='Show Start Button' MsgBox(64, "", _GUICtrlButton_GetText($Btn_HSB)) ControlShow("[Class:Shell_TrayWnd]", "", 304) _GUICtrlButton_SetText($Btn_HSB, 'Hide Start Button') EndSelect Case $Btn_HDT $iButton = _GUICtrlButton_GetText($Btn_HDT) Select Case $iButton='Hide Desktop' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Btn_HDT)) If $btn = 1 Then ControlHide("[CLASS:Progman]", "", "[CLASS:SysListView32; INSTANCE:1]") _GUICtrlButton_SetText($Btn_HDT, 'Show Desktop') EndIf Case $iButton='Show Desktop' MsgBox(64, "", _GUICtrlButton_GetText($Btn_HDT)) ControlShow("[CLASS:Progman]", "", "[CLASS:SysListView32; INSTANCE:1]") _GUICtrlButton_SetText($Btn_HDT, 'Hide Desktop') ControlSend("[CLASS:Progman; TITLE:Program Manager]", "", "", "{F5}") EndSelect EndSwitch WEnd EndFunc Func _FadeIn() For $i = 0 To 255 Step 4 _WinAPI_SetLayeredWindowAttributes($hForm, 0xABABAB, $i, BitOR($LWA_COLORKEY, $LWA_ALPHA)) Sleep(1) Next EndFunc Func _FadeOut() For $i = 255 To 0 Step -4 _WinAPI_SetLayeredWindowAttributes($hForm, 0xABABAB, $i, BitOR($LWA_COLORKEY, $LWA_ALPHA)) Sleep(1) Next EndFunc ;==>desktaskmanager.
  11. DeskTop Task Manager GuiUserInterfade Demo. #NoTrayIcon #cs=============Info================ createdate:14/AUG/2011 name:DeskTask Manager type:GuiUserInterfade(Freeware Demo) discription:state on screen support:WindowsXP designby:sak2005 #ce================================= #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <WinAPI.au3> #Include <GuiButton.au3> Global $title = 'DeskTask manager' _main() Func _main() $hForm = GUICreate($title, 465, 63, 0, -100, -1, BitOR($WS_EX_TOPMOST,$WS_EX_LAYERED)) GUISetBkColor(0xA6CAF0) $Button1 = GUICtrlCreateButton("Hide TaskViewIcon", 5, 8, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Button2 = GUICtrlCreateButton("Hide Taskbar", 120, 8, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Button3 = GUICtrlCreateButton("Hide Start Button", 235, 8, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Button4 = GUICtrlCreateButton("Hide Desktop", 350, 8, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) _FadeIn() If @OSVersion <> 'Win_XP' Then MsgBox(48, "Warning!", "Support:WindowsXP") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _FadeOut() Exit Case $Button1 $iButton = _GUICtrlButton_GetText($Button1) Select Case $iButton='Hide TaskViewIcon' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button1)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") _GUICtrlButton_SetText($Button1, 'Show TaskViewIcon') EndIf Case $iButton='Show TaskViewIcon' MsgBox(64, "", _GUICtrlButton_GetText($Button1)) ControlShow("[Class:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") _GUICtrlButton_SetText($Button1, 'Hide TaskViewIcon') EndSelect Case $Button2 $iButton = _GUICtrlButton_GetText($Button2) Select Case $iButton='Hide Taskbar' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button2)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", "") _GUICtrlButton_SetText($Button2, 'Show Taskbar') EndIf Case $iButton='Show Taskbar' MsgBox(64, "", _GUICtrlButton_GetText($Button2)) ControlShow("[Class:Shell_TrayWnd]", "", "") _GUICtrlButton_SetText($Button2, 'Hide Taskbar') EndSelect Case $Button3 $iButton = _GUICtrlButton_GetText($Button3) Select Case $iButton='Hide Start Button' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button3)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", 304) _GUICtrlButton_SetText($Button3, 'Show Start Button') EndIf Case $iButton='Show Start Button' MsgBox(64, "", _GUICtrlButton_GetText($Button3)) ControlShow("[Class:Shell_TrayWnd]", "", 304) _GUICtrlButton_SetText($Button3, 'Hide Start Button') EndSelect Case $Button4 $iButton = _GUICtrlButton_GetText($Button4) Select Case $iButton='Hide Desktop' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button4)) If $btn = 1 Then ControlHide("[CLASS:Progman]", "", "[CLASS:SysListView32; INSTANCE:1]") _GUICtrlButton_SetText($Button4, 'Show Desktop') EndIf Case $iButton='Show Desktop' MsgBox(64, "", _GUICtrlButton_GetText($Button4)) ControlShow("[CLASS:Progman]", "", "[CLASS:SysListView32; INSTANCE:1]") _GUICtrlButton_SetText($Button4, 'Hide Desktop') ControlSend("[CLASS:Progman; TITLE:Program Manager]", "", "", "{F5}") EndSelect EndSwitch WEnd EndFunc Func _FadeIn() $iPos = WinGetPos($title) If $iPos[1] = -100 Then If WinMove($title, "", 283, 268, 465, 65)Then For $i = 0 To 255 Step 4 WinSetTrans($title, "", $i) Sleep(1) Next EndIf EndIf EndFunc Func _FadeOut() For $i = 255 To 0 Step -4 WinSetTrans($title, "", $i) Sleep(1) Next EndFunc=========================================================== Glass Skin #NoTrayIcon #cs=============Info================ createdate:14/AUG/2011 name:DeskTask Manager type:GuiUserInterfade(Freeware Demo) skin:Glass discription:State on screen support:WindowsXP designby:Sak2005 #ce================================= #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <WinAPI.au3> #Include <GuiButton.au3> Global $hForm, $title = 'DeskTask manager' _main() Func _main() $hForm = GUICreate($title, 280, 107, 300, 300, -1, BitOR($WS_EX_TOPMOST,$WS_EX_LAYERED)) GUISetBkColor(0xABABAB) $Button1 = GUICtrlCreateButton("Hide TaskViewIcon", 20, 20, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Button2 = GUICtrlCreateButton("Hide Taskbar", 150, 20, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Button3 = GUICtrlCreateButton("Hide Start Button", 20, 60, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) $Button4 = GUICtrlCreateButton("Hide Desktop", 150, 60, 110, 25, $WS_GROUP) GUICtrlSetCursor (-1, 0) GUISetState() _FadeIn() If @OSVersion <> 'Win_XP' Then MsgBox(48, "Warning!", "Support:WindowsXP") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _FadeOut() Exit Case $Button1 $iButton = _GUICtrlButton_GetText($Button1) Select Case $iButton='Hide TaskViewIcon' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button1)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") _GUICtrlButton_SetText($Button1, 'Show TaskViewIcon') EndIf Case $iButton='Show TaskViewIcon' MsgBox(64, "", _GUICtrlButton_GetText($Button1)) ControlShow("[Class:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") _GUICtrlButton_SetText($Button1, 'Hide TaskViewIcon') EndSelect Case $Button2 $iButton = _GUICtrlButton_GetText($Button2) Select Case $iButton='Hide Taskbar' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button2)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", "") _GUICtrlButton_SetText($Button2, 'Show Taskbar') EndIf Case $iButton='Show Taskbar' MsgBox(64, "", _GUICtrlButton_GetText($Button2)) ControlShow("[Class:Shell_TrayWnd]", "", "") _GUICtrlButton_SetText($Button2, 'Hide Taskbar') EndSelect Case $Button3 $iButton = _GUICtrlButton_GetText($Button3) Select Case $iButton='Hide Start Button' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button3)) If $btn = 1 Then ControlHide("[Class:Shell_TrayWnd]", "", 304) _GUICtrlButton_SetText($Button3, 'Show Start Button') EndIf Case $iButton='Show Start Button' MsgBox(64, "", _GUICtrlButton_GetText($Button3)) ControlShow("[Class:Shell_TrayWnd]", "", 304) _GUICtrlButton_SetText($Button3, 'Hide Start Button') EndSelect Case $Button4 $iButton = _GUICtrlButton_GetText($Button4) Select Case $iButton='Hide Desktop' $btn = MsgBox(33, "", _GUICtrlButton_GetText($Button4)) If $btn = 1 Then ControlHide("[CLASS:Progman]", "", "[CLASS:SysListView32; INSTANCE:1]") _GUICtrlButton_SetText($Button4, 'Show Desktop') EndIf Case $iButton='Show Desktop' MsgBox(64, "", _GUICtrlButton_GetText($Button4)) ControlShow("[CLASS:Progman]", "", "[CLASS:SysListView32; INSTANCE:1]") _GUICtrlButton_SetText($Button4, 'Hide Desktop') ControlSend("[CLASS:Progman; TITLE:Program Manager]", "", "", "{F5}") EndSelect EndSwitch WEnd EndFunc Func _FadeIn() For $i = 0 To 255 Step 4 _WinAPI_SetLayeredWindowAttributes($hForm, 0xABABAB, $i, BitOR($LWA_COLORKEY, $LWA_ALPHA)) Sleep(1) Next EndFunc Func _FadeOut() For $i = 255 To 0 Step -4 _WinAPI_SetLayeredWindowAttributes($hForm, 0xABABAB, $i, BitOR($LWA_COLORKEY, $LWA_ALPHA)) Sleep(1) Next EndFunc ;==>desktaskmanager.
  12. Use Library Include #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #Include <GuiButton.au3> $hForm = GUICreate("OneTouchButton", 308, 95, -1, -1) $Button = GUICtrlCreateButton("Button 1", 112, 56, 75, 25) $Label = GUICtrlCreateLabel("Clicked Report", 90, 16, 110, 17, $SS_CENTER) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button Switch GUICtrlButton_GetText($Button) Case "Button 1" GUICtrlSetData($Label, "You Clicked.."& GUICtrlButton_GetText($Button)) GUISetBkColor(0xFFCCCC) GUICtrlSetData($Button, "Button 2") Case "Button 2" GUICtrlSetData($Label, "You Clicked.."& GUICtrlButton_GetText($Button)) GUISetBkColor(0xCCFFCC) GUICtrlSetData($Button, "Button 3") Case "Button 3" GUICtrlSetData($Label, "You Clicked.."& GUICtrlButton_GetText($Button)) GUISetBkColor(0xCCCCFF) GUICtrlSetData($Button, "Button 1") EndSwitch EndSwitch WEnd Func GUICtrlButton_GetText($hWnd) If $Debug_Btn Then __UDF_ValidateClassName($hWnd, $__BUTTONCONSTANT_ClassName) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) If WinAPI_IsClassName($hWnd, $__BUTTONCONSTANT_ClassName) Then Return WinAPI_GetWindowText($hWnd) Return "" EndFunc Func WinAPI_IsClassName($hWnd, $sClassName) Local $sSeparator = Opt("GUIDataSeparatorChar") Local $aClassName = StringSplit($sClassName, $sSeparator) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $sClassCheck = WinAPI_GetClassName($hWnd) For $x = 1 To UBound($aClassName) - 1 If StringUpper(StringMid($sClassCheck, 1, StringLen($aClassName[$x]))) = StringUpper($aClassName[$x]) Then Return True Next Return False EndFunc Func WinAPI_GetWindowText($hWnd) Local $aResult = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $hWnd, "wstr", "", "int", 4096) If @error Then Return SetError(@error, @extended, "") Return SetExtended($aResult[0], $aResult[2]) EndFunc Func WinAPI_GetClassName($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $aResult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $hWnd, "wstr", "", "int", 4096) If @error Then Return SetError(@error, @extended, False) Return SetExtended($aResult[0], $aResult[2]) EndFunc
  13. Use include GuiButton.au3 With _GUICtrlButton_GetText() #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #Include <GuiButton.au3> $hForm = GUICreate("OneTouchButton", 308, 95, -1, -1) $Button = GUICtrlCreateButton("Button 1", 112, 56, 75, 25) $Label = GUICtrlCreateLabel("Clicked Report", 90, 16, 110, 17, $SS_CENTER) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button Switch _GUICtrlButton_GetText($Button) Case "Button 1" GUICtrlSetData($Label, "You Clicked.."& _GUICtrlButton_GetText($Button)) GUISetBkColor(0xFFCCCC) GUICtrlSetData($Button, "Button 2") Case "Button 2" GUICtrlSetData($Label, "You Clicked.."& _GUICtrlButton_GetText($Button)) GUISetBkColor(0xCCFFCC) GUICtrlSetData($Button, "Button 3") Case "Button 3" GUICtrlSetData($Label, "You Clicked.."& _GUICtrlButton_GetText($Button)) GUISetBkColor(0xCCCCFF) GUICtrlSetData($Button, "Button 1") EndSwitch EndSwitch WEnd
  14. Use Select Case. Melba23. Borrowing the idea of......... #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $hForm = GUICreate("OneTouchButton", 308, 95, -1, -1) $Button = GUICtrlCreateButton("Button 1", 112, 56, 75, 25) $Label = GUICtrlCreateLabel("Clicked Report", 90, 16, 110, 17, $SS_CENTER) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button $iButton = GUICtrlRead($Button) Select Case $iButton="Button 1" GUICtrlSetData($Label, "You Clicked..Button 1 ") GUISetBkColor(0xFFCCCC) GUICtrlSetData($Button, "Button 2") Case $iButton="Button 2" GUICtrlSetData($Label, "You Clicked..Button 2") GUISetBkColor(0xCCFFCC) GUICtrlSetData($Button, "Button 3") Case $iButton="Button 3" GUICtrlSetData($Label, "You Clicked..Button 3") GUISetBkColor(0xCCCCFF) GUICtrlSetData($Button, "Button 1") EndSelect EndSwitch WEnd
×
×
  • Create New...