Screentogif: Snap to Window, doesnt capture whole windows or dialogs

Created on 17 Apr 2017  路  17Comments  路  Source: NickeManarin/ScreenToGif

This has been a problem for many versions, Snap is essentially broken you cant select a whole Window or dialog only the inner portions of either, so if capture involves these parts they are left out.

Only way to get the whole area is by manually expanding ScreenToGif capture area.

ScreenToGif version: 2.7.1
OS: Windows 7 Ultimate Sp1 / Windows 10 1607 / 1703

Captures of problem.

Snap to whole dialog - Mission impossible 1
solve

Snap to whole Window - Mission Impossible 2
solve2

Good capture examples - Expected area snap should snap to.

These were captured with Snipping tool to illustrate the expected areas of dialogs / windows to be captured by snap.

Dialog
solve

Window
solve2

馃悶 bug

Most helpful comment

I think I figured out what's going on.

You're creating it in the context of the window the mouse is over, which has a clipping zone around itself, not including the title bar.

Maybe create the rectangles in the context of the screen2gif window so it isn't clipped?

( I've never used VS before, this was just from a quick look around and google )

All 17 comments

Oh, it's a problem with the rectangle that for some reason fails to be painted on top of the window chrome/border.

I tested with W10 1607, the app snaps to the entire window, just the rectangle that does not show.

But I realized that I can improve the snapping region, expand a little bit to fit the whole window + border.

lol

Ah right you are, so that is the actual issue, because I didnt see a painted area around the desired Windows/Dialog complete area, naturally assumed that it wasnt being selected.

As an offtopic: see https://www.windows10forums.com/threads/screentogif-if-a-picture-speaks-1000-words-a-sequence-speaks-volumes.12790/

Actually there seems to be a bigger issue at least here.

I was just trying to capture my NIC properties dialog via snap and it will definetly not snap.

ugh

the only way was manually

pattermatch

Indeed, just tested.
Is it a window opened with admin rights? It looks like it's not working with any window like that.

No admin rights on that one, there wasnt even UAC prompt.

Alright, it looks like I'm not able to get any MouseUp/MouseDown events while the cursor is on top of windows opened with admin rights (the adapter properties window follows the same rule, it just doesn't show any UAC dialog, you can see by the shield icon of the context menu)

image

So, in order to work, I had to make a little hack. For that kind of window, the Snap To Window will only work after you release the mouse button AND move the cursor after that.

Also I adjusted the region of snap, it will show the border of the window.

This fix will be available for v2.7.2 or v2.8.0.

Thanks for the feedback.

No problem, and thank you for the fix. will be looking forward to see it.

@NickeManarin
The visual bug is still happening ( Doesn't have admin privileges ):
gif 1

Looks alright. The small offset will not be recorded.

Sorry, I meant it doesn't show around the edge of the window when I hover over the top bar

Oh, that I could not fix... I'm not sure why. I'm using the a Windows API to draw the rectangle.

Very weird :(

I think I figured out what's going on.

You're creating it in the context of the window the mouse is over, which has a clipping zone around itself, not including the title bar.

Maybe create the rectangles in the context of the screen2gif window so it isn't clipped?

( I've never used VS before, this was just from a quick look around and google )

Working code snippet:
Change line 769 of Native to var hdc = GetWindowDC((IntPtr) null);
Remove line 775 of Native

Seems to cause a lot of lag when moving the mouse around though, No idea if that's because I'm running it from VS?

Also thanks to that fix I noticed you can select Screen2Gifs window.. Not sure if that's a bug?

Awesome, thanks. Which line exactly to remove? Looks like we have different source codes...

Yeah, it lags because of the MouseHook, the listener that capture mouse inputs outside the app. When running from the VS, it will lag a lot.

Indeed a bug.

The OffsetRect(ref rect, -rect.Left, -rect.Top); line as it's now being drawn from the edge of the screen

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tox86 picture Tox86  路  3Comments

duarteframos picture duarteframos  路  3Comments

Mc-muffin picture Mc-muffin  路  4Comments

alphestdev picture alphestdev  路  4Comments

Kristinita picture Kristinita  路  4Comments