Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/28/2016 in all areas

  1. GUICtrlCreateTabItem(""); <=========================== This line seems important for what u want doing #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> Opt("GuiOnEventMode", 1) Opt("GUICloseOnESC", 0) Opt("GUIResizeMode", 128) Global $List1,$TabSheet1, $iCount = 1 _test() Func _test() Global $Form1 = GUICreate("Form1", 623, 449, 192, 114) $Tab1 = GUICtrlCreateTab(32, 40, 561, 377) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $Button1 = GUICtrlCreateButton("Button1", 240, 360, 75, 25) $List1 = GUICtrlCreateListView("0", 120, 136, 425, 175) Global $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "_close") GUICtrlSetOnEvent($Button1, "_prova") EndFunc ;==>_test Func _prova() GUICtrlDelete($List1) GUISwitch($Form1, $TabSheet1) $List1 = GUICtrlCreateListView($iCount, 120, 136, 425, 175) $iCount += 1 GUICtrlCreateTabItem(""); <=========================== This line seems important for what u want doing EndFunc ;==>_prova Func _close() Exit EndFunc ;==>_close ;=============================================================== ;Keep the GUI alive ;=============================================================== While 1 Sleep(1000) WEnd
    1 point
  2. Not sure this is helpful to someone other than me ... #include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <WindowsConstants.au3> #include <WinAPISys.au3> Local $hGui = GUICreate("IP Address Control Enable/Disable Example", 400, 300) Local $hIPAddress1 = _GUICtrlIpAddress_Create($hGui, 10, 10) Local $hIPAddress2 = _GUICtrlIpAddress_Create($hGui, 10, 40) Local $hIPAddress3 = _GUICtrlIpAddress_Create($hGui, 10, 70) _GUICtrlIpAddress_Set($hIPAddress1, "192.168.1.10") _GUICtrlIpAddress_Set($hIPAddress2, "255.255.255.0") _GUICtrlIpAddress_Set($hIPAddress3, "192.168.1.1") _GUICtrlIpAddress_Disable($hIPAddress1, 1) _GUICtrlIpAddress_Disable($hIPAddress2, 7) ; 4 + 2 + 1 _GUICtrlIpAddress_Disable($hIPAddress3, 0xf) ; 8 + 4 + 2 + 1 GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GUICtrlIpAddress_Disable ; Description ...: Disable (grays-out) the specified fields of an IP Address control ; Syntax ........: _GUICtrlIpAddress_Disable($hWnd[, $iFields = 0]) ; Parameters ....: $hWnd - Handle to the control ; $iFields - Fields to enable/disable. Can be a combination of the following : ; 0 : Enable all fields ; 1 : Disable the first field ; 2 : Disable the second field ; 4 : Disable the third field ; 8 : Disable the fourth field ; Return values .: On success1 - 1 ; On failure - 0 and set @error to non zero value ; Author ........: jguinch ; =============================================================================================================================== Func _GUICtrlIpAddress_Disable($hWnd, $iFields = 0) Local $aFields[4], $n = 0, $hEdit If Not IsInt($iFields) Or $iFields < 0 Or $iFields > 15 Then Return SetError(3, 0, 0) Local $hWindow = _WinAPI_GetAncestor($hWnd) If @error Then Return SetError(1, 0, 0) If Not $hWindow Or Not WinExists($hWnd) Then Return SetError(2, 0, 0) Local $aFields = _WinAPI_EnumChildWindows ($hWnd, False) If @error Or $aFields[0][0] <> 4 Then Return SetError(1, 0, 0) If $iFields = 0xf Then Return ControlDisable($hWindow, "", $hWnd) Local $iRet = ControlEnable($hWindow, "", $hWnd) For $i = 0 to 3 $iRet *= ( BitAND($iFields, 2 ^ $i) ? ControlDisable($hWindow, "", $aFields[4 - $i][0]) : ControlEnable($hWindow, "", $aFields[4 - $i][0]) ) Next Return $iRet EndFunc
    1 point
  3. Synapsee

    Bass.dll + bass_fx

    hi @jvds, i have try multiple bass reverse/tempo manipulation. I have maybe a first soluce, probably not the best one... I can't really tell how or why. I have just little luck without understand exactly all. #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #include <Bass.au3> #include <BassConstants.au3> #include <BassFX.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $Progress_A Global $Progress_B #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) _GUICtrlCreateProgress(5, 5, 605, 10) $BTNPosLeft = 5 $BTNPosTop = 20 $BTNplay = GUICtrlCreateButton(chrw(9654), $BTNPosLeft, $BTNPosTop, 51, 25) GUICtrlSetFont(-1, 18, 0, 0, "MS Sans Serif") $BTNPosLeft += 51 $BTNStop = GUICtrlCreateButton(chrw(9632), $BTNPosLeft, $BTNPosTop, 51, 25) GUICtrlSetFont(-1, 10, 0, 0, "MS Sans Serif") $BTNPosLeft += 51 $BTNpause = GUICtrlCreateButton(chrw(9646)&chrw(9646), $BTNPosLeft, $BTNPosTop, 51, 25) ;9646 GUICtrlSetFont(-1, 11, 0, 0, "MS Sans Serif") $BTNPosLeft += 51 $BTNReverse = GUICtrlCreateButton(chrw(9664), $BTNPosLeft, $BTNPosTop, 51, 25) GUICtrlSetFont(-1, 18, 0, 0, "MS Sans Serif") $BTNPosLeft += 51 GUISetState(@SW_SHOW) $BTNPosLeft = 5 $BTNTempoUp = GUICtrlCreateButton("TempUp", $BTNPosLeft, $BTNPosTop+30, 51, 25) GUICtrlSetFont(-1, 10, 0, 0, "MS Sans Serif") $BTNPosLeft += 51 $BTNTempoDn = GUICtrlCreateButton('TempDn', $BTNPosLeft, $BTNPosTop+30, 51, 25) GUICtrlSetFont(-1, 10, 0, 0, "MS Sans Serif") $BTNPosLeft += 51 #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN") Global $playing_state = -1 ;Startup Bass & BassFX. Also check if loading failed. _BASS_STARTUP ("BASS.dll") If @error = -1 Then MsgBox (0, "", "DLL Does not exist? Please check file exists.") Exit EndIf _BASS_FX_Startup("bass_fx.dll") If @error = -1 Then MsgBox (0, "", "DLL Does not exist? Please check file exists.") Exit EndIf ;Initalize bass. Required for most functions. _BASS_Init(0, -1, 44100, 0, "") ;Check if bass iniated. If not, we cannot continue. If @error Then MsgBox(0, "Error", "Could not initialize audio") Exit EndIf ;Prompt the user to select a MP3 file $file = FileOpenDialog("Open...", "", "MP3 Files (*.*)") $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, $BASS_STREAM_DECODE) ;Check if we opened the file correctly. If @error Then MsgBox(0, "Error", "Could not load audio file" & @CR & "Error = " & @error) Exit EndIf ;Get the length of the song in bytes. $song_length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE) ;~ ConsoleWrite ('$song_length='&$song_length&@lf) $song_length_Sec = _BASS_ChannelBytes2Seconds($MusicHandle, $song_length) ;~ ConsoleWrite ('$song_length_Sec='&$song_length_Sec&@lf) ConsoleWrite ('>Time = '&StringFormat("%02d", floor($song_length_Sec/60))&':'&StringFormat("%02d", round($song_length_Sec-(60*floor($song_length_Sec/60))))&''&@lf) $tempo = _BASS_FX_ReverseCreate ($MusicHandle, 2, $BASS_STREAM_DECODE) _BASS_ChannelSetAttribute ($tempo, $BASS_ATTRIB_REVERSE_DIR, $BASS_FX_RVS_FORWARD) $tempo = _BASS_FX_TempoCreate ($tempo, 0) $current = _BASS_ChannelGetPosition($tempo, $BASS_POS_BYTE) ConsoleWrite ('1'&@lf) $tempoSpeed = 0 While 1 ;~ ConsoleWrite ('X'&@lf) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _BASS_Free() Exit Case $BTNplay _BASS_ChannelStop($tempo) $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, $BASS_STREAM_DECODE) $tempo = _BASS_FX_ReverseCreate ($MusicHandle, 2, $BASS_STREAM_DECODE) _BASS_ChannelSetAttribute ($tempo, $BASS_ATTRIB_REVERSE_DIR, $BASS_FX_RVS_FORWARD) $tempo = _BASS_FX_TempoCreate ($tempo, 0) _BASS_ChannelPlay($tempo, 0) Case $BTNStop _BASS_ChannelStop($tempo) Case $BTNpause _BASS_ChannelPause($tempo) Case $BTNReverse _BASS_ChannelStop($tempo) $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, $BASS_STREAM_DECODE) $tempo = _BASS_FX_ReverseCreate ($MusicHandle, 2, $BASS_STREAM_DECODE) _BASS_ChannelSetAttribute ($tempo, $BASS_ATTRIB_REVERSE_DIR, $BASS_FX_RVS_REVERSE) $tempo = _BASS_FX_TempoCreate ($tempo, 0) _BASS_ChannelPlay($tempo, 0) Case $BTNTempoUp $tempoSpeed += 5 _BASS_ChannelSetAttribute ($tempo, $BASS_ATTRIB_TEMPO, $tempoSpeed) ConsoleWrite ('$tempoSpeed='&$tempoSpeed&@lf) Case $BTNTempoDn $tempoSpeed -= 5 _BASS_ChannelSetAttribute ($tempo, $BASS_ATTRIB_TEMPO, $tempoSpeed) ConsoleWrite ('$tempoSpeed='&$tempoSpeed&@lf) EndSwitch Sleep(20) ;Get the current position in bytes $current = _BASS_ChannelGetPosition($tempo, $BASS_POS_BYTE) Local $pos_A = ControlGetPos ('','',$Progress_A) $X_position = $current/($song_length/$pos_A[2]-2) ;~ ConsoleWrite ('!$X_position= '&$X_position&@lf) _GUICtrlSetProgress( $X_position) WEnd func _GUICtrlSetProgress($data) Local $pos_A = ControlGetPos ('','',$Progress_A) Local $pos_B = ControlGetPos ('','',$Progress_B) If $data > $pos_A[2]-2 then $data = $pos_A[2]-2 ControlMove('','',$Progress_B,$pos_B[0],$pos_B[1],$data,$pos_B[3]) EndFunc Func _GUICtrlCreateProgress($left, $top , $width , $height ) $Progress_A = GUICtrlCreateLabel("", $left+1, $top+1, $width-1, $height-1) GUICtrlSetBkColor(-1, 0xCCCCCC) GUICtrlSetState(-1, $GUI_DISABLE) $Progress_B = GUICtrlCreateLabel("", $left+2, $top+2, $width-3 , $height-3) GUICtrlSetBkColor(-1, 0x888888) GUICtrlSetState(-1, $GUI_DISABLE) $GR_Top = GUICtrlCreateGraphic($left, $top, 0, 0) ;~ GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000FF) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, $width+1, 0) $GR_Bot = GUICtrlCreateGraphic($left, $top+$height, 0, 0) ;~ GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000FF) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, $width+1, 0) $GR_Bot = GUICtrlCreateGraphic($left, $top, 0, 0) ;~ GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000FF) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, 0, $height) $GR_Bot = GUICtrlCreateGraphic($left, $top, 0, 0) ;~ GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x0000FF) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $width, 0) GUICtrlSetGraphic(-1, $GUI_GR_LINE, $width, $height) EndFunc Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) ; Check control under cursor $aCInfo = GUIGetCursorInfo($Form1) ;~ $aCInfo = GUIGetCursorInfo() ConsoleWrite ('$aCInfo[0]= '&$aCInfo[0]&@lf) ConsoleWrite ('$aCInfo[1]= '&$aCInfo[1]&@lf) ConsoleWrite ('$aCInfo[2]= '&$aCInfo[2]&@lf) ConsoleWrite ('$aCInfo[3]= '&$aCInfo[3]&@lf) ConsoleWrite ('$aCInfo[4]= '&$aCInfo[4]&@lf) If $aCInfo[4] = $Progress_A or $aCInfo[4] = $Progress_B Then $aBar= ControlGetPos ("","",$Progress_A) $X_position = $aCInfo[0]-$aBar[0] ConsoleWrite ('!$X_position= '&$X_position&@lf) _GUICtrlSetProgress( $X_position) Local $pos_A = ControlGetPos ('','',$Progress_A) $ChannelSetPosition= $X_position*($song_length/$pos_A[2]-2) _BASS_ChannelSetPosition($tempo,$ChannelSetPosition,$BASS_POS_BYTE) EndIf EndFunc ;==>_WM_LBUTTONDOWN Func OnAutoItExit() ;Free Resources _BASS_Free() EndFunc ;==>OnAutoItExit
    1 point
  4. @youtuber: you mean something like this here? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> $Form1 = GUICreate("Form1", 223, 283) $Edit1 = GUICtrlCreateEdit("", 24, 24, 169, 161) GUICtrlSetData(-1, "E1 " & @CRLF & "E2" & @CRLF & "E3") $Button1 = GUICtrlCreateButton("Button1", 64, 224, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _arrayeditread() EndSwitch WEnd Func _arrayeditread() Local $aEditread = StringSplit(GUICtrlRead($Edit1), @LF) If @error Then Return GUICtrlSetData($Edit1, "") For $i = 2 To $aEditread[0] GUICtrlSetData($Edit1, StringStripCR($aEditread[$i]) & @CRLF, 1) Next EndFunc
    1 point
  5. It depends on the options Jon uses to compile the executor, the OS architecture (x86 or x64), the stack size used by outer functions before recursion and the stack size needed by every recursive invokation. AFAICT.
    1 point
  6. See here for an explanation from Trancexx in response to a similar question (easily found through a forum search, btw). Scroll up one or two to see the limits found in testing by Willichan
    1 point
  7. Look at the section " Display Font from Memory: " how to load a TTF from memory.
    1 point
  8. I am too but I have a portable version of chrome I use sometimes. I also have a portable version of autoit as you might have already noticed.
    1 point
  9. @BetaLeaf , Yeah, you are correct. And fortunately, i am using chrome in a single pc.
    1 point
  10. You are correct. You also need to set the options, specifically the $AutoItRun to point to the correct path. While I like the idea of a chrome extension, if you sync chrome on multiple computers, it may cause problems if autoit is in the wrong location/isn't installed.
    1 point
  11. @youtuber it is great that you're finally including code in your posts. But a detailed description will also go a long way to getting the assistance you're after. That way, we don't have to waste time trying to guess at what you're doing, as jvds does above. Help us help you
    1 point
  12. $sampleText = 'The letter A will become lowercase' ConsoleWrite(Execute('"' & (StringRegExpReplace($sampleText, '(\p{Lu}\b)', '" & StringLower("$1") & "')) & '"') & @LF)
    1 point
  13. Hello. My brother and I wrote this small Google Chrome extension that allow load(No Run Directly. you must press F5) the code directly in SciTE. By default Scritps are saved in Desktop when you run it. How to Install: In host Folder Run install_host.bat (try to keep an static folder) If you move the folder after you run install_host.bat You must install again. Load The Extension (autoitextension Folder) as Developer Mode In Google Chrome Settings. You can edit AutoitCodeRunner.au3 to make it work as your need. How it works. Basically It Injects a "Run" Button in every AutoIt code tag Like This: Check Source for more details. AutoItCodeRunner.zip Regards
    1 point
  14. Seems you used the wrong process to your question. You are supposed to do some research first before posting the question. Jos
    1 point
  15. How hard is it to hit CTRL + C?
    1 point
  16. Simple LAN Chat Hello everyone, recently, I embarked upon a cool task. Creating a SIMPLE LAN Chat. Users launch this application and chat with others who are on the same LAN. This is very basic and can be easy to understand. I have made several comments within this chat so you know whats happening. One thing I hope to add to this is ONLINE USERS. You, yourself, can add to this as well. This is more of a learning tool to see how LAN chats work. One last thing, pressing ENTER also sends messages. Enjoy. (PS, I may have left some not needed includes. ) ; ********************* ; SIMPLE LAN Chat ; By Javascript_Freek ; version 1.4b ; ********************* #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <File.au3> Opt("GUIOnEventMode", 1) Global $reachserver, $reachdata, $linedata, $chatarea, $usersonline, $lanchat_gui, $username ; CREATE THE GUI $lanchat_gui = GUICreate("LAN CHAT v1.4b", 380, 345, -1, -1) ; WHERE YOUR USERNAME IS STORED Dim $inifile = "username.ini" ; LOADING USERNAME loadname() Global $username ; LOGGED IN AS If $username = "" Then GUICtrlCreateLabel("Welcome!" & $username, 8, 7, 200) Else GUICtrlCreateLabel("Logged in as: " & $username, 8, 7, 200) Endif ; CHAT AREA $chatarea = GUICtrlCreateListView("", 8, 32, 365, 257, $LVS_LIST, $WS_EX_CLIENTEDGE) _GUICtrlListView_SetColumnWidth($chatarea, 0, 100) _GUICtrlListView_SetExtendedListViewStyle($chatarea, $LVS_EX_FULLROWSELECT) _GUICtrlListView_SetView($chatarea, 3) ; THE INPUT OF YOUR MSGS $input = GUICtrlCreateInput("", 8, 296, 250, 21) ; SEND BUTTON $Button1 = GUICtrlCreateButton("send", 270, 296, 105, 21, 0) GUICtrlSetOnEvent(-1, "sendmsg") ; MENU $nFileMenu = GUICtrlCreateMenu("File") $nExititem2 = GUICtrlCreateMenuItem("New Name", $nFileMenu) GUICtrlSetOnEvent(-1, "renameyou") $nExititem = GUICtrlCreateMenuItem("Exit", $nFileMenu) GUICtrlSetOnEvent(-2, "quit") $aFileMenu = GUICtrlCreateMenu("About") $aAboutitem = GUICtrlCreateMenuItem("About", $aFileMenu) GUICtrlSetOnEvent(-3, "about") ; ALLOWS THE PROGRAM TO CLOSE GUISetOnEvent($GUI_EVENT_CLOSE, "quit") GUISetState() ;LOADS USERNAME $username = "" loadname() ; NO USERNAME FOUND, LOAD THIS If $username = "" Then $username = InputBox("Welcome to the LAN Chat", "Create a username", "") Global $username If $username = "" Then MsgBox(48,"No namer!","You didn't put anything down for your new name. See ya!") Exit Else IniWrite($inifile, "me", 0, $username) Endif Endif ; GETS IP ADDRESS AND DECLARES A VARIABLE $varIP = @IPAddress1 ; STARTS UP UDP UDPStartup() ; CREATES A SOCKET BOUND TO AN INCOMING CONNECTION $reachserver = UDPBind($varIP, 65335) Sleep(1000) ; SPLITS IP ADDRESS AND DECARES VARIABLES $divideIP = StringSplit($varIP, ".") $newaddress = $divideIP[1] & "." & $divideIP[2] & "." & $divideIP[3] & "." & "255" ; OPENS THE SOCKET CONNECTED TO AN EXITISING SERVER USING YOUR SPLIT UP IP ADDRESS $reachcast = UDPOpen($newaddress, 65335) While 1 ;RECIEVING THE DATA FROM AN OPEN SOCKET $reachdata = UDPRecv($reachserver, 50) ; YOU RECEIVED SUCCESSFULL, SO RUN THIS If $reachdata <> "" Then $tmp = StringSplit($reachdata, "|") $linedata = $tmp[2] ; If the user who typed the message is you... call this function! If StringInStr($linedata, $username) = 0 And StringInStr($tmp[1], ".") <> 4 Then $str = StringSplit($linedata, "|") $last = $str[0] _GUICtrlListView_AddItem($chatarea, $str[$last] & " says: " & $tmp[1]) _FileWriteLog("logs.txt", $str[$last] & " says: " & $tmp[1]) EndIf EndIf ; SETTING THE HOTKEY OF SENDING MSGS BY PRESSING ENTER HotKeySet("{ENTER}", "sendmsg") Sleep(50) WEnd ; FUNCTION LOADS FILE FROM CREATED INI Func loadname() $username = IniRead($inifile, "me", 0, "") EndFunc ;FUNCTION TO SEND MESSAGES Func sendmsg() If GUICtrlRead($input) = "" Then Msgbox(64, "Error", "You did not send anything.") Else UDPSend($reachcast, GUICtrlRead($input) & "|" & $username) _GUICtrlListView_AddItem($chatarea, $username & " says: " & GUICtrlRead($input)) Endif GUICtrlSetData($input, "") _GUICtrlListView_Scroll($chatarea, 0, 150) EndFunc ; QUITTING PROGRAM FUNCTION Func quit() Sleep(1000) UDPCloseSocket($varIP) UDPShutdown() Exit EndFunc ;RENAMING YOURSELF MESSAGE BOX INSTRUCTIONS Func renameyou() MsgBox(64,"To change your name","Where you have launched this application, find username.ini."& @LF &"Inside you can edit your username."& @LF &"Before you edit your username, please exit this program.") EndFunc ; ABOUT THIS PROGRAM MESSAGE BOX Func about() MsgBox(64,"About LAN Chat","Who can connect here? Whoever is on the same LOCAL AREA NETWORK as you. You can connect and chat to others who are usually in the same building or near area.") EndFunc
    1 point
×
×
  • Create New...