My.Computer.Keyboard.SendKeys(Keys.PrintScreen, True) - vb.net

I am attempting to send the PrintScreen key, obviously, which ought to work no matter the window it is focused on. How can I make this trigger the printscreen action like it normally would? This is in VB.net. Thanks for the help!
I have googled this, and couldn't find any results that worked.
EDIT: Somehow, this worked, once. But now it is not working at all!

I would guess that your EDIT note about a successful attempt is actually just that you had manually hit PRNTSCRN previously and that your clipboard still had it in there when you ran you program, which put nothing in the clipboard, but then read your manually taken screenshot out again.
Your approach to get a snapshot of the screen won't work - you have to use some pinvoke stuff, which isn't that hard to piece together if you're patient. http://www.pinvoke.net/ is a great resource.
OOO, and I have never tried this, but this article seems confidently written. http://www.dreamincode.net/code/snippet2572.htm

Related

Notes 9 crashes while editing external email

We have a customized mail template where we can set values of a parameter in mail preference.
After getting upgraded to Notes 9, when the parameter is set to Automatic it's working fine, but when another value is selected below thing happens (It was working fine in previous versions of Notes..):
After opening any external email, after double clicking on the mail body to edit.. notes is getting crashed.
I have two questions :
I see for external emails the control is going from querymodechange to queryclose while editing. Does it always happen?
I debugged the whole thing. Surprisingly it works in debug mode..no notes crash!!
Any help would be much appreciated !!!
This is why customizing the mail template is rarely recommended. There are interactions and dependencies between the code in the template and the Notes client, and it's very hard to debug. Since you haven't shown any of your customized code, I don't think anybody is going to be able to help you. I would recommend removing your customization code one piece at a time until it no longer crashes. Then you'll have an idea of what's triggering it, and you can try a different approach.
When Notes crashes, it dumps some diagnostics in the data/IBM_TECHNICAL_SUPPORT directory, notably the file console.log
You could review it and post here the lines pertaining to the crash.
Also, what was the previous version of Notes ?
To target the offending code line, you can use that old, dirty and tedious trick : add the folling line at the top of the QueryClose event, and move it down until you no longer see the result. Then post the context.
print now & "so far so good"

Form designer only shows the form in vb.net

I was working at the forms designer and yesterday the designer literally only showed the form. Tried copying the .designer.vb to another new form and the same thing happened. Also when built it just shows what the designer shows. Compare the two versions:
(Had to use pastebin as the code is too long for a post, and it rejects my post if more than two links are used.)
Current code: pastebin.com/SsgR7YWD
Current form view:
Previous code: pastebin.com/bXCL3jhH
Previous screenshot:
Why it is not showing the controls? I know it is a long piece of designer code but I can't find where the error comes from.
I've just run your code through this site that compares to blocks of text and shows the differences - there's a lot - you might want to do the same and have a look at the differences. It may be easier to delete the form and start again to be honest. Having said that, you might be able to spot what went wrong
You should just delete the form and start again. A few tips to having a better UI ---
Use layout grids for the button-checkboxes and let the buttons occupy the whole horizontal space.
And remember to backup your code often so that things like this won't happen again - use something like GitHub and commit your files whenever your day is finished.
Happy coding!

Stop execution in smalltalk

I´d like to know how can I stop execution in smalltalk. I entered an infinite loop and don´t want to loose the code that´s written. I tried using pause button but doesn´t seem to be right.
Normally, even if you are unable to stop execution, you should be able to get the code changes you made back from the .changes file. If you can restart the image, there is a 'recover lost changes' menu entry. Always first make a backup copy of the changes and image files before trying this. (In Pharo/Squeak. Other smalltalk have similar possibilities)
it depends on the dialect and possibly keyboard settings.
try CMD-. or CTRL-., which works in most dialects.

VB.NET - Form is stuck

I have written a program and have used it (in debug mode) multiple times to test it out sometimes adding code and/or changing it. After a while any code I wrote or new buttons or features I added to the form would not appear while debugging. I don't know what circumstances led to this.
The only solution I found was to rewrite my code from scratch, however, the problem came back after a while. I don't know what is going on and I can't move on without starting all over again.
Thanks for all the help.
try rebuilding your entire solution, I believe to do this you must right-click on the project and there should be a menu option that says "rebuild solution". Try that.

How to prevent multiple clicks generating multiple NSOperations

I used Marcus Zarra's excellent advice on how to do async downloads using NSURLConnection and NSOperation. I have tied a button press to that NSOperationg.
Question is: how do I prevent the user from spamming the button and shooting off many NSOperations doing the same download over and over again.
I have two concerns:
a) Setting a global variable is probably not a good idea. What happens if the app is suspended with the flag on?
b) Disabling the button upon the first click is probably a bad idea too. If something goes wrong with my code, the button might stay disabled.
I don't really understand what happens if the app is suspened mid-operation, but mostly I'd like to know the "philosophy" of going about this.
I think most ios apps that consume webservices have this exact same problem, but I don't know what's best practice.
Thank you. I looked and this doesn't seem to be a dupe. If it is, I apologize.
One approach is to show a "loading view" which will cover all of the buttons and give information to the user that something is happening. This has the same problems as disabling the button though: you need to make sure you remove it on completion of the operation, or replace it with an appropriate message if something goes wrong