Jump to content

langthang084

Active Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by langthang084

  1. Thanks for your code. But I want to get text and link alternately. @AutoBert: thanks for your suggestion
  2. After all, Now I must know about HTML Tag
  3. I use _IEBodyReadText but it remove all Image Link!!!!!!
  4. And how to autoscroll to the last item of each columns? (example: when I input data by columns)
  5. I create the ListView with 3 columns. Each Column has diffirent number of items. #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Local $idListview GUICreate("ListView Get Item Text Array", 400, 300) $idListview = GUICtrlCreateListView("col1|col2|col3", 2, 2, 394, 268) GUICtrlCreateListViewItem("line1|data1|more1", $idListview) GUICtrlCreateListViewItem("line2|data2|more2", $idListview) GUICtrlCreateListViewItem("line3|data3|more3", $idListview) GUICtrlCreateListViewItem("line4|data4", $idListview) GUICtrlCreateListViewItem("line5|", $idListview) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() I used _GUICtrlListView_GetItemCount but it dont get on each Column
  6. ex: With sheet 2, Colums A to AM #include <array.au3> #include <file.au3> #include <ie.au3> #Include <String.au3> #include <excel.au3> #include <Date.au3> #include <Misc.au3> #include <word.au3> $ExportPath = @ScriptDir & "\List.xls" $Ex = _Excel_Open() Local $ExportOpen = _Excel_BookOpen($Ex, $ExportPath) Local $ExportList = _Excel_RangeRead($ExportOpen, 2, $ExportOpen.2.Usedrange.Columns("A:AM"), 1) if @error Then MsgBox(0, '', @error) _ArrayDisplay($ExportList) But It dont run?? If change to active sheet, then It run normally. Could any one help me??
  7. Thanks a lot, BrewManNH
  8. Here's my code: #Region ; GUI generated by GUIBuilderNxt Prototype 1.0 #include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <ListBoxConstants.au3> #include <GuiListView.au3> Global $MainStyle = BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_VISIBLE, $WS_CLIPSIBLINGS, $WS_MINIMIZEBOX) Global $hMain = GuiCreate("MyGUI", 189, 186, -1, -1, $MainStyle) Global $Input_1 = GuiCtrlCreateInput("", 20, 20, 50, 20) Global $Input_2 = GuiCtrlCreateInput("", 90, 20, 50, 20) Global $ADD = GuiCtrlCreateButton("ADD", 150, 20, 50, 20) Global $List_3 = GuiCtrlCreateListView("", 20, 50, 150, 130) _GUICtrlListView_InsertColumn($List_3, 0, "C1", 50) _GUICtrlListView_InsertColumn($List_3, 1, "C2", 50) Local $aAccelKeys[][] = [["{Enter}", $Add]] GUISetAccelerators($aAccelKeys) $SubLine = 1; GuiSetState(@SW_SHOWNORMAL) Do Switch GuiGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Add _add() EndSwitch Until False Func _add() $Name = GUICtrlRead($Input_1) $Other = GUICtrlRead($Input_2) if $Name <> '' Then _GUICtrlListView_AddItem($List_3, $Name, 0) EndIf if $Other <> '' Then ;MsgBox(0, '', $SubLine) _GUICtrlListView_AddSubItem($List_3, 0, $SubLine ,$SubLine) $SubLine = $SubLine + 1 EndIf GUICtrlSetData($Input_1, "") GUICtrlSetData($Input_2, "") ControlClick("MyGui", "", '[CLASS:Edit; INSTANCE:1]', "left") EndFunc #EndRegion But why it always add to the first sub item??
  9. Wow! Kanashius, thank you very much. You help me alot. Waiting for your new UDF
  10. I want to use ENTER to Add to ListView and use ENTER to edit the ListView Items (by ListViewEdit UDF) But It dont work! Could anyone help me!!! #Region ; GUI generated by GUIBuilderNxt Prototype 1.0 #include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <ListBoxConstants.au3> #include <ListViewEditInput.au3> Global $MainStyle = BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_VISIBLE, $WS_CLIPSIBLINGS, $WS_MINIMIZEBOX) Global $hMain = GuiCreate("MyGUI", 189, 186, -1, -1, $MainStyle) Global $Input_1 = GuiCtrlCreateInput("", 20, 20, 80, 20) Global $ADD = GuiCtrlCreateButton("ADD", 120, 20, 50, 20) Global $List_3 = GuiCtrlCreateListView("Number | Name", 20, 50, 150, 130) Local $aAccelKeys[][] = [["{Enter}", $Add]] GUISetAccelerators($aAccelKeys) __ListViewEditInput_StartUp($hMain) ;add listview, only edit col 1 and 2, doubleclick __ListViewEditInput_AddListview($hMain,$List_3,"0,1") ;esc to cancel and enter to send ; __ListViewEditInput_InitializeKeys($hMain) ;register function, after editing a field __ListViewEditInput_RegisterFunction($List_3,"_edited","Changed") ;register Function, when field not edited __ListViewEditInput_RegisterFunction($List_3,"_canceled","Canceled") ; GuiSetState(@SW_SHOWNORMAL) Do Switch GuiGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Add $Name = GUICtrlRead($Input_1) $Number = ControlListView("MyGui", "", $List_3, "GetItemCount") + 1 GUICtrlCreateListViewItem($Number & "|" & $Name , $List_3) GUICtrlSetData($Input_1, "") ControlClick("MyGui", "", '[CLASS:Edit; INSTANCE:1]', "left") EndSwitch Until False #EndRegion P/S: The UDF I get from :
  11. I run on my laptop (dont save on LAN) it work normally, but on my computer at company, the excel has error in Unicode text and the sheet has been renamed (to Recovered_Sheet....)
  12. Thanks Jguich! I work with Excel 2003 so change to $xlExcel7, then it run normally (also with $xlExcel3, $xlExcel5)
  13. @error = 5, @extend = - 2147352567
  14. I want to use _Excel_BookSaveAs with the path "\\10.0.4.191\AutoShare\New.xls" but Itnot work. _Excel_BookSaveAs ( $oWorkbook, "\\10.0.4.191\AutoShare\New.xls")How to solved it! Thanks all.
  15. I work on some GUI. The Main Gui has 3 button to create 3 Guis (Gui level 1). Each new Gui has 2 buttons to create 2 new other Guis (Gui level 2) So How to click one Button (on Main, level 1 or level 2), the GUI will create and all the other Gui (except Main Gui) will be delete. P/S: I dont want to use Show / Hide with GuiSetState Thanks all!
  16. Thanks jguinch very much. Now I know how to get the handle exactly
  17. Yes! Depend on active windows. Because when I test, WinGetHandle always show the newest handle. #include <array.au3> WinWaitActive("[CLASS:Windowsforms10.Windows.8.app.0.378734a]") $handle = WinGetHandle("[CLASS:Windowsforms10.Windows.8.app.0.378734a]") $Pos_Size = WinGetPos($Handle) _ArrayDisplay($Pos_Size)I dont know how to use your snippet with many handle will change. (Main application will show 1 handle (change after app open) , create a new section to save will show 1 handle (change after create new section) and each times to press Enter, the handle will change)
  18. I found the simple way: use WinGetHandle to get the handle of the newest windows. After that, Use WinGetPos with that handle.
  19. The Class doesnt change. The handle changes like (0x0001008A -->0x00010074 ...etc..) defend on the line I press enter Now I use WinwaitActive by size and position of the windows, but on the diffirent computer, size and position of this windows changes.
  20. Thanks jaensterr. But they are two windows in one application (this application help me to imput data, so when I press Enter, the new windows wll appear). Your code is active by windows Handle, but when I new windows appear, the handle will change.
  21. Thanks Melba23! But if I have many Gui, Is there anyway to create the list accelerator keys like _GUICtrlButton_Click($ButtonGui1) with $IdDummy above?
  22. I want to Press Enter to Click Button on Gui1 and Gui 2, But It not work. Could any help me? Thanks all! #include <Constants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <GuiButton.au3> Global $hMain = GuiCreate("New AutoIt v3 Script", 228, 130, -1, -1) Global $Button_1 = GuiCtrlCreateButton("Button1", 60, 20, 140, 40) Global $Button_2 = GuiCtrlCreateButton("Button2", 60, 80, 140, 40) $Iddummy = GUICtrlCreateDummy() GUISetState() $Gui1 = GUICreate("GUI - 1", 200, 100, 0, 0) $ButtonGui1 = GUICtrlCreateButton("Test Gui1", 60, 20, 100, 40) GuiSetState(@SW_HIDE, $Gui1) $Gui2 = GUICreate("GUI - 2", 200, 100, 0, 0) $ButtonGui2 = GUICtrlCreateButton("Test Gui2", 60, 20, 100, 40) GuiSetState(@SW_HIDE, $Gui2) Local $aAccelKeys[1][2] = [["{enter}", $idDummy]] ;tạo hotkey (Ấn ENTER --> Tự động ấn ADD) GUISetAccelerators($aAccelKeys) Do Switch GuiGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Button_1 GUISetState(@SW_SHOWNORMAL, $Gui1) GuiSetState(@SW_HIDE, $Gui2) Case $Button_2 GUISetState(@SW_SHOWNORMAL, $Gui2) GuiSetState(@SW_HIDE, $Gui1) case $ButtonGui1 MsgBox(0, "", "Test GUI 1") case $ButtonGui2 MsgBox(0, "", "Test GUI 2") case $IdDummy _GUICtrlButton_Click($ButtonGui1) _GUICtrlButton_Click($ButtonGui2) ; EndSwitch Until False
×
×
  • Create New...