Short answer:
Yes! you can!
Long Answer:
Since at least 2018, you have been able to do it. This is not a new thing!
There is a way to take screenshots of any window even when Windows is locked, by using an AutoIt script. I have been using this method for years now. It is possible that AHK also has a similar way of doing it. Here is the code for the AutoIt script that you can use to take screenshots of any window.
; #FUNCTION# ====================================================================================================================
; Author ........: Paul Campbell (PaulIA)
; Modified.......: chimp
;
; modified version of the _ScreenCapture_CaptureWnd() function
; It uses the _WinAPI_PrintWindow() to capture the window
; it should work also with screen locked
; -------------
; ===============================================================================================================================
Func _ScreenCapture_CaptureWnd_mod($sFilename, $hWin, $bCursor = True)
Local $bRet = False
Local $iSize = WinGetPos($hWin)
Local $iW = $iSize[2]
Local $iH = $iSize[3]
Local $hWnd = _WinAPI_GetDesktopWindow()
Local $hDDC = _WinAPI_GetDC($hWnd)
Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC)
Local $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iW, $iH)
; $hCDC Identifies the device context
; $hBMP Identifies the object to be selected
_WinAPI_SelectObject($hCDC, $hBMP)
_WinAPI_PrintWindow($hWin, $hCDC)
If $bCursor Then
Local $aCursor = _WinAPI_GetCursorInfo()
If Not @error And $aCursor[1] Then
$bCursor = True ; Cursor info was found.
Local $hIcon = _WinAPI_CopyIcon($aCursor[2])
Local $aIcon = _WinAPI_GetIconInfo($hIcon)
If Not @error Then
_WinAPI_DeleteObject($aIcon[4]) ; delete bitmap mask return by _WinAPI_GetIconInfo()
If $aIcon[5] <> 0 Then _WinAPI_DeleteObject($aIcon[5]) ; delete bitmap hbmColor return by _WinAPI_GetIconInfo()
_WinAPI_DrawIcon($hCDC, $aCursor[3] - $aIcon[2] - $iSize[0], $aCursor[4] - $aIcon[3] - $iSize[1], $hIcon)
EndIf
_WinAPI_DestroyIcon($hIcon)
EndIf
EndIf
_WinAPI_ReleaseDC($hWnd, $hDDC)
_WinAPI_DeleteDC($hCDC)
If $sFilename = "" Then Return $hBMP
$bRet = _ScreenCapture_SaveImage($sFilename, $hBMP, True)
Return SetError(@error, @extended, $bRet)
EndFunc ;==>_ScreenCapture_CaptureWnd_mod
The _ScreenCapture_CaptureWnd_mod
function only requires the filename and the window handler of the desired app. Examples and discussions can be found in the source link provided at the end of this post.
The source: Capturing screenshots while computer is locked