torch - 2023-09-07 10:09 AM
Okay, I clicked the "Capture" Button. First, the dialog box says "Starting", then "Ask Before Saving is Enabled"
Nothing happens after that, no other dialog boxes generate, but the window doesn't disappear at least.
Thank you, unfortunately this sounds like an eVB runtime bug, most likely something to do with the CommandBar. It would make no sense for it to stop there otherwise.
torch - 2023-09-07 10:09 AM
In order with messages. I clicked "Take Screenshot", states screen resolution as 1920x1080, created display drawing contest 8913499, created bitmap info structure, created DIB section on memory DC 9306769, copied screen dc to memory dc, cleaned up drawing elements, created file handle 10298115, image length 6220800, *I clicked enter too soon to see what this dialog box read*, wrote bitmapinfoheader to file, wrote image data to file, closed the file, deleted bitmap object.
Subsequently, the test screenshot saves correctly into the temp folder.
Awesome, good to know that this works fine at least. That's actually great news because it means that the issues you've been seeing are not likely to be related to the code handling the screenshot, but rather due to UI control related issues.
I have attached a version of CaptVB with an alternate UI that offers all of the same options. Could you please test if this works too? If it does, I think what I'll do is make the current interface the 'compact' mode
(it will still be the default
), and then offer an option to switch to the alternate interface if desired. This is actually useful in multiple ways since the alternate interface can be more easily operated with a keyboard
(accelerator keys
), and some people might prefer this over the menu based interface.
I left debug messages enabled just in case we run into anything else. If it works you don't have to go through the trouble of posting the debug output again, I mostly added that for if it was crashing during the screenshot process, but we already figured out that's not the case.
thenzero - 2023-09-11 1:59 AM
I'm using this a lot now and it's great. The one thing I miss from screensnap is having a shortcut key. However, I would not want it if it would sacrifice the small footprint of your app. So, I'd like to offer that as a possible additional feature.
Thank you! If you mean a global hotkey to trigger the screenshot functionality, that would be rather difficult to do in eVB unfortunately, as there's no way to listen for global key press events without using an external component. The other way is polling for it which is very inefficient and not really an option on H/PCs as this will impact general performance of the device.
I tried making it so that you could press the Enter key at the CaptVB window to take a screenshot, but the CommandBar control does not forward keypress events to the form, even with KeyPreview set to True. The alternative interface I made to troubleshoot with @torch should let you do this though.
Edited by WinCEDev 2023-09-13 11:28 PM
Attachments
----------------
CaptVB.vb (59KB - 4 downloads)