Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/15/2016 in all areas

  1. kylomas

    help while func

    rodiney, See comments in the following code... Case $Button1 While < < I NEED HERE ReDim $Array[UBound($Array) + 1] $Array[$iCount] = $H ; ; $Input1 is being used as a controlid. You do NOT want to overwrite it !!! ; $Input1 = GUICtrlSetData($Input1, $Array[$iCount] & " Start") ; ; two statements ago you set these values =. Why the test? ; If $H <> $Array[$iCount] Then $iCount += 1 ReDim $Array[UBound($Array) + 1] $Array[$iCount] = $H EndIf ConsoleWrite($Array[$iCount] & @CR) _ArrayDisplay($Array, "", Default, 8) WEnd It might be better to create a runnable reproducer and tell us what you expect and what it is/is not doing... kylomas
    1 point
  2. This work for me. $oTextarea.scrollTop = 99999 Saludos
    1 point
  3. Lol Sorry I forgot to press submit button lol #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> Example() Func Example() Local $hImage, $idListview GUICreate("ListView Enable Group View", 400, 330) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268) $ibtnAdd = GUICtrlCreateButton("Add Group", 100, 290, 80, 30) $ibtnAdditem = GUICtrlCreateButton("Add Item", 200, 290, 80, 30) GUISetState(@SW_SHOW) ; Add columns _GUICtrlListView_InsertColumn($idListview, 0, "Column 1", 100) ; Build groups _GUICtrlListView_EnableGroupView($idListview) Local $iIndex = 0 Local $idMsg = 0 Local $iIndexGroup = 1 Local $iCount = 0 Local $iTempGroup = 0 While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE Exit Case $idMsg = $ibtnAdd $iIndex = _GUICtrlListView_GetItemCount($idListview) _GUICtrlListView_AddItem($idListview, "Waiting for Item") _GUICtrlListView_InsertGroup($idListview, $iIndex, $iIndexGroup, "Group " & $iIndexGroup) _GUICtrlListView_SetItemGroupID($idListview, $iIndex, $iIndexGroup) $iTempGroup = $iIndexGroup $iIndexGroup += 1 $iCount = 1 Case $idMsg = $ibtnAdditem $iIndex = _GUICtrlListView_GetItemCount($idListview) If $iCount = 1 Then _GUICtrlListView_SetItemText($idListview, $iIndex - 1, "Item " & $iCount) If $iCount > 1 Then _GUICtrlListView_AddItem($idListview, "Item " & $iCount) _GUICtrlListView_SetItemGroupID($idListview, $iIndex, $iTempGroup) EndIf $iCount += 1 EndSelect WEnd GUIDelete() EndFunc ;==>Example It is not the most elegant way. but I think it does what you want. Saludos
    1 point
  4. PrateekR, Please stop posting in the wrong section. This is second thread (of two) started by you that we have had to move - please make it the last. M23
    1 point
  5. Jos

    AutoIt Snippets

    Won't happen because we are lazy too! Just add them in your own include file. Jos
    1 point
  6. 1 point
  7. water

    Help Array

    Dog ate your help file
    1 point
  8. JohnOne

    Download a variable link

    #include <String.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Local $sRead = InetRead('http://downloads.dell.com/published/pages/latitude-e5450-laptop.html', 1) ;(BinaryToString($sRead) & @CRLF) Local $aData = _StringBetween(BinaryToString($sRead), 'Type: BIOS', 'Category:') TrayTip("", "Downloading latest BIOS Version, please wait...", 10, 3) Local $aLinks = _StringBetween($aData[0], '<A HREF="/', '"><IMG') Local $slink = "" For $i = 0 To UBound($aLinks) - 1 $aLinks[$i] = 'http://downloads.dell.com/' & $aLinks[$i] If StringInStr($aLinks[$i], "E5450") Then $slink = $aLinks[$i] ExitLoop EndIf Next Exit Local $hDownload = InetGet($slink, @DesktopDir & "\BIOSE5450.exe", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $iBytesSize = InetGetInfo($hDownload, 0) Local $iFileSize = Round(FileGetSize(@DesktopDir & "\BIOSE5450.exe") / 1048576) InetClose($hDownload) MsgBox(0, "", "The latest E5450 BIOS (" & $iFileSize & " MB) have been downloaded")
    1 point
  9. Alright, looks like the window message WM_LBUTTONDOWN isn't sent when you click on a control that's clickable (something like that) but using a CtrlPic you will get the GUIMsg when the left button is pressed before it's released (button you get the message after it's been released). This code will work if you use a CtrlPic instead of CtrlButton #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIButton.au3> #include <WindowsConstants.au3> FileInstall("VolDown.bmp", @TempDir & "\VolDown.bmp", 1) FileInstall("Mute.bmp", @TempDir & "\Mute.bmp", 1) FileInstall("VolUp.bmp", @TempDir & "\VolUp.bmp", 1) FileInstall("Back.bmp", @TempDir & "\Back.bmp", 1) FileInstall("Forward.bmp", @TempDir & "\Forward.bmp", 1) FileInstall("Play.bmp", @TempDir & "\Play.bmp", 1) FileInstall("Pause.bmp", @TempDir & "\Pause.bmp", 1) AdLibRegister("KeepAlive", 60000) #Region ### START Koda GUI section ### Form=C:\Users\it022565\Desktop\Media GUI\Form1.kxf $Form1 = GUICreate("Patrick's Tablet Audio GUI", 621, 545, 192, 124) $Button1 = GUICtrlCreateButton("VolDown", 56, 416, 90, 90, $BS_BITMAP) GUICtrlSetImage(-1, @TempDir & "\VolDown.bmp") $Button2 = GUICtrlCreateButton("Mute", 269, 418, 90, 90, $BS_BITMAP) GUICtrlSetImage(-1, @TempDir & "\Mute.bmp") $Button3 = GUICtrlCreatePic("\VolUp.bmp", 493, 418, 90, 90) $Button4 = GUICtrlCreateButton("Back", 60, 223, 90, 90, $BS_BITMAP) GUICtrlSetImage(-1, @TempDir & "\Back.bmp") $Button5 = GUICtrlCreateButton("Play", 225, 169, 180, 180, $BS_BITMAP) GUICtrlSetImage(-1, @TempDir & "\Pause.bmp") $Button6 = GUICtrlCreateButton("Forward", 491, 222, 90, 90, $BS_BITMAP) GUICtrlSetImage(-1, @TempDir & "\Forward.bmp") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $vToggle = 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Send("{VOLUME_DOWN 5}") Case $Button2 Send("{VOLUME_MUTE}") Case $Button3 Local $cursor_info = GUIGetCursorInfo() If (Not @Error) Then If ($cursor_info[4] = $Button3) Then While ($cursor_info[4] = $Button3 and $cursor_info[2]) Send("{VOLUME_UP 5}") Sleep(200) $cursor_info = GUIGetCursorInfo() If (@Error) Then ExitLoop WEnd EndIf EndIf Case $Button4 Send("{MEDIA_PREV}") Case $Button5 Send("{MEDIA_PLAY_PAUSE}") $vToggle +=1 If MOD($vToggle, 2) Then GUICtrlSetImage($Button5, @TempDir & "\Pause.bmp") Else GUICtrlSetImage($Button5, @TempDir & "\Play.bmp") EndIf Case $Button6 Send("{MEDIA_NEXT}") EndSwitch WEnd Func KeepAlive() $aCurrentPos = MouseGetPos() MouseMove($aCurrentPos[0]+1, $aCurrentPos[1]) MouseMove($aCurrentPos[0]-1, $aCurrentPos[1]) EndFunc You could also have a second bmp file for when the button is pressed to indicate that you're pressing it (or create a few labels to outline your picture and use GUICtrlSetPos to move them around the picture). I'd still look into GDI+, could make something really pretty looking lol
    1 point
  10. Seems i'm done , my only problem now it's not contains subdirectory. #include <File.au3> #include <GuiConstants.au3> #include <GuiListView.au3> Global $DoubleClicked = False Global $width = 450 Global $height = 438 $Form1 = GUICreate("Form1", $width, $height) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") $MusicDir=FileSelectFolder("Please select a folder",@HomeDrive) $ListView1 = GUICtrlCreateListView("Mp3 files at " & $MusicDir, 15, 5, ($width - 30), ($height - 20)) _GUICtrlListView_SetColumnWidth($ListView1, 0, ($width - 60)) ; set Column header width If @error Then Exit ;$filesArray=_FileListToArray($MusicDir,"*.mp3") ; mp3 files only $filesArray=_FileListToArray($MusicDir) ; all files For $i=1 To $filesArray[0] GUICtrlCreateListViewItem($filesArray[$i],$ListView1) Next GUISetState() While GUIGetMsg() <> -3 Sleep(10) If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf WEnd Func DoubleClickFunc() $runpath = ($MusicDir & "\" & GUICtrlRead(GUICtrlRead($ListView1))) $runpath = StringTrimRight ($runpath, 1) ;remove last character (there is a "|" character at the end i don't know why) ;ToolTip ($runpath) ; just to test ;ToolTip("Double Clicked: " & $MusicDir & "\" & GUICtrlRead(GUICtrlRead($ListView1))) ;Sleep (2000) ;ToolTip("") ShellExecute ($runpath) ; runs the double clicked file EndFunc Func WM_NOTIFY($hWnd, $MsgID, $wParam, $lParam) Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return 0 $code = DllStructGetData($tagNMHDR, 3) If $wParam = $ListView1 And $code = -3 Then $DoubleClicked = True Return $GUI_RUNDEFMSG EndFunc
    1 point
×
×
  • Create New...