Jump to content

Recommended Posts

  • 4 months later...
Posted (edited)

Helpfile/webhelp

_WinAPI_SetWindowDisplayAffinity() is missing an option, $WDA_EXCLUDEFROMCAPTURE

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity

/edit

hmm, appears it's not even included in autoit, the function say it requires atleast win7, but WDA_EXCLUDEFROMCAPTURE requires win10.

Edited by Werty

Some guy's script + some other guy's script = my script!

  • 3 months later...
Posted (edited)

in https://www.autoitscript.com/forum/topic/131503-shared-folders/#findComment-1541668 I helped the user with where to find the include(s)

Going down the rabbit hole looked at _WinAPI_ShellGetFileInfo() there is no example. Further down found a ticket and modernized it.

#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <APIShellExConstants.au3>
#include <WinAPIShellEx.au3>
#include <WinAPIIcons.au3>

Example()
Func Example()
    GUICreate("", 128, 128)
    Local $iIcon = GUICtrlCreateIcon("", 0, 48, 48, 32, 32)
    _Icon_Set($iIcon, @ScriptFullPath)
    GUISetState(@SW_SHOW)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

Func _Icon_Clear($iControlID)
    If $iControlID = -1 Then $iControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iControlID))
    Return GUICtrlSendMsg($iControlID, $STM_SETIMAGE, $IMAGE_ICON, 0)
EndFunc   ;==>_Icon_Clear

Func _Icon_Set($iControlID, $sFilePath)
    If $iControlID = -1 Then $iControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iControlID))
    Local $tInfo = DllStructCreate($tagSHFILEINFO)
    _WinAPI_ShellGetFileInfo($sFilePath, BitOR($SHGFI_ICON, $SHGFI_LARGEICON), 0, $tInfo)
    Local $hIcon = DllStructGetData($tInfo, 'hIcon')
    Return _WinAPI_DestroyIcon(GUICtrlSendMsg($iControlID, $STM_SETIMAGE, $IMAGE_ICON, $hIcon))
EndFunc   ;==>_Icon_Set

and used this script ( above ) because it would complement _WinAPI_DestroyIcon() that is also without an example.

Or add both examples.

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • 3 weeks later...
Posted

Hi everybody :)
If I'm not mistaken, there are 2 examples in the help file where an inappropriate structure is created. Though the result is correct, it's a bit confusing. Topics are :

_GUICtrlRichEdit_AutoDetectURL
_GUICtrlRichEdit_GetTextInRange

Here is the incorrect part :

...
_GUICtrlRichEdit_SetEventMask($g_hRichEdit, $ENM_LINK)
...

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    ...
    Case $iCode = $EN_LINK
        $tMsgFilter = DllStructCreate($tagMSGFILTER, $lParam)
        If DllStructGetData($tMsgFilter, "msg") = $WM_LBUTTONUP Then
            $tEnLink = DllStructCreate($tagENLINK, $lParam)
            $iCpMin = DllStructGetData($tEnLink, "cpMin")
            $iCpMax = DllStructGetData($tEnLink, "cpMax")
            MsgBox($MB_SYSTEMMODAL, "", "Invoke your web browser here and point it to " & _
                _GUICtrlRichEdit_GetTextInRange($g_hRichEdit, $iCpMin, $iCpMax))
        EndIf
    ...
EndFunc

The structure $tagMSGFILTER has nothing to do with $EN_LINK . Only $EN_MSGFILTER should use $tagMSGFILTER . Imho both examples should be modified like this :

...
_GUICtrlRichEdit_SetEventMask($g_hRichEdit, $ENM_LINK)
...

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    ...
    Case $iCode = $EN_LINK
        $tEnLink = DllStructCreate($tagENLINK, $lParam)
        If DllStructGetData($tEnLink, "msg") = $WM_LBUTTONUP Then
            $iCpMin = DllStructGetData($tEnLink, "cpMin")
            $iCpMax = DllStructGetData($tEnLink, "cpMax")
            MsgBox($MB_SYSTEMMODAL, "", "Invoke your web browser here and point it to " & _
                _GUICtrlRichEdit_GetTextInRange($g_hRichEdit, $iCpMin, $iCpMax))
        EndIf
    ...
