Jump to content

Recommended Posts

Posted

Hi, I just discovered this problem: Hit Alt-F4 and this script (compile it) will crash AutoIt everytime:

#include <WindowsConstants.au3>
Local $Main_Window = GUICreate ("Test Alt-F4")
GUISetState ()

GUIRegisterMsg ($WM_SYSCOMMAND, "Windows_System_Command")

While 1
  Sleep (60000)
WEnd

Func Windows_System_Command ($hWndGUI, $MsgID, $WParam, $LParam)

Local $Command_Type = BitAnd ($WParam, 0xFFF0), _
      $SC_CLOSE = 0xF060

If $Command_Type = $SC_CLOSE Then Shut_Down ()

EndFunc

Func Shut_Down ()

GUIDelete ($Main_Window)

Exit

EndFunc

In the real application, there is additional shut down processing to perform after the delete of the application's window. Deleting the window as early as possible gives the illusion of "instant exit" to the user. The work-around of course was simple, just hide the window instead of deleting it. I only post this so the developers can determine if there are other ramifications. I don't know if the problem existed in 13.3, but the application did not experience this problem in the production release.

  • Replies 641
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Excuse me for placing this here but the bug ticket was rejected as potential spam??

I have had a look at AutoItx3 v3.2.13.7 and checked some of the functions. The ones that return

Unicode text work OK.

However I did find an issue with both AU3_ControlGetHandle and AU3_WinGetHandle, and this may

apply to others as well.

Here is the declaration for C#:

//AU3_API void WINAPI AU3_ControlGetHandle(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText

//, const char *szControl, char *szRetText, int nBufSize);

[DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]

static public extern void AU3_ControlGetHandle([MarshalAs(UnmanagedType.LPWStr)] string Title

, [MarshalAs(UnmanagedType.LPWStr)] string Text, [MarshalAs(UnmanagedType.LPWStr)] string Control

, byte[] RetText, int BufSize);

Here is the usage:

string clip = "";

byte[] returnbytes = new byte[200];

//Note the return value for next function is way to high and wrong

AutoItX3Declarations.AU3_WinGetHandle("Untitled - Notepad", "", returnbytes, returnbytes.Length);

//clip = new ASCIIEncoding().GetString(returnbytes);

clip = System.Text.Encoding.Unicode.GetString(returnbytes).TrimEnd('\0');

MessageBox.Show(clip);

The return text is in the correct format ie: 0x1234ABCD but the handle is not correct;

Perhaps I am doing something wrong?

Regards,

John.

Posted (edited)

Ever since I installed the 13.3 beta, I sometimes experience a "false" $GUI_EVENT_PRIMARUP event for a child window. It seems to occur only before the first time the window is shown. I am currently running the 13.7 beta and experience the same phenomenon.

I know I need to try to devise a sample script to show the problem, but I haven't taken the time yet. I just wonder if anyone else has experience this or a similar problem?

Edit: I spent several HOURS trying to "debug" this. I am definitely getting an unexpected $GUI_EVENT_PRIMARYUP, but my attempts at reproducing it in a simple test script failes (i.e. the test scripts work perfectly). I did confirm this behavior is NOT observed in the production release (i.e. same application compiled under the beta release causes the problem, which by the way, is infrequent). My comment regarding the "first time" seems to be not only the "first time", but the first child window displayed after the parent window is displayed).

Does anyone have any tips regarding how to "debug" a situation like this?

Edited by pdaughe
  • 2 weeks later...
Posted

I also couldn't get the ControlHandle and WinGetHandle functions to work with the official 3.2.12.1 build. I tried testing current 3.13.7 beta build, but as it now only accept Unicode parameters I have to translate all access commands first.

  • 1 month later...
  • Administrators
Posted

http://www.autoitscript.com/autoit3/files/beta/autoit

3.2.13.8 (4th October, 2008) (Beta)

AutoIt:

- Added #454: $FO_UTF8 allowing FileOpen() in Read mode for reading UTF8 files without BOM.

- Added: $FO_UTF16_LE, $FO_UTF16_BE allowing FileOpen() in Read mode for reading UTF16 files without BOM.

- Fixed #501: ProcessGetStats() failed for processes running as other users (including SYSTEM).

- Fixed #92: DllStruct data truncated with char[]/wchar[].

- Fixed #562: Specifying the TITLE property caused all other properties to be lost (Window title matching).

- Fixed: GuiCtrlSetState($graphic, $GUI_HIDE) does not hide.

