ShareX / ShareX

ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
https://getsharex.com
GNU General Public License v3.0
28.73k stars 3.14k forks source link

Action not working - Capture rectangle region with window #31

Closed Maximus5 closed 10 years ago

Maximus5 commented 10 years ago

I'm using two hotkeys, and they activates ShareX normally. 2014-01-02_17-49-33

The problem is that ShareX won't detect windows. At all. 2014-01-02_17-49-33-broken

The only "Window" ShareX "can" see - is Task bar. That behavior begins several time ago, and I don't know what happens.

Jaex commented 10 years ago

I'm not sure what is wrong too. Can you try to open ShareX as administrator and try again. If it was working before and suddenly started not working then it is weird. Because i don't think then it is to do with codes otherwise it would not work before too. Is it not recognize specific windows or all of them? Like is it works for ShareX main window?

Maximus5 commented 10 years ago

Yes, I've tried "As administrator". Problem persists. Seems like all windows has same problem. Notepad, Chome, console, taskmanager, VS, and so on... ShareX main window is not recognized too. Really strange... 2014-01-05_22-25-19

Maximus5 commented 10 years ago

Trying to build ShareX from sources, and get following errors

... 3>------ Rebuild All started: Project: HistoryLib, Configuration: Debug Any CPU ------ 3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3258: The primary reference "T:\VCProject\Externals\ShareX\bin\Debug\HelpersLib.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. 3>T:\VCProject\Externals\ShareX\HistoryLib\ImageHistoryForm.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\UserControls\ObjectListView.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\UserControls\ObjectListView.cs(33,35,33,45): error CS0246: The type or namespace name 'MyListView' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\HistoryForm.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\HistoryItemManager.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\HistoryManager.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\XMLManagerOld.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\XMLManager.cs(26,7,26,17): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\HistoryForm.Designer.cs(348,17,348,27): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) 3>T:\VCProject\Externals\ShareX\HistoryLib\HistoryForm.Designer.cs(365,17,365,27): error CS0246: The type or namespace name 'HelpersLib' could not be found (are you missing a using directive or an assembly reference?) ========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

Am I need to change something?

Jaex commented 10 years ago

You don't need to change something for be able to compile it normally. Now i searched all csproj files for "4.0" and there isn't any reference to 4.0 .net framework.

Maximus5 commented 10 years ago

Hmm. Killed full directory and cloned from your repository. Open ShareX.sln in Visual Studio 2013 for Windows Desktop. Still failed to compile. Full log here: http://pastebin.com/CUjEM8He Release or Debug configuration - does not matter.

Jaex commented 10 years ago

I downloaded latest revision from here: https://github.com/ShareX/ShareX/archive/master.zip and opened ShareX.sln file and pressed compile button and it successfully compiled. So i'm not sure why you getting these errors. Can you compile any other .NET 3.5 project without problem?

Maximus5 commented 10 years ago

Really strange. GreenshotImageEditor and HelpersLib projects from your solution compiles normally, but others... fails. What Studio version you are using personally?

Jaex commented 10 years ago

Visual Studio Ultimate 2013

Maximus5 commented 10 years ago

Some more info about the problem. ShareX CAN detect only windows with "AlwaysOnTop" flag.

Jaex commented 10 years ago

https://github.com/ShareX/ShareX/blob/master/ScreenCaptureLib/WindowsListAdvanced.cs

I'm not adding rectangles which is behind another rectangle which means not visible rectangles on screen because it is behind something but look like your desktop is somehow in front of everything and therefore every other rectangles not added to list in GetWindowsRectangleList method. Desktop should be behind everything else normally so not sure what is different in your pc.

Maximus5 commented 10 years ago

Nope, I think ShareX fails not on Desktop. There is a window with class name "AVP.SandboxWindow" (antiviral program). Yep, its rectangle is equal to full desktop, BUT it is fully transparent. Its extended windows styles has WS_EX_TRANSPARENT (0x000800A8 actually). And I can say, that Microsoft Spy does not trap on it. Would be nice, if ShareX skips such windows in the detection process.

Jaex commented 10 years ago

I can't skip if window have ex_transparent because that window can have non transparent pixels on window.

Maximus5 commented 10 years ago

But that exact window covers full screen. Another thought, even some pixels are non transparent, you can't be sure that ALL window pixels needs to be captured. Even it was intended to be captured by user... I think, full-screen windows must be skipped in any case, because if user want to capture fullscreen - one can point it (on screen edges for example), or use special hotkey for fullscreen capture. Yeah?

Jaex commented 10 years ago

Then when you have fullscreen app on screen and when you hover with cursor you will see rectangles behind it when there was not window visible there. And having fullscreen real app is far more high likely than that invisible antivirus window so i prefer to not disable current behavior. What is point of your anti virus making fullscreen topmost transparent window anyway?

Maximus5 commented 10 years ago

Well, another argument. If you are running fullscreen app, where will be the focus? I believe in that fullscreen app. But when something transparent covers full screen - the focus is in the another app. This is the key difference. And I think you may skip that invisible window.

As about this exact window behavior. I'm not sure, not an author ;) Seems like it paints borders around sand-boxed windows.

McoreD commented 10 years ago

Have you tried selecting Windows & Rectangle instead of Rectangle in Hotkey settings?

On 6 January 2014 02:05, Maximus5 notifications@github.com wrote:

I'm using two hotkeys, and they activates ShareX normally. [image: 2014-01-02_17-49-33]https://f.cloud.github.com/assets/1222388/1847081/89d1915c-7633-11e3-98a8-e70941990917.png

The problem is that ShareX won't detect windows. At all. [image: 2014-01-02_17-49-33-broken]https://f.cloud.github.com/assets/1222388/1847085/b04c9f48-7633-11e3-9a22-b2b8c78c1941.jpg

The only "Window" ShareX "can" see - is Task bar. That behavior begins several time ago, and I don't know what happens.

— Reply to this email directly or view it on GitHubhttps://github.com/ShareX/ShareX/issues/31 .

Maximus5 commented 10 years ago

Where you can find "Windows & Rectangle"? 2014-01-07_02-17-07

McoreD commented 10 years ago

Hi Maximus5, thanks for posting the screenshot. I just wanted to confirm that simple setting. You have the right setting there (although it should be called Capture rectangle region or window).

On 7 January 2014 06:18, Maximus5 notifications@github.com wrote:

Where you can find "Windows & Rectangle"? [image: 2014-01-07_02-17-07]https://f.cloud.github.com/assets/1222388/1854694/62656768-7720-11e3-9488-5b17e2b755c8.png

— Reply to this email directly or view it on GitHubhttps://github.com/ShareX/ShareX/issues/31#issuecomment-31693486 .