Custom Query

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (1 - 3 of 3856)

1 2 3 4 5 6 7 8 9 10 11
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
#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)

#3993 No Bug _WinAPI_SetWindowTheme() - remove limits argumentum
Description

Trying to change a color on a checkbox control I needed to remove the theme and found the limitation on the implementation of the wrapper. The request is to remove the "string or null, only" from the func., as zero is the value that is needed in this case.

#include <WinAPITheme.au3>
Test()
Func Test()
	GUICreate(@ScriptName)

	GUICtrlCreateCheckbox("one", 10, 10, 200)

	GUICtrlCreateCheckbox("two", 10, 30, 200)
	GUICtrlSetColor(-1, 0xFF00FF)

	GUICtrlCreateCheckbox("three", 10, 50, 200)
	_WinAPI_SetWindowTheme(GUICtrlGetHandle(-1)) ;, 0, 0)
	GUICtrlSetColor(-1, 0xFF00FF)

	GUICtrlCreateCheckbox("Four", 10, 70, 200)
	_WinAPI_SetWindowTheme_mod(GUICtrlGetHandle(-1)) ;, 0, 0)
	GUICtrlSetColor(-1, 0xFF00FF)

	GUISetState()
	While GUIGetMsg() <> -3
	WEnd
	GUIDelete()
EndFunc

Func _WinAPI_SetWindowTheme_mod($hWnd, $sName = Default, $sList = Default) ; #include <WinAPITheme.au3>
;~ 	If Not IsString($sName) Then $sName = Null ; <-- this limits what can get done with it.
;~ 	If Not IsString($sList) Then $sList = Null ; also, don't ask me why "Default" works !, I was going to use 0

	Local $sResult = DllCall('UxTheme.dll', 'long', 'SetWindowTheme', 'hwnd', $hWnd, 'wstr', $sName, 'wstr', $sList)
	If @error Then Return SetError(@error, @extended, 0)
	If $sResult[0] Then Return SetError(10, $sResult[0], 0)
	Return 1
EndFunc   ;==>_WinAPI_SetWindowTheme
1 2 3 4 5 6 7 8 9 10 11
Note: See TracQuery for help on using queries.