Jump to content
guinness

Help File/Documentation Issues. (Discussion Only)

Recommended Posts

I was reading https://www.autoitscript.com/forum/topic/162588-extended-length-support-in-file-functions-beta-for-reference/?do=findComment&comment=1190661 

and decided to search for UNICODE in the help file. reading along I read that the command line is

Aut2exe.exe / In < infile.au3 >[/out < outfile.exe >][/icon < iconfile.ico >][/comp 0 - 4][/nopack][/x64][/bin < binfile.bin >]

and the 

Command Line Notes
Long filenames should be enclosed in double-quotes like "C:\Program Files\Test\test.au3".

With the exception of /in all switches are optional.

By default, the 32-bit compiler produces a 32-bit binary and the 64-bit compiler produces a 64-bit binary. Use the /x86 and /x64 parameters to explicitly specify the output.

The /pass and /nodecompile switches are redundant as of version 3.2.8.1. They will be ignored if used and have been removed from this list.

The /ansi and /unicode switches are redundant as of version 3.3.0.0.

The /bin switch is redundant as of version 3.3.10.0 and has been removed from this list..

so the [/bin < binfile.bin >] should be removed

Share this post


Link to post
Share on other sites
Posted (edited)

on _WinAPI_RegNotifyChangeKeyValue the help example should account ( or show ) that x86 != x64 

#include <APIRegConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIError.au3>
#include <WinAPIHObj.au3>
#include <WinAPIProc.au3>
#include <WinAPIReg.au3>

Opt('TrayAutoPause', 0)

Global $iAccess = StringInStr(@OSArch, "64") ? BitOR($KEY_NOTIFY, $KEY_WOW64_64KEY) : $KEY_NOTIFY
If @AutoItX64 Then $iAccess = $KEY_NOTIFY

Local $hKey = _WinAPI_RegOpenKey($HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Run', $iAccess)
If @error Then
    MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), @extended, _WinAPI_GetErrorMessage(@extended))
    Exit
EndIf
Local $hEvent = _WinAPI_CreateEvent()
If Not _WinAPI_RegNotifyChangeKeyValue($hKey, $REG_NOTIFY_CHANGE_LAST_SET, 0, 1, $hEvent) Then
    Exit
EndIf

While 1
    If Not _WinAPI_WaitForSingleObject($hEvent, 0) Then
        Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4096, ''Registry'', ''The registry hive has been modified.'' & @CRLF & @CRLF & ''HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run'', 5)"')
        If Not _WinAPI_RegNotifyChangeKeyValue($hKey, $REG_NOTIFY_CHANGE_LAST_SET, 0, 1, $hEvent) Then
            ExitLoop
        EndIf
    EndIf
    Sleep(100)
WEnd

_WinAPI_CloseHandle($hEvent)
_WinAPI_RegCloseKey($hKey)

 

Edited by argumentum
corrected error

Share this post


Link to post
Share on other sites
On 1/2/2019 at 5:06 PM, argumentum said:

on _WinAPI_RegNotifyChangeKeyValue the help example should account ( or show ) that x86 != x64 

That would apply to every registry function, so why this one specifically?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
11 minutes ago, BrewManNH said:

why this one specifically?

oh, no clue. This is the first time I became aware of the use of "$KEY_WOW64_64KEY". Haven't seen any examples of it's use and thought that having one example would show why the "$KEY_NOTIFY" not work if the compilation don't match the OS's ( 32 vs 64 ). I didn't do a deep dive into the help file, just that one example.

Share this post


Link to post
Share on other sites
10 minutes ago, argumentum said:

Haven't seen any examples of it's use

Then you haven't searched, there are dozens of times that the x86/64 issue has come up, both in registry and file reference functions. It's referenced in the help file under the heading "AutoIt => Using AutoIt => Running under Windows 64-bit Edition"


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
6 minutes ago, BrewManNH said:

Then you haven't searched

Ok, this is not related to "HKCR64 or HKLM64".
In _WinAPI_SfcIsKeyProtected and _WinAPI_RegCreateKey are mentions of $KEY_WOW64_64KEY but no examples.
What I present shows an example. It would not hurt to have at least one example in a help file.

Share this post


Link to post
Share on other sites
On 12/7/2018 at 3:44 AM, mLipok said:

Example for TimerInit

#include <MsgBoxConstants.au3>

Local $hTimer = TimerInit() ; Begin the timer and store the handle in a variable.
Sleep(3000) ; Sleep for 3 seconds.
Local $fDiff = TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit. The variable we stored the TimerInit handlem is passed as the "handle" to TimerDiff.
MsgBox($MB_SYSTEMMODAL, "Time Difference", $fDiff)

 

