PrintWindow and BitBlt of hidden windows

后端 未结 2 1768
遥遥无期
遥遥无期 2020-12-19 13:42

My program is taking screenshots of other application windows to automate some tasks on them. Those windows can be hidden offscreen or obscured by other windows from time to

2条回答
  •  既然无缘
    2020-12-19 14:16

    finally, after some hours of investigation, I found a solution for that issue: It's sufficient to call the following command within the ACTIVATE event of the form to be imaged (example in VB coding):

    Call SetWindowLong(me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED)
    

    Whereas this command is defined as follows:

    Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    
    Private Const GWL_EXSTYLE = (-20)
    
    Private Const WS_EX_LAYERED = &H80000
    

    Please try this!

    Best regards, Bambi66

提交回复
热议问题