- Fixed: GuiCtrlSetResizing($graphic, ) not moving.

- Fixed: GuiCreate(...,Style without caption) does not resize properly.

- Fixed: GuiSetStyle(caption change) does not resize properly.

- Fixed: GuiCtrlSetState($listviewitem) does not return error.

- Fixed #569 TCPRecv doc example.

- Fixed #589: Some comparison operators did not return a boolean value.

- Fixed #583: Bad formatting of @MSEC in documentation.

- Fixed #574: Using 0 for the SendKeyDelay or SendKeyDownDelay removes the respective delay when using Send().

- Fixed #542: Crash with regular expressions.

- Fixed #531: Clarification of some of the remarks for GUICtrlSetGraphic().

- Fixed #539: StringSplit() with flag 2 and no matching delimiters wasn't returning the full string.

- Changed: PCRE regular expression engine updated to 7.8.

UDFs:

- Fixed #495: _GUICtrlTreeView_GetTree returns only 1 parent

- Added: _WinAPI_CreatePen, _WinAPI_DrawLine, _WinAPI_LineTo, _WinAPI_MoveTo, _WinAPI_GetBkMode, _WinAPI_SetBkMode (Zedna)

- Fixed #503: _Date_Time_FileTimeToLocalFileTime example (cbruce)

- Added: _ArrayCombinations, _ArrayPermute, _ArrayUnique (litlmike)

- Fixed #510: _GUICtrlListView_ClickItem: If columns inside listview exceed visible area, clicks outside of the control

- Added: _GDIPlus_ImageGetFlags, _GDIPlus_ImageGetHorizontalResolution, _GDIPlus_ImageGetPixelFormat, _GDIPlus_ImageGetRawFormat

_GDIPlus_ImageGetType, _GDIPlus_ImageGetVerticalResolution (rover)

- Added: _PathGetRelative (wraithdu)

- Fixed #500: _ChooseColor run on 64bit

- Fixed #517: WinAPI UDF - bad error checking after DllCall()

- Added: _WinAPI_CombineRgn, _WinAPI_CreateRectRgn, _WinAPI_CreateRoundRectRgn, _WinAPI_SetWindowRgn (Zedna)

- Fixed #533: Array functions dimension check

- Fixed: various Timer Functions

- Fixed #506: _FileCountLines deal with all common line-end-chars

- Fixed #485: WinAPI missing related links in helpfile

- Fixed #571: return value doc for _GUICtrlListBox_FindString, _GUICtrlListBox_GetAnchorIndex and _GUICtrlListBox_GetText

- Fixed #586: _GuiCtrlListView_SetGroupInfo() destroyed group ID's.

- Fixed #516: _ChooseFont run on 64bit

- Fixed #595: _WinAPI_SetWindowsHookEx help file description of $WH_KEYBOARD_LL

Posted

I can't use the new AutoItX dll with Inno Setup since its been converted to Unicode, so I'm stuck at using AutoItX 3.2.12.1. Will you add the Ansi dll prototypes back in?

Posted (edited)

I think I found an issue with the new beta version (3.2.13.8). The error concerns the FileOpen() function. Writing a unicode file is no longer working correctly.

A quick example:

CODE
Local $hFile = FileOpen(@DesktopDir & "\textfile.txt", 2 + 32)

FileWriteLine($hFile, "Hello world" & @CRLF)

FileClose($hFile)

Should create these binary contents:

CODE
FF FE 48 00 65 00 6C 00 6C 00 6F 00 20 00 77 00 6F 00 72 00 6C 00 64 00 0D 00 0A 00

But 3.2.13.8 doesn't. It creates:

CODE
48 65 6C 6C 6F 20 77 6F 72 6C 64 0D 0A

Update: It does work when I specify 1 + 32.

Edited by markloman
  • Administrators
Posted

http://www.autoitscript.com/autoit3/files/beta/autoit

3.2.13.9 (12th October, 2008) (Beta)

AutoIt:

- Fixed #601: Tooltip return 0 when title length >99.

- Fixed #608: listView GUICtrlSetBkColor not redrawn.

- Fixed: Regression in writing Unicode files introduced in 3.2.13.8.

UDFs:

- Fixed #600: _ArraySearch fails with 2D array.

- Fixed #603: _FileReadToArray() does not return an array if the file contains only a single line of text.

  • 4 weeks later...
  • Administrators
Posted

http://www.autoitscript.com/autoit3/files/beta/autoit

3.2.13.10 (8th November, 2008) (Beta)

