Jump to content

langthang084

Active Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by langthang084

  1. I want to click this button, but it doesnt work. My code: ControlClick ('Title', '', 402422) thank all!
  2. Yeah!! Thank you very much! It works normally
  3. Here's it! GLVEx_Example_6.au3 Save.lvs
  4. thanks for your UDF, but I get an error when loading Listview from the save file which has more than 6 column. It show an error: --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "H:\Marketting\Sharing Online Tool\GUIListViewEx.au3" (871) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $aHdrData[0][$i] = $aHeader[$i][0] ^ ERROR
  5. Yeah! M23 Thanks U very much!!
  6. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <GuiTreeView.au3> #include <Array.au3> $Child = 9999 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 368, 438, 192, 124) $TreeView1 = GUICtrlCreateTreeView(45, 36, 199, 322) $Button1 = GUICtrlCreateButton("CREATE", 255, 39, 100, 43) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $ArrayTreeView[][] = [['', 'Item 1', ''], _ ['', '', 'Item 1.1'], _ ['', '', 'Item 1.2'], _ ['', 'Item 2', ''], _ ['', 'Item 3', ''], _ ['', '', 'Item 3.1']] _GUICtrlTreeView_BeginUpdate($TreeView1) $iParam = 1 $CurrentItem = '' for $a = 0 to UBound($ArrayTreeView) - 1 if $ArrayTreeView[$a][1] <> '' then $ArrayTreeView[$a][0] = _GUICtrlTreeView_Add($TreeView1, 0, $ArrayTreeView[$a][1] ) _GUICtrlTreeView_SetItemParam($TreeView1, $ArrayTreeView[$a][0], $iParam) $CurrentItem = $ArrayTreeView[$a][0] $iParam += 1 Else if $ArrayTreeView[$a][2] <> '' then $ArrayTreeView[$a][0] = _GUICtrlTreeView_AddChild($TreeView1, $CurrentItem, $ArrayTreeView[$a][2] ) _GUICtrlTreeView_SetItemParam($TreeView1, $ArrayTreeView[$a][0], $iParam) $iParam += 1 Else $CurrentItem = '' EndIf EndIf Next _GUICtrlTreeView_EndUpdate($TreeView1) _ArrayDisplay($ArrayTreeView) While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[1] case $Form1 Switch $nMsg[0] Case $GUI_EVENT_CLOSE Exit case GUICtrlRead($TreeView1) $ID = GUICtrlRead($TreeView1) MsgBox(0, '', $ID) case $Button1 _CreateChildGui() EndSwitch case $Child Switch $nMsg[0] Case $GUI_EVENT_CLOSE GUIDelete($Child) EndSwitch EndSwitch WEnd Func _CreateChildGui() $Child = GUICreate("Child", 368, 438, 100, 124) GUISetState(@SW_SHOW) EndFunc Why I cant read treeview Items?????
  7. #include <GuiEdit.au3> #include <Misc.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <Crypt.au3> #include <GuiTreeView.au3> Global $aGCHL_Ctrls[1][1] Global $iGCHL_MouseHeldDown = 0 $PathData = @ScriptDir & '\Data.txt' $PathMp3 = @ScriptDir & '\Database\bronch.mp3' $MAINGUI = GUICreate("PHẦN MỀM HỌC TIẾNG PHỔI", 843, 650, 410, 34) $TabGeneral = GUICtrlCreateTab(9, 6, 820, 616) $Tab1 = GUICtrlCreateTabItem("DATABASE") $STARTTEST = GUICtrlCreateButton("START", 284, 58, 140, 31) $Tab2 = GUICtrlCreateTabItem("Compare") _CreateMediaGuiWithVideo('Mp3', $PathMp3, 20, 30) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $Check = GUIGetMsg(1) Switch $Check[1] Case $MAINGUI Switch $Check[0] case $GUI_EVENT_CLOSE $msg = MsgBox(1, "", "Exit?") if $msg = 1 then ExitLoop case $STARTTEST _CreateMediaGuiWithVideo('ABC', $PathMp3, 30, 50) EndSwitch EndSwitch WEnd Func _CreateMediaGuiWithVideo($String, $PathMp3, $Left, $Top) $MediaGroup = GUICtrlCreateGroup($String, $Left, $Top, 200, 200) ;~ $h_cGUI = GUICreate("Embed Player", 240, 245, $Left +10, $Top + 10, $WS_CHILD , $WS_EX_MDICHILD) $oMP = ObjCreate("WMPlayer.OCX") $mediaplayer = GUICtrlCreateObj($oMP, $Left + 20, $Top + 20 , 240, 245) With $oMP .fullScreen = False .windowlessVideo = False .enableContextMenu = True .enabled = True .uiMode = "mini" .settings.autostart = False .settings.mute = False .settings.volume = 100 .settings.Balance = 0 ;~ .settings.playCount = 1000 ;Repeat 1000 lần .settings.setMode ("loop", True) ;Repeat không giới hạn .URL = $PathMp3 EndWith GUICtrlCreateGroup("", -99, -99, 1, 1) return $MediaGroup EndFunc Sorry for my bad English. But there's my code and I have a problem: when press START button (to create the media windows), after that change to COMPARE TAB then the media window still appears on the screen GUI. Could anyone help resolve it? Thanks all!
  8. With "abc de", how to match "de" with case-insensitivity? I test with StringRegExp ("abc de", "(?i:aBc )", 3) but it not works
  9. Could anyone help me to make the timeout stop if I click on the inputbox? Thanks all!
  10. 1. How to wait the windows with 2 button &A, &B appear. Example: WinWaitActive ('Tittle', '&A' + '&B') 2. How to prevent ListView auto resize by item width?
  11. @AutoBert: I dont like use Hwnd because it will change each time application start. So how to solve my case with tittle?? @careca: I dont understand your trick very well
  12. Global $Paused HotKeySet("`", "TogglePause") HotKeySet("^q", "Terminate") opt("WinTitleMatchMode", 2) Local $TittleWindows[] = ['Firefox', 'Chrome'] While 1 send('`') Switch WinActive($TittleWindows) case 'Firefox' ; WinWaitActive($TittleWindows[0]) MsgBox(0, '', 'Firefox') case 'Chrome' ; WinWaitActive($TittleWindows[1]) MsgBox(0, '', 'Chrome') EndSwitch WEnd ;-------------------------------------------------------- Func TogglePause() $Paused = NOT $Paused While $Paused sleep(200) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Why It only run if Firefox is actived
  13. I Want to match "AAAAA" and show the front words of "AAAAA" , to do this, I use: StringRegExp($Read, '.{0,20}AAAAA',3) So When replace, How to replace only AAAAA??? Thanks all!!!
  14. Did you mean _ArrayUnique and _ArrayFindAll Func _Classified($SourceArray) ProgressOn('Classified', '') $ExportArray = _ArrayUnique($SourceArray) _ArrayDelete($ExportArray, 0) _ArrayColInsert($ExportArray, 1) ; _ArrayDisplay($ExportArray, 'Export') $EndLoop = UBound($ExportArray) - 1 for $a = 0 to $EndLoop ProgressSet( int(($a/$EndLoop)*100), int(($a/$EndLoop)*100) & '%' ) $Line = _ArrayFindAll($SourceArray, $ExportArray[$a][0], 0, 0, 0, 1) $ExportArray[$a][1] = UBound($Line) Next ProgressOff() _ArrayDelete($ExportArray, 0) ;_ArrayDisplay($ExportArray, 'After Distribute') Return $ExportArray EndFunc
  15. #include <array.au3> local $SourceText[] = [''] $TotalWord = 1000 for $a = 1 to $TotalWord $Element = 'ABC' & Random(1, 9, 1) _ArrayAdd($SourceText, $Element) Next _ArrayDisplay($SourceText, 'Source') $Export = _Classified($SourceText) _ArrayDisplay($Export, 'Export') Func _Classified($SourceArray) ProgressOn('Classified', '') Local $ExportArray[][] = [['', '']] $EndLoop = UBound($SourceArray) - 1 for $a = 1 to UBound($SourceArray) - 1 ProgressSet( int(($a/$EndLoop)*100), int(($a/$EndLoop)*100) & '%' ) $Line = _ArraySearch($ExportArray, $SourceArray[$a], 0, 0, 0, 1) if @error then _ArrayAdd($ExportArray, '') $ExportArray[UBound($ExportArray) - 1][0] = $SourceArray[$a] $ExportArray[UBound($ExportArray) - 1][1] = 1 Else $ExportArray[$Line][1] += 1 EndIf Next ProgressOff() _ArrayDelete($ExportArray, 0) ;_ArrayDisplay($ExportArray, 'After Distribute') Return $ExportArray EndFunc I want to split a paragraph into word and classify by the total times it appears. If it has 1000 word (like above), it takes a little time. But if a paragraph contain to many word (ex: $TotalWord = 100000000000000000000), it takes too long. So I want to make it runs faster
  16. Here's my code: Func _Classified($SourceArray) ProgressOn('Classified', '') Local $ExportArray[][] = [['', '']] $EndLoop = UBound($SourceArray) - 1 for $a = 1 to UBound($SourceArray) - 1 ProgressSet( int(($a/$EndLoop)*100), int(($a/$EndLoop)*100) & '%' ) $Line = _ArraySearch($ExportArray, $SourceArray[$a], 0, 0, 0, 1) if @error then _ArrayAdd($ExportArray, '') $ExportArray[UBound($ExportArray) - 1][0] = $SourceArray[$a] $ExportArray[UBound($ExportArray) - 1][1] = 1 Else $ExportArray[$Line][1] += 1 EndIf Next ProgressOff() _ArrayDelete($ExportArray, 0) ;_ArrayDisplay($ExportArray, 'After Distribute') Return $ExportArray EndFunc But if $SourceArray has a huge elements, It take too long. So how to make it run faster???
  17. Yeah!! Thanks @mLipok. I checked this website again and this id wasnt found.
  18. Here's my code: #include <ie.au3> $Link = 'http://www.bikervietnam.com/threads/topic-ban-luan-danh-rieng-cho-dong-future-125-moi-doi-2012-2013.463954/page-2' _IELoadWaitTimeout(10000) $IE = _IECreate($Link, 0, 1, 1) $CommentData = _IEGetObjById($IE, "post-7767491") $CommentData = $CommentData.innerhtml ;$CommentData = ClipGet() MsgBox(0, 'FINISHHHHHHHHHHHH', $CommentData) I want to get each text post from this forum. With other post, this work normally. But with post-7767491, it's error!
  19. I remove them but nothing change.
  20. ex: <li id="post-7772508" class="message " data-author="vietthanh_tcnh"> <div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person"> <div class="messageUserBlock "> <div class="avatarHolder"> <span class="helper"></span> <a href="members/vietthanh_tcnh.1079231/" class="avatar Av1079231m" data-avatarhtml="true"><img src="styles/bvn/xenforo/avatars/avatar_m.png" width="96" height="96" alt="vietthanh_tcnh" /></a> <!-- slot: message_user_info_avatar --> </div> But when I used _IeGetObjByID($oIE, '"post-7772508"')  But It shows @error = 7 (No Match)
  21. Thanks all!! I have done this, with the function _ConvertHTMLTag on our forum Func _RemoveIMG_URLTag($Data) local $Result[1][3] = [["","",""]] $SearchIMG = '(?i)(href|src)="([^"]+)' $Data = StringRegExpReplace($Data, '(?i)Border="0"', 'border=0', 0) $Data = StringRegExpReplace($Data, '(?i)<(DIV|/DIV)>', @CRLF, 0) $DataSP = StringReplace($Data, '<BR>', @CRLF) $DataSP = StringSplit($DataSP, @CRLF) ;_ArrayDisplay($DataSP, 'Before') While 1 $LineIMG = _ArraySearch($DataSP, '<img ' , 0, 0, 0, 1) if @error then ExitLoop ;MsgBox(0, 'LineIMG - before', $DataSP[$LineIMG]) if StringRegExp($DataSP[$LineIMG], "(?i) Border=0 ", 0) = 1 AND StringRegExp($DataSP[$LineIMG], '(?i) alt=""', 0) = 1 AND StringRegExp($DataSP[$LineIMG], '(?i) class=', 0) = 0 Then $DataRemoveIMGTag = StringRegExp($DataSP[$LineIMG], $SearchIMG, 4) local $Result[1][3] = [["","",""]] for $a1 =0 to UBound($DataRemoveIMGTag) - 1 _ArrayAdd($Result, "") $Result[$a1+1][0] = ($DataRemoveIMGTag[$a1])[0] $Result[$a1+1][1] = ($DataRemoveIMGTag[$a1])[1] $Result[$a1+1][2] = ($DataRemoveIMGTag[$a1])[2] Next _ArrayDelete($Result, 0) ;_ArrayDisplay($Result, 'result') $DataSP[$LineIMG] = '' for $a2 = 0 to UBound($Result) - 1 if StringInStr($Result[$a2][1], 'href', 1) then $Result[$a2][2] = '[URL] ' & $Result[$a2][2] & ' [/URL]' if StringInStr($Result[$a2][1], 'src', 1) then $Result[$a2][2] = '[IMG] ' & $Result[$a2][2] & ' [/IMG]' $DataSP[$LineIMG] &= $Result[$a2][2] & @CRLF Next Else $DataSP[$LineIMG] = _ConvertHTMLTag($DataSP[$LineIMG]) EndIf ;MsgBox(0, 'LineIMG - after', $DataSP[$LineIMG]) WEnd ; _ArrayDisplay($DataSP, 'After') $DataAll = '' for $c = 1 to UBound($DataSP) - 1 $DataAll &= $DataSP[$c] & '<BR>' Next return $DataAll EndFunc Func _ConvertHTMLTag($Text) $text = StringRegExpReplace($text, '(?si)<head>.*?</head>', '') $text = StringRegExpReplace($text, '(?si)<script[^>]*?>.*?</script>', '') $text = StringRegExpReplace($text, '>\s+<', '> <') ; $text = StringRegExpReplace($text, '[\v]', '') $text = StringRegExpReplace($text, '<(br|BR|p)>', @CRLF) $text = StringRegExpReplace($text, '<(DIV|div)>', @CRLF) $text = StringRegExpReplace($text, '<[/!]*?[^<>]*?>', '') ; $text = StringRegExpReplace($text, '<[\/\!]*?[^<>]*?>', @CRLF) $text = StringReplace($text, '&quot;', '"') $text = StringReplace($text, '&amp;', '&') $text = StringReplace($text, '&lt;', '<') $text = StringReplace($text, '&gt;', '>') $text = StringReplace($text, '&nbsp;', ' ') $text = StringReplace($text, '&iexcl;', '&#161;') $text = StringReplace($text, '&cent;', '&#162;') $text = StringReplace($text, '&pound;', '&#163;') $text = StringReplace($text, '&copy;', '&#169;') ; &#444 -> character $a = StringRegExp($text, '&#(\d+);', 3) If Not @error Then ; $log &= UBound($a) & ' &#(\d+);' & @CRLF $a = _ArrayUnique($a) For $i = 1 To $a[0] $a[$i] = Number($a[$i]) Next _ArraySort($a, 1, 1) ;_ArrayDisplay($a) For $i = 1 To $a[0] $text = StringReplace($text, '&#' & $a[$i] & ';', ChrW($a[$i])) Next EndIf $text = StringRegExpReplace($text, '([\r\n])[\s]+', @CRLF) return $text EndFunc
  22. Because I want to get the text of website, but keep some URL or Image link in this website. So I think I must do with each TAG HTML (from _IEBodyReadHTML) and remove the unnecessary in this
  23. Example: <A href="showthread.php?s=61997dac20687aa843bddf8b3a45e836&p=20495#post20495" rel=nofollow><IMG class=inlineimg title="View" alt="View" src="phuot_images/buttons/viewpost-right.png"></A> How to get this link (or All type of URL) "showthread.php?s=61997dac20687aa843bddf8b3a45e836&amp;p=20495#post20495"
×
×
  • Create New...