Custom Query (3931 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (70 - 72 of 3931)

Ticket Resolution Summary Owner Reporter
#3997 Completed Improvement of _WinAPI_RegisterShellHookWindow example Jpm YuTang
Description

Link:https://www.autoitscript.com/autoit3/files/beta/autoit/docs/libfunctions/_WinAPI_RegisterShellHookWindow.htm

Quote only Switch statement from the example:

Local $sTitle = WinGetTitle($lParam)
Switch $wParam
        Case $HSHELL_REDRAW
                If IsString($sTitle) Then
                        ConsoleWrite('Redrawn: ' & $sTitle & @CRLF)
                EndIf
        Case Else
                If BitAND($wParam, $HSHELL_WINDOWACTIVATED) = $HSHELL_WINDOWACTIVATED And IsString($sTitle) Then
                        ConsoleWrite('Activated: ' & $sTitle & @CRLF)
                        ConsoleWrite("    $wParam: " & $wParam & @CRLF)
                EndIf
EndSwitch

The above case-else statement seems a bit misleading. Windows Hook Types are not for bit flag, just sequential integers. So BitAND($wParam, $HSHELL_WINDOWACTIVATED) matches not only HSHELL_WINDOWACTIVATED(4) but also HSHELL_GETMINRECT(5), HSHELL_APPCOMMAND(12), HSHELL_WINDOWREPLACED(13) and more. When I tried to run this example with SciTE, I got 'Activated' outputs twice if I clicked window minimize button. One for real activating and one for minimizing. In addition, IsString($sTitle) returns always True because WinGetTitle function returns a window title (on success) or "" (on failure).

The below changes seems worked well for me.

        Case $HSHELL_WINDOWACTIVATED, $HSHELL_RUDEAPPACTIVATED
#3996 No Bug Unexpected silent conversion of several AutoIt types when used as keys in maps anonymous
Description

(this applies to all versions from 3.3.15.0 to 3.3.16.1) In maps, when we use a float, a pointer, or a keyword (any of default/null/true/false) as a key, then the following unexpected (i.e. this behaviour is undocumented) conversion happens:

  • floats become ints; eg float 3.14159 becomes int 3
  • pointers/handles become ints as well: Ptr(0xCAFE) becomes int 51966
  • true becomes int 1;
  • any other keyword (default/null/false), and in fact any other type - funcs, maps(!), arrays(!!), dllstructs(!!!), even ur mom(untested...), - all that becomes int 0

What would be the most best, is to allow these additional sensible types to be used as keys. The additional sensible types are of course pointers/handles (i use them all the time when working with windows and GUIs as keys in a map; super useful!), floats, and (in my opinion) keywords.

And at the very least, this should be documented in the helpfile. Thank you for consideration! :)

PS. Well well well.. while researching this bug, i found even more unexpected things! the following snippet works perfectly fine in 3.3.15.0 and 3.3.15.1, but starting from 3.3.15.2 to 3.3.16.1 AutoIt completely crashes on it!

Global $m[], $p1 = ptr(0xCAFE), $p2 = ptr(0xCAFEBABE)
ConsoleWrite('setting Ptr('&$p1&') to 2357' & @CRLF)
$m[$p1] = 2357
ConsoleWrite('retrieving: '&$m[$p1] & @CRLF)
ConsoleWrite('setting Ptr('&$p2&') to 777' & @CRLF)
$m[$p2] = 777
ConsoleWrite('retrieving: '&$m[$p2] & @CRLF)
ConsoleWrite('-----now do the same, but via MapKeys in  For..in..next  loop---------' & @CRLF)
for $key in MapKeys($m)
  ConsoleWrite('key '&VarGetType($key)&' : '& $key & @CRLF)
  ConsoleWrite('data '&VarGetType($m[$key]) &' : '& $m[$key] & @CRLF)
next
#3994 No Bug AutoIT crashes in IsDeclared if $vVar is not declared torchrish@…
Description

#include-once #include <AutoItConstants.au3>

If IsDeclared($vVar) <> $DECLARED_UNKNOWN Then Exit(-1)

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.