Recent Posts

Pages: 1 ... 8 9 [10]
91
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by TouEnMasm on June 26, 2020, 12:24:22 AM »

It's also a tool "Snipping Tool" in the task bar (start button)
92
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by hutch-- on June 25, 2020, 11:56:09 PM »
I just found yet another standard key combination, left side US keyboard SHIFT, Microsoft key and S gives you multiple options at screen, window and freestyle capture.
93
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by hutch-- on June 25, 2020, 11:21:43 PM »
> Weird. How is that possible? How much is the difference to the real dimensions?

Sad to say yes and the bigger the window, the worse it gets. I think its because WindowFromPoint() is broken and performs like ChildWindowFromPoint(). This has wasted an enormous amount of time so I went back to the Clipboard and just used WindowFromPoint() to get the handle of the window to be copied and set it as the active window while performing the capture. I even coded a test piece in 32 bit but the effect was the same.

Interestingly enough the manual CTRL ALT PrintScreen key combination when done manually works every time so there is something happening that is not well known. To make it even stranger, if I start the app from Winfile.exe it all works but if I run the app from the desktop, it fails on some windows.

I imagine there are some security reasons for this type of inter app activity, its just that it is not documented anywhere so its all experimentation.
94
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by jj2007 on June 25, 2020, 10:49:56 PM »
GetWindowRect() grabs a wider area than just the boundaries of the window

Weird. How is that possible? How much is the difference to the real dimensions?
95
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by TouEnMasm on June 25, 2020, 10:44:04 PM »

On windows 10 the windows capture work.... with apllications who don't use the screen capture.
96
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by hutch-- on June 25, 2020, 09:17:26 PM »
Hi Marinus,

The screen capture works fine, its the window capture that I am having problems with. If you have time to test it, click the camera toolbar icon, then click in the client area and drag the mouse to another window and see if it captures it.

This last capacity has been more hassle than you can imagine, works under some conditions but not others.
97
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by Siekmanski on June 25, 2020, 08:13:45 PM »
Win8.1 x64
98
The Laboratory / Re: Screen Capture not using the clipboard.
« Last post by hutch-- on June 25, 2020, 06:10:41 PM »
I have been having a ton of PHUN trying to get a consistent window capture working. Its a toss between getting the keyboard VK_SNAPSHOT working reliably or directly blitting the window content to a compatible bitmap and both have their problems. To set the focus of the window to copy I use WindowFromPoint() but it is broken and performs like ChildWindowFromPoint() which is not exactly what you need in this context as it can get a child window on a main window instead of only the main window.

The next problem is GetWindowRect() grabs a wider area than just the boundaries of the window and you get a left, bottom and right area around the window as well which renders the technique useless.

The keyboard technique produces a better result but only when it works. The key combination CTRL ALT PrintScreen on this version of Win10 64 works fine at capturing a focus window but emulating this key combination only works most of the time and in particular it fails on a regular basis with the old Winfile.exe and is not reliable on the old Winhelp engine.

I have attached the current binary and would appreciate anyone who has the time to test it. It runs OK on my Win7 64 and Win10 64.

This is the screen capture algo that works fine but grabs a larger area than the target window.

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

CaptureWindow proc xWin:QWORD

    LOCAL dDC   :QWORD
    LOCAL cDC   :QWORD
    LOCAL hBmp  :QWORD
    LOCAL hDesk :QWORD
    LOCAL hOld  :QWORD
    LOCAL wScrn :QWORD
    LOCAL hScrn :QWORD
    LOCAL ps    :PAINTSTRUCT
    LOCAL rct   :RECT

    rcall GetWindowRect,xWin,ptr$(rct)

    mov eax, rct.right
    sub eax, rct.left
    mov wScrn, rax

    mov eax, rct.bottom
    sub eax, rct.top
    mov hScrn, rax

    mov hDesk, rvcall(GetDesktopWindow)                             ; get desktop window handle
    rcall BeginPaint,hDesk,ptr$(ps)
    mov dDC, rvcall(GetDC,hDesk)                                    ; get desktop DC

    mov hBmp, rvcall(CreateCompatibleBitmap,dDC,wScrn,hScrn)        ; create a compatible bitmap
    mov cDC, rvcall(CreateCompatibleDC,dDC)                         ; create a compatible DC
    mov hOld, rvcall(SelectObject,cDC,hBmp)                         ; select BMP into compatible DC

    invoke BitBlt,cDC,0,0,wScrn,hScrn,dDC,rct.left,rct.top,SRCCOPY  ; blit window to bitmap

    rcall SelectObject,cDC,hOld                                     ; re-select the old object
    rcall DeleteDC,cDC                                              ; release CompatibleDC
    rcall ReleaseDC,hDesk,dDC                                       ; release desktop DC

    rcall EndPaint,hDesk,ptr$(ps)

    mov rax, hBmp                                                   ; return the bitmap handle

    ret

CaptureWindow endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
99
The Soap Box / Re: Console font cannot be changed
« Last post by jj2007 on June 25, 2020, 12:46:27 PM »
Resolved! I deleted the registry entries at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont, then re-entered them step by step. But I didn't keep track of all steps :sad:

Attached a console app that switches between Lucida Console and Consolas until you press Escape. As Felipe rightly wrote, run as admin if you want the change to be permanent.
100
The Soap Box / Re: Console font cannot be changed
« Last post by hutch-- on June 25, 2020, 09:32:37 AM »
Back in the MS-DOS era, I had a vast collection of raster fonts that you could easily dump into the BIOS that made 16 bit REAL MODE almost look good.  :tongue:
Pages: 1 ... 8 9 [10]