Jump to content
PeterVerbeek

Pal, Peter's AutoIt functions Library

Recommended Posts

This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.20 contains 197 functions divided into these topics:

Change log and files section  on the PAL website (SourceForge).

A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension, which is a user interface for the system-wide audio driver called Equalizer APO.

Edited by PeterVerbeek

Share this post


Link to post
Share on other sites

Great toolbox :thumbsup:

I just noticed that you provide a CHM file as well.
How did you create this help file?
Did you use the UDF source file as input?
Which tools do you use?

I always wanted to create a full blown CHM help file for my UDFs but couldn't get my head around it ;)

I would be glad if you could shed some light onto the subject.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-03-26 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-03-21 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

I create CHM file's with Precision Helper. It's pretty easy to use but you need a decent HTML editor for the pages of your manual/help file. I use BlueGriffon. Let me hear if you need more info but it's quite easy to set up.

For every UDF I created a HTLM file. Of course I could have create an automatic HTML file creator tool which scans the UDF's to create HTLM pages but I didn't bother. Most UDF's have additional info like an example which need to be written. To my opinion every library and program need a manual, a CHM file and/or website. Precision Helper can also created the pages for a help manual website.

For the images in my programs and in a manual I use Inkscape and the Gimp.

Share this post


Link to post
Share on other sites

Thanks a lot!

I already can generate the html files from a UDF. So I just need to play with the tool you suggested and create the CHM. Great 😃


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-03-26 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-03-21 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

That's right. The only thing you need is a stylesheet (css file) to make your html pages look nice. I guess you're familair how a website is build so you know what a css file is.

Share this post


Link to post
Share on other sites

Another tip I can give you. If you want to show a CHM file to an user of your app, you need to do this in a certain way. Fortunately the miscellaneous section of Pal has 2 UDF's for this: _CHMShow() and _CHMShowOnF1().

Share this post


Link to post
Share on other sites

The 1.20 version of PAL has one handy function called _WindowForceToPrimaryMonitor(). When you have a mechanism of saving and restoring a GUI window position, it could be that the GUI is restored beyond the desktop due to a change of the desktop or a monitor deactivation.

;~ restore GUI to former position as stored in $SavedPos[]
$hMyGUI = GUICreate("My amazing app", 500, 300, $SavedPos[0], $SavedPos[2])
_WindowForceToPrimaryMonitor($hMyGUI)   ; if needed force GUI to primary monitor when $SavedPos[] is outside desktop area

 

Share this post


Link to post
Share on other sites
On 1/28/2020 at 6:03 PM, PeterVerbeek said:

Let me hear if you need more info

I have installed Precision Helper, and already have most of the HTML help pages required for the manual for my app, however I am stumped as to how to put them all together into a decent .chm file with index, TOC, etc. Is there a resource you can recommend where I can find beginners' (step-by-step) tutorial/how-to?

Share this post


Link to post
Share on other sites

Start Precision Helper to create a new project in a folder (I usually create a folder called Help in my AutoIt project folder). At the left you'll find the TOC, Index and tabs such as Settings. Add a topic in the TOC and select a HTML file by clicking the "Select topic" button (right to the Table of Contents). Keep adding topics and subtopics to create the manual/help. You can drag a topic to change its position in the TOC. Then add search keys in the Index, same procedure as topics. The green Run button creates the chm file and shows it. One neat trick is putting your HTML editor in the Precision Helper settings so it can be started by the clicking the Edit button.

I've included an image of the manual I made for the Peace equalizer. In orange some pointers on how to create a chm.

286576356_PrecisionHelperPeacemanualinstructions.thumb.png.4302dc2403df4948f21bdf8be63c7d8e.png

Edited by PeterVerbeek

Share this post


Link to post
Share on other sites
Posted (edited)

You should get what's shown below. Do get any details, say on the first topic? I haven't encounter an issue Windows not correctly displaying a chm file.

As an alternative I've included a zip file which can be displayed in a browser. Unzip to a folder and open index.htm.

1614213789_chm-_WindowWidth.thumb.png.7d936006c8cfd107dff2b0c5364998bf.png

 

htmlhelp.zip

Edited by PeterVerbeek

Share this post


Link to post
Share on other sites

