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..."

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...