EndFunc

Thanks for reading

 

"I think you are searching a bug where there is no bug... don't listen to bad advice."

  • 1 month later...
Posted (edited)

Edit 1: no, I'm silly ...

Edit 2: Wait ... no, I think this is a mistake after all ...

So, in the _GUICtrlEdit_SetTabStops parameters section:

Array of tab stops in the following format:
[0] - Tab stop 1
[2] - Tab stop 2
[n] - Tab stop n

Edited by jaberwacky
Posted (edited)

@jaberwacky You are right.  Doc is mistaken. Also there is a bug in the example of _GUICtrlEdit_SetTabStops.  The icon on the status bar is not showing.

After debugging, the call to DestroyIcon is the culprit, need to make a tracker...

Edited by Nine
  • 1 month later...
Posted

I don't know if I'm in the right place,
I just discovered in the example C:\Program Files (x86)\AutoIt3\Examples\Helpfile\_Timer_SetTimer.au3

which was an example for:
_Timer_KillAllTimers
_Timer_KillTimer
_Timer_SetTimer

that a line is missing from the example.

$g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts)
_GUICtrlStatusBar_SetParts($g_hStatus, $aParts) ; * <-- this line is missing

so that the example also shows the time, as it was designed

 

I know that I know nothing

  • 1 month later...
Posted

Hi everybody

_ArrayInsert . Help file (3.3.16.1) stipulates :

Success: the new size of the array.
Failure: 0 and sets the @error flag to non-zero.

This was correct until version 3.3.10.2 (from 2013)
Excerpts from the function (2013)

If Not IsArray($avArray) Then Return SetError(1, 0, 0)
If UBound($avArray, 0) <> 1 Then Return SetError(2, 0, 0)
If $iElement > UBound($avArray) Then Return SetError(3, 0, 0)

Starting with version 3.3.12.0 (from 2014) the return value is always -1 when there is a failure :
Excerpts from the function (2014 to 2025)

If Not IsArray($avArray) Then Return SetError(1, 0, -1)
Return SetError(2, 0, -1)
Return SetError(3, 0, -1)
Return SetError(4, 0, -1)
Return SetError(5, 0, -1)
Return SetError(6, 0, -1)
Return SetError(7, 0, -1)
Return SetError(8, 0, -1)

Could you please be kind to amend the help file, topic _ArrayInsert, to indicate that the Return value is -1 when the function fails?
Thanks

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted (edited)
On 3/5/2025 at 11:45 PM, argumentum said:

Or add both examples.

added: _WinAPI_ShellGetFileInfo.au3
I can't remember how to complete the _WinAPI_DestroyIcon documentation "as a reference to _WinAPI_ShellGetFileInfo.au3"
I hope someone else will complete this soon.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
On 7/6/2025 at 6:25 PM, pixelsearch said:

Could you please be kind to amend the help file, topic _ArrayInsert, to indicate that the Return value is -1 when the function fails?

Excellent find. Fixed

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

@guinness Hello my friend

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted (edited)
5 hours ago, guinness said:

Excellent find. Fixed

@guinness is here, such great news. Thanks for your incredible participation in AutoIt :thumbsup:

Yesterday I found that something important  was also missing in the help file (as stated in this post) . Please let me paste it here as that's the place to be :

15 hours ago, pixelsearch said:

For the record, this line would be a good start in OP's script, placed in the TrayGetMsg loop :

Case $TRAY_EVENT_MOUSEOVER
    ...

It is strange that the help file doesn't mention the event $TRAY_EVENT_MOUSEOVER in the topic TrayGetMsg when it is mentioned in the topic TraySetOnEvent

That's a big difference with the events listed in the help file, topic GUIGetMsg and GUISetOnEvent : the same events are listed in these 2 topics.

Thanks if you can fix it too.

Edited by pixelsearch

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted

Thanks @pixelsearch. Indeed I double checked and it seems this constant was missing from the list. I have fixed it now.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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
×
×
  • Create New...