It's a Microsoft security restriction stopping the display. Its impossible to view CHM files that are stored on a network drive unless you lower the restrictions on the Local Intranet zone to allow CHM files to be displayed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Dan_555
      Hi, here are few functions for the ListBox.
      I have searched the forum, but most of the functions are for listview, so i took one example code from melba23 (clear selection) and
      wrote few more functions. (Because my current project needs them).
       
      These functions work only on a Multi-selection ListBox .
      The functions do: Clear Selection, Delete Selected items, Invert Selection, Move selected items up and down.
       The example code has 2 Listboxes. The selected items on the left ListBox can be moved up and down. The right Listbox has buttons for the other functions.
      #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <WindowsConstants.au3> Global $hForm1 = GUICreate("Listbox test", 349, 287) $LB_1 = GUICtrlCreateList("", 6, 40, 157, 244, BitOR($LBS_NOTIFY, $LBS_MULTIPLESEL, $WS_HSCROLL, $WS_VSCROLL, $LBS_DISABLENOSCROLL)) $LB_2 = GUICtrlCreateList("", 179, 40, 157, 244, BitOR($LBS_NOTIFY, $LBS_MULTIPLESEL , $WS_HSCROLL, $WS_VSCROLL, $LBS_DISABLENOSCROLL)) $BL_1 = GUICtrlCreateButton("Up", 20, 3, 35, 18) $BL_2 = GUICtrlCreateButton("Down", 60, 3, 35, 18) $BR_1 = GUICtrlCreateButton("Up", 200, 3, 35, 18) $BR_2 = GUICtrlCreateButton("Down", 240, 3, 35, 18) $BR_3 = GUICtrlCreateButton("Reverse Sel", 272, 22, 68, 17) $BR_4 = GUICtrlCreateButton("Clear Sel", 217, 22, 52, 17) $BR_5 = GUICtrlCreateButton("Delete", 175, 22, 40, 17) $BR_6 = GUICtrlCreateButton("Populate", 290, 3, 50, 18) GUISetState(@SW_SHOW) For $x = 0 To 50 If $x <= 10 Then GUICtrlSetData($LB_1, $x & " test", 0) GUICtrlSetData($LB_2, $x & " Test", 0) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BL_1 $a = Listbox_ItemMoveUD($LB_1, -1) If $a > -1 Then WinSetTitle($hForm1, "", "Moved items: " & $a) Case $BL_2 $a = Listbox_ItemMoveUD($LB_1, 1) If $a > -1 Then WinSetTitle($hForm1, "", "Moved items: " & $a) Case $BR_1 Listbox_ItemMoveUD($LB_2, -1) Case $BR_2 Listbox_ItemMoveUD($LB_2, 1) Case $BR_3 Listbox_ReverseSelection($LB_2) Case $BR_4 Listbox_ClearSelection($LB_2) Case $BR_5 Listbox_DeleteSelectedItems($LB_2) Case $br_6 ;Populate GUICtrlSetData($LB_2, "") ; Clears the listbox For $x = 0 To 50 GUICtrlSetData($LB_2, $x & " Test", 0) Next EndSwitch WEnd ;note $hLB_ID - is the Listbox id Func Listbox_DeleteSelectedItems($hLB_ID) local $aSel = _GUICtrlListBox_GetSelItems($hLB_ID) Local $i For $i = $aSel[0] To 1 Step -1 _GUICtrlListBox_DeleteString($hLB_ID, $aSel[$i]) Next EndFunc ;==>Listbox_DeleteSelectedItems Func Listbox_ClearSelection($hLB_ID) Local $aSel = _GUICtrlListBox_GetSelItems($hLB_ID) ;Code from Melba23 - Autoit Forum For $i = 1 To $aSel[0] _GUICtrlListBox_SetSel($hLB_ID, $aSel[$i], False) Next EndFunc ;==>Listbox_ClearSelection Func Listbox_ReverseSelection($hLB_ID) Local $i Local $aCou = _GUICtrlListBox_GetCount($hLB_ID) Local $cSel = _GUICtrlListBox_GetCaretIndex($hLB_ID) ;Save the caret For $i = 0 To $aCou _GUICtrlListBox_SetSel($hLB_ID, $i, Not (_GUICtrlListBox_GetSel($hLB_ID, $i))) Next _GUICtrlListBox_SetCaretIndex($hLB_ID, $cSel) ;Restore the caret EndFunc ;==>Listbox_ReverseSelection Func Listbox_ItemMoveUD($hLB_ID, $iDir = -1) ;Listbox_ItemMoveUD - Up/Down - Works only on multiple selection listbox ($LBS_MULTIPLESEL) ;$iDir: -1 up, 1 down ;Return values -1 nothing to do, 0 nothing moved, >0 performed moves Local $iCur, $iNxt, $aCou, $aSel, $i, $m = 0 ;Current, next, Count, Selection, loop , movecount $aSel = _GUICtrlListBox_GetSelItems($hLB_ID) ;Put selected items in an array $aCou = _GUICtrlListBox_GetCount($hLB_ID) ;Get total item count of the listbox WinSetTitle ($hForm1,"",$aSel[0]) Select Case $iDir = -1 ;Move Up For $i = 1 To $aSel[0] If $aSel[$i] > 0 Then $iNxt = _GUICtrlListBox_GetText($hLB_ID, $aSel[$i] - 1) ;Save the selection index - 1 text _GUICtrlListBox_ReplaceString($hLB_ID, $aSel[$i] - 1, _GUICtrlListBox_GetText($hLB_ID, $aSel[$i])) ;Replace the index-1 text with the index text _GUICtrlListBox_ReplaceString($hLB_ID, $aSel[$i], $iNxt) ;Replace the selection with the saved var $m = $m + 1 EndIf Next For $i = 1 To $aSel[0] ;Restore the selections after moving If $aSel[$i] > 0 Then _GUICtrlListBox_SetSel($hLB_ID, $aSel[$i] - 1, 1) EndIf Next Return $m Case $iDir = 1 ;Move Down If $aSel[0] > 0 Then For $i = $aSel[0] To 1 Step -1 If $aSel[$i] < $aCou - 1 Then $iNxt = _GUICtrlListBox_GetText($hLB_ID, $aSel[$i] + 1) _GUICtrlListBox_ReplaceString($hLB_ID, $aSel[$i] + 1, _GUICtrlListBox_GetText($hLB_ID, $aSel[$i])) _GUICtrlListBox_ReplaceString($hLB_ID, $aSel[$i], $iNxt) $m = $m + 1 EndIf Next EndIf For $i = $aSel[0] To 1 Step -1 ;Restore the selections after moving If $aSel[$i] < $aCou - 1 Then _GUICtrlListBox_SetSel($hLB_ID, $aSel[$i] + 1, 1) EndIf Next Return $m EndSelect Return -1 EndFunc ;==>Listbox_ItemMoveUD  
    • By bylly
      Hello this is the code maybe you can figure it out I placed some comments to try and explain what I want
      #include <Array.au3> AnyDeskOpen() Func AnyDeskOpen() Global $aWinList = WinList("[REGEXPTITLE:(?i)(.*Anydesks*)]") ;get window name and handle from windows and store into an array $asd = $aWinList $aExtract = _ArrayExtract($asd) ; beginner babble clean this Sh** up Global $default = _ArrayToString($aExtract, "", 0, 0) EndFunc StartWait() ; check in the array to see how many windows are opened Func StartWait() While 1 AnyDeskOpen() If $Default = 1 Then Sleep (3500) Else Exitloop EndIf WEnd EndFunc If $default = "2" Then ; If two windows are opened than someone is trying to connect to that computer and needs a click to accept connection try and click accept Button in the first window and the second one by activating diffrent window handle $extra = _ArrayToString($aWinList, "", 1, 1) $sString = StringReplace($extra, "AnyDesk", "") $hGUI = $sString WinActivate(HWnd($hGUI)) winmove (HWnd($hGUI), "", 50, 50) Mouseclick ("left", 100, 500) Sleep (1500) $extra = _ArrayToString($aWinList, "", 2, 2) $sString = StringReplace($extra, "AnyDesk", "") $hGUI = $sString WinActivate(HWnd($hGUI)) winmove (HWnd($hGUI), "", 50, 50) Mouseclick ("left", 100, 500) EndIf While 1 ;up to here everything seems to work AnyDeskOpen() ; while there is a connection there are two AnyDesk windows, if we close the connection than only one window remains opened and we check the array to see how many values it has If $Default = 2 Then Sleep (3500) Else ; At this point the program exits code 0 instead of resseting to function above StartWait() Exitloop EndIf WEnd ; thank you  the intent is to keep the program going so it clicks accept again when reconnecting
    • By Rabu
      I want to use the winsock overlapped/completion routine method of i/o, but how do I get the pointer to my user function.  I know it is possible because when using the old method of windows messages, the user function name was used instead of a pointer.
    • By topgundcp
      Hi, 
      This is my very first post in this forum and am also new with Autoit programming so be easy on me.
      Below is the code that I am trying to get the index of the item selected. No problem getting the text.
      Case $listEdition   ; handle of the list             local $index=0             $item=GUICTRLRead($listEdition)    ; This will return the text in the list             ; ==============   The loop below always fails  ==================             ; Meaning _GUICtrlListView_GetItemSelected($listEdition, $i) always return FALSE. WHY ???????              For $i = 0 To $editionArray[0] - 1   ; The content of the list in an array where editionArray[0] contains total count of items                 If _GUICtrlListView_GetItemSelected($listEdition, $i) Then                     $index = $i                     exitloop                 EndIf              Next              ;===================================================             ConsoleWrite( "Select Edition:     " & $item & "  index: " & $index & @CR) ....... Please look at the comments in the code & the pix attached.
      _GUICtrlListView_GetItemSelected($listEdition, $i) always returns FALSE.
      Another problem is on the list. It also populate  the total count of items from the Array. How can I skip this item from populating to the list ?.
      Please advise and thanks

    • By n0ktar
      is it possible to make a wall chams in rainbow six siege using autoit scripts? tell me please and how . 
×
×
  • Create New...