Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/06/2017 in all areas

  1. If StringRegExp($Clipboard, "30(?:0[1-9]|[12][0-9]|30)") Then found_number()
    3 points
  2. trancexx

    XM Play (Extended Module)

    This is my another try on playing XM music in AutoIt. Usually you would need third party dll to play this music. The problem is need for both x86 and x64 dlls for universal application. Deploying these new files has its own downsides. That's why I decided to write my engine for the player. It's written in c++ following available XM documentation, and compiled using free version of Visual Studio. After that binary data is extracted and embedded compressed inside the script. When the script is used the code is decompressed. Download zip file and extract folder inside together with all files (most of them are XM music files of my choice), run Player.au3 and see if it's working for you. XM_Play.zip There are no dlls, external files or anything else of such kind. Available functions are: Load_XM Free_XM Pause_XM Play_XM Vol_XM Player.au3 is just an example. ...Oh, and you can load online XMs directly specifying URL.
    1 point
  3. What about something like this: #include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> Global $aImageList[3] _GDIPlus_Startup() $aImageList[0] = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\Merlin.gif") $aImageList[1] = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg") $aImageList[2] = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg") $hGUI1 = GUICreate("GUI", 640, 480, 200, 150) $hGUI2 = GUICreate("", 640, 480, 0, 0, $WS_POPUP, BitOR($WS_EX_MDICHILD,$WS_EX_LAYERED, $WS_EX_TOPMOST),$hGUI1) GUISetState(@SW_SHOW, $hGUI1) GUISetState(@SW_SHOW, $hGUI2) _SetBitmap($hGUI2, $aImageList[0]) _SetBitmap($hGUI2, $aImageList[1]) _SetBitmap($hGUI2, $aImageList[2]) _GDIPlus_Shutdown() Func _SetBitmap($hGUI, $hGUI_Image) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hGUI_Image) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hGUI_Image)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hGUI_Image)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Format", 1) Sleep(1000) For $i = 5 to 255 step 5 DllStructSetData($tBlend, "Alpha", $i) _WinAPI_UpdateLayeredWindow($hGUI2, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) Sleep(40) Next Sleep(1000) For $i = 250 to 0 step -5 DllStructSetData($tBlend, "Alpha", $i) _WinAPI_UpdateLayeredWindow($hGUI2, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) Sleep(40) Next Sleep(500) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) _GDIPlus_ImageDispose($hGUI_Image) EndFunc This is a modified version of UEZ code here:
    1 point
  4. You can do something like this. #include <GUIConstantsEx.au3> #include <GUIToolTip.au3> ; Create a GUI with various controls. Global $hGUI = GUICreate("Example", 210, 670) Global $idBtnCheck = GUICtrlCreateButton("Check", 60, 630, 80, 30) Global $aEdit[20] For $i = 0 To UBound($aEdit) - 1 $aEdit[$i] = GUICtrlCreateInput("", 30, ($i + 1) * 30, 150,20) Next ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idBtnCheck If _CheckEdits() Then MsgBox(0,"","All fields OK") EndIf EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) Func _CheckEdits() For $i=0 to UBound($aEdit)-1 If GUICtrlRead($aEdit[$i])="" Then ConsoleWrite($i & @CRLF) Local $aGUIPos = WinGetPos($hGUI) Local $aCtrlPos = ControlGetPos($hGUI, "", $aEdit[$i]) ToolTip("You must fill this input", $aGUIPos[0] + $aCtrlPos[0] + 150, $aGUIPos[1] + $aCtrlPos[1] + 30,"",0,1) AdlibRegister(_HideToolTip,2000) _ColorNotification($aEdit[$i]) Return False EndIf Next Return True EndFunc Func _ColorNotification($ID) For $i=1 to 15 GUICtrlSetBkColor($ID,Random(0, 0xFFFFFF, 1)) Sleep(50) Next GUICtrlSetBkColor($ID,0xFFFFFF) EndFunc Func _HideToolTip() ToolTip("") AdlibUnRegister(_HideToolTip) EndFunc Saludos
    1 point
  5. careca

    Power Profiles

    Set a profile as active, delete, duplicate, export and import. Still have to take care of the icons and stuff like that. Tell me what you think. EDIT: Updated version in downloads (signature).
    1 point
  6. Taking a closer look at the site's coding, it appears to contain multiple forms with the same elements. Therefore, you will have to first identify the correct form and then access it's elements.
    1 point
  7. rootx, Here's something I did a while ago up...hope it helps... ; example of using stdout with network commands #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> #include <StaticConstants.au3> Local $Gui010 = GUICreate("Network Properties", 800, 600) Local $Button1 = GUICtrlCreateButton("IPCONFIG",10, 10, 75, 25) Local $Button2 = GUICtrlCreateButton("NETSTAT", 90, 10, 75, 25) Local $clear = GUICtrlCreateButton("Clear Display", 700, 10, 90, 25) GUICtrlSetBkColor($clear,0xaaaaaa) GUICtrlSetFont($clear,10,800,default,'times new roman') GUICtrlCreateLabel("PARM = ",175,15,50,25) Local $parm = GUICtrlCreateEdit('',225,10,75,25,$ss_sunken) GUICtrlSetFont($parm,12,800) GUICtrlSetState($parm,$gui_focus) Local $Edit010 = GUICtrlCreateEdit("", 10,40,780,550, $ES_AUTOVSCROLL + $WS_VSCROLL + $ws_hscroll + $es_readonly) GUICtrlSetFont(-1,8.5,800,default,'courier new') GUISetState(@SW_SHOW) Local $rslt,$out While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE _do_exit_stuff() Case $msg = $Button1 $rslt = Run(@ComSpec & " /c ipconfig " & GUICtrlRead($parm), @SystemDir, @SW_HIDE, $STDERR_MERGED + $STDOUT_CHILD) While 1 $out = StdoutRead($rslt) If @error then exitloop GUICtrlSetData($edit010,$out & @lf,1) WEnd Case $msg = $Button2 $rslt = Run(@ComSpec & " /c netstat " & GUICtrlRead($parm), @SystemDir, @SW_HIDE, $STDERR_MERGED + $STDOUT_CHILD) While 1 $out = StdoutRead($rslt) If @error then exitloop GUICtrlSetData($edit010,$out & @lf,1) WEnd Case $msg = $clear GUICtrlSetData($edit010,"") EndSelect WEnd func _do_exit_stuff() ; whatever you want here Exit endfunc kylomas
    1 point
×
×
  • Create New...