artem78 / AutoScreenshot

Automatic screenshot maker
GNU General Public License v3.0
133 stars 22 forks source link

"Invalid Monitor Handle" after changing screen configuration #15

Closed j10k closed 3 years ago

j10k commented 3 years ago

Describe the bug I have set AutoScreenshot to capture a screenshot of all monitors. After switching monitors, e.g. by connecting to a dock, subsequent screenshots fail with "Invalid Monitor Handle". Additionally, the "Used monitor" dropdown in the configuration dialogue is disabled/greyed out and set to "monitor 1". Restart fixes the problem

To Reproduce Steps to reproduce the behavior:

  1. Enable auto capture of all monitors
  2. Change monitor configuration. Note that this does not occur for all changes, even when the same monitors are used
  3. At the next time interval, an error box saying "Invalid Monitor Handle" appears in the background.
  4. Upon opening the config dialog, observe that the Used monitor dropdown is greyed out.

Expected behavior AutoScreenshot should handle changes in the monitor configuration and update the monitor handles after changes.

Screenshots n/a

Version 1.7.1

Additional context Here's my config.ini

[main]
OutputDir=C:\Users\placeholder\Pictures\AutoScreenshots\
ImageFormat=PNG
JPEGQuality=80
ColorDepth=24
Language=en
Monitor=-1
Counter=1824
CounterDigits=6
FileNameTemplate=%Y-%M-%D\%H.%N.%S
StopWhenInactive=1
StartCaptureOnStartUp=1
StartMinimized=1
AutoRun=1
artem78 commented 3 years ago

Can't reproduce on Notebook with Windows 7 and plugged additional monitor. I tried:

Could you please describe your monitor configuaration and what action causes a problem? Take screenshots and maybe video also may be useful.

I only saw that program doesn't update listbox when monitor configuration has been changed.

artem78 commented 3 years ago

Fixed in v1.8

j10k commented 3 years ago

Thank you! I was wondering how to provide debug information, and will reopen this issue if it persists.

j10k commented 3 years ago

Hi, unfortunately the issue is only partially fixed for me (not sure whether to reopen the issue here or open a new one): I have set AutoScreenshot to screenshot all monitors. After changing the display configuration, however, the configuration reverts to "primary monitor". Steps to reproduce:

  1. Have two displays. Set AutoScreenshot to "all monitors". Take a screenshot.
  2. Disconnect second display. AutoScreenshot shows disabled display dropdown set to "all monitors". Take a screenshot.
  3. Reconnect second display. AutoScreenshot shows enabled display dropdown set to "Monitor 1 - primary".

Expected Behavior: Keep screenshotting all monitors.

artem78 commented 3 years ago

not sure whether to reopen the issue here or open a new one

It will be better to create new one.

artem78 commented 3 years ago

After changing the display configuration, however, the configuration reverts to "primary monitor".

You can change it manually.

artem78 commented 3 years ago

I fixed behavior. Check this build: AutoScreenshot 78c826a7 test build.zip

j10k commented 3 years ago

I can confirm that this issue is fixed. Thank you!

artem78 commented 3 years ago

Added in 1.8.1 release