AutoIt:

- Added #407: Documented that For...In loops are read-only.

- Added #645: IniDelete() now supports the Default keyword for the 3rd parameter.

- Fixed #628: GuiCtrlRead($ctxmenu, $adv) bad return (Saunders)

- Fixed #640: PCRE does not support \L, \l, \N, \U, or \u : doc updated

- Fixed: StringToASCIIArray() crash (Part of issue #596).

- Fixed #642: Installer now correctly opens the merged helpfile to the history page instead of the AutoIt-only helpfile.

- Fixed #646: Call() now sets specific @error and @extended values when it fails to find a function.

- Changed: Documented StringToASCIIArray() and StringFromASCIIArray() use UNICODE codes (Part of issue #596)

AutoItX:

- Fixed: multiple unicode related problems introduced in a previous beta.

UDFs:

- Added: _StringExplode() (WeaponX)

- Fixed #610: _WinAPI_CreateFile() wrong return value upon failure

- Fixed #619: _GUICtrlListView_SetItemSelected memory allocation

- Fixed #617: corrections to six GDI+ ImageGet help file examples

- Fixed #621: _StringAddThousandsSep don't work with negative number

- Fixed #635: _GuiCtrlTab_ClickTab() docs list unused $fPopupScan parameter

- Fixed #650: Missing BorderConstants.au3

- Fixed #656: _FileCountLines returns 0 if file only contains 1 line

- Changed: _Soundxxxx functions (RazerM)

- Changed #599: _FileListToArray speed optimization (code65536)

- Changed: _SQLite 3.5.9 -> 3.6.4.

  • 2 weeks later...
  • Administrators
Posted

http://www.autoitscript.com/autoit3/files/beta/autoit

3.2.13.11 (17th November, 2008) (Beta)

AutoIt:

- Fixed #669: Typo in Dec() example.

- Fixed #659: Documented that UNC paths are not supported when using FileSelectFolder().

- Fixed #671: Crash when using $WS_EX_MDICHILD without specifying a valid parent.

AutoItX:

- Added: COM: WinList method.

- Fixed: Native DLL: Return strings were sometimes incorrectly terminated.

- Fixed: PixelChecksum() not returning correct values.

UDFs:

- Fixed #674: _GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True

- Updated: _SQLite 3.6.4 -> 3.6.5

- Updated #442: _StringAddThousandsSep() allows for regional settings

Note: I also added experimental support for COM BYTE arrays as in #50. I'd appreciate it if anyone who looked at this before could do so again.

  • 3 weeks later...
  • Administrators
Posted

http://www.autoitscript.com/autoit3/files/beta/autoit

3.2.13.12 (9th December, 2008) (Beta)

AutoIt:

- Changed #596: StringFromASCIIArray() and StringToASCIIArray() now correctly handle embedded terminators. Also, StringToASCIIArray() no longer inserts a trailing 0 into arrays.

- Fixed: Crash when using BinaryToString() with invalid UTF16 input string. BinaryToString() now has new @error codes to support diagnosing invalid input.

- Fixed: ControlGetText() regression from last beta.

- Updated: Shutdown documentation.

UDFs:

- Added: _GDIPlus_StringFormatSetAlign (monoceres)

- Updated: StringAddThousandsSep params in regards to #442

- Updated: _SQLite 3.6.5 -> 3.6.6.2

- Updated #733: Doc for _GUICtrlButton_SetImageList

- Fixed #693: _DateTimeFormat() time format

- Fixed #701: _GUICtrlListView_ClickItem() Clicks in the wrong place when $fMove = True

- Fixed #700: _GUICtrlTreeView_ClickItem() Clicks in the wrong place when $fMove = True

- Fixed #703: _GUICtrlListBox_ClickItem() Clicks in the wrong place when $fMove = True

- Fixed #705: _GUICtrlToolbar_ClickButton() Clicks in the wrong place when $fMove = True

- Fixed #707: _GUICtrlMonthCal_Create() width and height

Posted

Hello all,

I may be doing something wrong here ... was hoping somebody could explain this to me. I downloaded the last couple of Beta versions, including the one from yesterday (12/9), and I cannot get AutoIt to recognize StringToASCIIArray($string) as a function. This is even the case when I open the help script from the example file. It presents the same error - "undefined function." Am I doing something wrong or is that function mal-functioning?

- Respectfully,

JFish

P.S> Thank you for all your work with the application and all these new features.

http://www.autoitscript.com/autoit3/files/beta/autoit

3.2.13.12 (9th December, 2008) (Beta)

AutoIt:

- Changed #596: StringFromASCIIArray() and StringToASCIIArray() now correctly handle embedded terminators. Also, StringToASCIIArray() no longer inserts a trailing 0 into arrays.

- Fixed: Crash when using BinaryToString() with invalid UTF16 input string. BinaryToString() now has new @error codes to support diagnosing invalid input.

- Fixed: ControlGetText() regression from last beta.

- Updated: Shutdown documentation.

UDFs:

- Added: _GDIPlus_StringFormatSetAlign (monoceres)

- Updated: StringAddThousandsSep params in regards to #442

- Updated: _SQLite 3.6.5 -> 3.6.6.2

- Updated #733: Doc for _GUICtrlButton_SetImageList

- Fixed #693: _DateTimeFormat() time format

- Fixed #701: _GUICtrlListView_ClickItem() Clicks in the wrong place when $fMove = True

- Fixed #700: _GUICtrlTreeView_ClickItem() Clicks in the wrong place when $fMove = True

- Fixed #703: _GUICtrlListBox_ClickItem() Clicks in the wrong place when $fMove = True

- Fixed #705: _GUICtrlToolbar_ClickButton() Clicks in the wrong place when $fMove = True

- Fixed #707: _GUICtrlMonthCal_Create() width and height

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Posted

I used the installshield to install the Beta version. That is how I had access to the function from the example folder. I also opted to uninstall the previous Beta version as part of the process. Do I need to follow a different procedure to uninstall everything and start over?

Clearly you aren't running the beta version.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Posted

I used the installshield to install the Beta version. That is how I had access to the function from the example folder. I also opted to uninstall the previous Beta version as part of the process. Do I need to follow a different procedure to uninstall everything and start over?

If you're using Scite to test the scripts don't use F5 to start the script but ALT+F5. F5 is for production, ALT+F5 is for BETA. Otherwise if you're starting it manually you have to first switch autoit to beta by going to AutoItv3 in Start Menu -> Beta and Toggle au3 beta.

My little company: Evotec (PL version: Evotec)

Posted

Thank you very much for the info. One more question: Is there anything special that needs to happen when it compiled? I intend to create an executable using this function.

If you're using Scite to test the scripts don't use F5 to start the script but ALT+F5. F5 is for production, ALT+F5 is for BETA. Otherwise if you're starting it manually you have to first switch autoit to beta by going to AutoItv3 in Start Menu -> Beta and Toggle au3 beta.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Posted

I used the installshield to install the Beta version.

<pedantic>No you didn't, you used NSIS which is the installer we use.</pedantic>

That is how I had access to the function from the example folder. I also opted to uninstall the previous Beta version as part of the process. Do I need to follow a different procedure to uninstall everything and start over?

Installing is one thing, running is another. The beta is not set to the default version when you install it. You must run it explicitly. Just running a script via the shell context menu is not sufficient to run it under the beta. MadBoy has provided some advice on how to invoke the beta from SciTE4AutoIt. Alternatively you can run AutoIt directly from the Beta Start Menu entry.
Posted (edited)

Regarding ticket #92 (DllStructGetData() truncation), it's caused a bit of unexpected (to me) behavior. See the following snippet of code (adapted from DllStructTrunc.au3):

Local Const $sSource = "12345678" 
Local $p_VS_String = DllStructCreate("wchar   szKey[8]" ) 
DllStructSetData($p_VS_String,"szKey", $sSource) 
MsgBox(4096, "", "Expected:" & @TAB & $sSource & @CRLF & "Received:" & @TAB & DllStructGetData($p_VS_String,"szKey"))

Local $sOverwrite = "123"

; "Broken"
DllStructSetData($p_VS_String,"szKey", $sOverwrite)
MsgBox(4096, "", "Expected:" & @TAB & $sOverwrite & @CRLF & "Received:" & @TAB & DllStructGetData($p_VS_String,"szKey"))

; "Fixed"
DllStructSetData($p_VS_String,"szKey", $sOverwrite & BinaryToString(Binary("0x00")))
MsgBox(4096, "", "Expected:" & @TAB & $sOverwrite & @CRLF & "Received:" & @TAB & DllStructGetData($p_VS_String,"szKey"))

Essentially, I'm wondering if it's now a requirement that we manually insert a null terminator when we overwrite a previous string in a DllStruct. Is this the intended/expected behavior?

Edited by -Ultima-

[ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ]

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...