Fixed it today.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2019-07-24 - Version 1.3.6.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 (NEW 2019-11-07 - Version 1.3.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@people who are able to modify the wiki documentation pages :

First of all, I apologize if this post will be very long (my biggest default) but I like to explain in details, with pics etc...
A couple of days ago, I wanted to help Moist in this thread and before I replied to him, I was very happy to read in the help file, topic GUICtrlCreatePic(), the following sentence :

"To set the picture control to the same size as the file content, set width and height to 0"

Terrific feature I thought, but a couple of hours later and after dozen of useless tests, trying any kind of picture size/extension or applying any style / extended style, it didn't work.

Then I thought : "why not trying to copy and paste the whole sentence in Google and see where it goes from here ?"
I knew it would return dozen of links referring to the help file but I was lucky enough to find this link, Ticket #3682 reported by anonymous 11 months ago (ticket still opened waiting for a reply) and here is a resume of what anonymous wrote :

...While in AutoIt 3.3.12.0 this worked nice, in 3.3.14.5 this causes the image to be displayed in a 150x150 square...

After reading that, I downloaded several AutoIt versions (including the 3 Beta's) just to try that specific feature and double check anonymous test, here are the results :

1674866143_163-3in1.jpg.aca2bba67a0de64a363889bc229d6184.jpg

And this is the script used to display the 2 Gui's from the precedent picture, please feel free to try it with any of your pictures :

#include <GuiConstantsEx.au3>

$hGui = GUICreate("163 - AutoIt " & @AutoItVersion, 300, 435)
GUICtrlCreatePic(@ScriptDir & "\163 - Original pic.jpg", 1, 1, 0, 0)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete($hGui)

As you can see, the downgrade happened when AutoIt 3.3.14.3 was released, because everything works fine with all precedent versions I tested, last working version is 3.3.14.2
Imho, this downgrade could be related to another ticket #2916 as shown in AutoIt history (though I may be mistaken) :

1777043120_163-AutoIthistory.png.17cc3ee4404feb49d87f32651aaf7e7c.png

So the only thing I'm asking now is : could it be possible to any of you to modify this wiki page and add a note to indicate that this feature is no more available actually, something like this :

To set the picture control to the same size as the file content set width and height to 0.
(this feature is broken since version AutoIt 3.3.14.3, waiting to be fixed)

Of course the local help file AutoIt.chm on our HD won't reflect this modification (until next AutoIt release) but at least, when in doubt concerning any function, we all could rely on Wiki doc to make sure that we are reading the most recent help file fully amended.

Thanks for reading and thumbs up to our devoted wiki contributors :thumbsup:

Edit : in case you wonder why I also downloaded the antique versions autoit-v3.2.10.0 (2007) and autoit-v3.2.12.0 (2008), it's because another important thing changed in AutoIt between these 2 versions (more than 11 years ago) but the actual help file doesn't reflect it and still indicates a wrong sentence. If I got strength enough, I'll prepare another fully detailed post. That magnifier in the avatar is a big help :)

Edited by pixelsearch

Share this post


Link to post
Share on other sites

The example for _WinAPI_GetWindowDC (actually it is the _WinAPI_CreatePen example) does not work when run from SciTE. The cross does not get fully drawn and it disapears in a split second. But it should get displayed for 3 seconds.
This only happen when the example is run from SciTE. Why is described here.

To solve the problem I would like to Exit the example script when uncompiled with a MsgBox describing the problem an explaining the solution.

What do you think?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2019-07-24 - Version 1.3.6.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 (NEW 2019-11-07 - Version 1.3.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

In the _GDIPlus_GraphicsSetTransform example, the DrawInsert function is missing the $fAngle in the documentation... kinda not a problem, but very confusing when trying to use it and your picture suddenly rotates! :D

Edit: More than one of the UDFs uses this function... I can get a list if you need
Edit2: Too tired, it was the same function. Going to bed now

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

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 Skysnake
      I tried to create a ticket and Trac told me my submission looks like spam.  I do not see a captcha on either of the submission or "spam" screens...
       
      Tiny little documenation issue:
      GUICtrlRegisterListViewSort
      Example 1 on Line 17
      The documentation refers to the function "SortLV" where it is in fact "LVSort" used in the example.
      Example 2 uses "LVSort2" (correct)
    • By l3ill
      Hi,
        been searching for a way to Pause a HotKeySet and it would seem that the Help File has one beautifully prepared.
      But it turns out that Pause does not stop the HotKeySet from working.
        Anyone know why? And/Or how to fix it?
      Thanks,
      Bill
    • By guinness
      This post outlines correct usage of reporting a documentation error in AutoIt.

      To report a help file issue, first navigate to Trac and create a new ticket. Ensure that the issue isn't present in the latest available version e.g. beta version and follow the following requirements for submitting:
      Change the "Component" option to Documentation. Change the "Version" option to whichever version you saw the issue in. It's preferred that you check the latest version .e.g. current beta, before submitting the ticket. Be as descriptive as you can when posting an issue, the more information you can provide e.g. where you found the issue and what it should be, will aid in the problem being fixed quickly. Up until now those that have posted have done so in a clear and concise manner, so lets keep it that way please. If this starts to deviate in any way then I will be forced to adopt a more strict approach.
      >Previous 'Report Help File Issues' thread.

      Issues with AutoIt:
      For reporting an issue with AutoIt ensure you've isolated the problem in a small script that reproduces the error, assessed in the General Help and Support Forum that it's not a problem with poorly written code and then if none of those fix the problem, post to Trac for an AutoIt Developer to assess the issue.
×
×
  • Create New...