Jump to content

Riekeltkeuter

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Riekeltkeuter

  1. I would like this too, so I tried this and seems to work: The trick is to find the 0-based index out of the dynamic listview. This is accomplished by first search the item via _GUICtrlListView_FindText (search for the text eg. "7-zip.exe" in the list and return the 0-based index). The _GUICtrlListView_SetItemChecked changes the state of the checkbox, but really needs the 0-based index. For $i = 1 To UBound($array) Step 1 $category = IniRead($iniFile, $array[$i - 1], "Category", "5") $desc = IniRead($iniFile, $array[$i - 1], "Desc", "") $checked = IniRead($iniFile,$array[$i - 1],"Default", "") If $category = 1 Then GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1) if $checked = "True" Then $iI = _GUICtrlListView_FindText($ListView1, $array[$i - 1]) ;Get 0-based index of current created control _GUICtrlListView_SetItemChecked($ListView1, $iI, True) ;Set checked radiobox of last found control EndIf ElseIf $category = 2 Then GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView2) if $checked = "True" Then $iI = _GUICtrlListView_FindText($ListView2, $array[$i - 1]) ;Get 0-based index of current created control _GUICtrlListView_SetItemChecked($ListView2, $iI, True) ;Set checked radiobox of last found control EndIf ElseIf $category = 3 Then GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView3) if $checked = "True" Then $iI = _GUICtrlListView_FindText($ListView3, $array[$i - 1]) ;Get 0-based index of current created control _GUICtrlListView_SetItemChecked($ListView3, $iI, True) ;Set checked radiobox of last found control EndIf ElseIf $category = 4 Then GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView4) if $checked = "True" Then $iI = _GUICtrlListView_FindText($ListView4, $array[$i - 1]) ;Get 0-based index of current created control _GUICtrlListView_SetItemChecked($ListView4, $iI, True) ;Set checked radiobox of last found control EndIf ElseIf $category = 6 Then GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView6) if $checked = "True" Then $iI = _GUICtrlListView_FindText($ListView6, $array[$i - 1]) ;Get 0-based index of current created control _GUICtrlListView_SetItemChecked($ListView6, $iI, True) ;Set checked radiobox of last found control EndIf Else GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView5) if $checked = "True" Then $iI = _GUICtrlListView_FindText($ListView5, $array[$i - 1]) ;Get 0-based index of current created control _GUICtrlListView_SetItemChecked($ListView5, $iI, True) ;Set checked radiobox of last found control EndIf EndIf Next
  2. Many thanks Water, works like a charm! Also thanks for your quick reply. ;_PPT_SlideShow($oPresentation, True, 1, Default, False, $ppShowTypeSpeaker) ;If @error Then Exit MsgBox($MB_SYSTEMMODAL, "PowerPoint UDF: _PPT_SlideShow Example 1", "Error running slide show." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;MsgBox($MB_SYSTEMMODAL, "PowerPoint UDF: _PPT_SlideShow Example 1", "Slide show started.") $oSlideShow = _PPT_SlideShow($oPresentation, True, 1, Default, False, $ppShowTypeSpeaker) Global Const $ppSlideShowDone = 5 ; Done While $oSlideShow.View.State <> $ppSlideShowDone Sleep(10000) ; check every 10 seconds WEnd ; Exit or shutdown here ; ***************************************************************************** ; Close the PowerPoint instance ; ***************************************************************************** _PPT_Close($oPPT) ;If @error Then Exit MsgBox($MB_SYSTEMMODAL, "PowerPoint UDF: _PPT_Close Example 1", "Error closing the PowerPoint application." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
  3. Hi, Great work with this UDF. I was wondering, is it possible to close and quit the powerpoint after the last slide? I would like to shutdown the machine after the last slide is done for my purpose.. I am quite new to AutoIT scripting. When I just call the _PPT_Close($oPPT) or $oPPT.Quit in-line, it gets handled multitasked, so resulting in exiting immidiatly.. I would like to have this to wait until black slide "presentation ended" is on. Thanks in advance. ; *********************************************************************************************** ; Run entire slide show. Display the show in Speaker mode ; *********************************************************************************************** ; Name Value Description ; ppShowTypeKiosk 3 Kiosk ; ppShowTypeSpeaker 1 Speaker ; ppShowTypeWindow 2 Window ; #FUNCTION# ==================================================================================================================== ; Name...........: _PPT_SlideShow ; Description ...: Set properties for a slide show and run the show ; Syntax.........: _PPT_SlideShow($oPresentation[, $bRun = True[, $vStartingSlide = 1[, $vEndingSlide = Default[, $bLoop = True[, $iShowType = $ppShowTypeKiosk]]]]]) ; Parameters ....: $oPresentation - Presentation object. ; $bRun - [optional] If True then the function starts the slide show (default = True). ; $vStartingSlide - [optional] Name or index of the first slide to be shown (default = 1). ; $vEndingSlide - [optional] Name or index of the last slide to be shown (default = keyword Default = the last slide in the presentation). ; $bLoop - [optional] If True then the slide show starts again when having reached the end (default = True). ; $iShowType - [optional] Type of slide show defined by the PpSlideShowType enumeration (default = $ppShowTypeKiosk). ; Return values .: Success - the slidewindow object when $bRun = True, else 1. ; Failure - 0 and sets @error. ; |1 - $oPresentation is not an object or not a presentation object ; |2 - $vStartingSlide is a number and < 1 or > current number of slides ; |3 - $vEndingSlide is a number and < 1 or > current number of slides ; |4 - Error occurred when running the slide show. @extended is set to the COM error code returned by the Run method ; Author ........: water ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== _PPT_SlideShow($oPresentation, True, 1, Default, False, $ppShowTypeSpeaker) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "PowerPoint UDF: _PPT_SlideShow Example 1", "Error running slide show." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;MsgBox($MB_SYSTEMMODAL, "PowerPoint UDF: _PPT_SlideShow Example 1", "Slide show started.") ; ***************************************************************************** ; Close the PowerPoint instance ; ***************************************************************************** ;_PPT_Close($oPPT) ;If @error Then Exit MsgBox($MB_SYSTEMMODAL, "PowerPoint UDF: _PPT_Close Example 1", "Error closing the PowerPoint application." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
×
×
  • Create New...