Old news but worth noting Graphics.FromHwnd and Spy++
-
I went looking for a resolution to a small problem with using Graphics.FromHwnd and getting an OutOfMemory Exception. It turns out if the handle number that is entered is invalid, then this exception is thrown. If you are using Spy++ to retrieve handle numbers keep in mind that these numbers are in Hex and need to be converted to base 10 format if you want this to work or try something like this TryParse statement to convert the Hexadecimal numbers for you.
int.TryParse(textBox1.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out _int)
nothing
-
I went looking for a resolution to a small problem with using Graphics.FromHwnd and getting an OutOfMemory Exception. It turns out if the handle number that is entered is invalid, then this exception is thrown. If you are using Spy++ to retrieve handle numbers keep in mind that these numbers are in Hex and need to be converted to base 10 format if you want this to work or try something like this TryParse statement to convert the Hexadecimal numbers for you.
int.TryParse(textBox1.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out _int)
nothing
What does this have to do in the lounge?
Regards, mav -- Black holes are the places where God divided by 0...
-
What does this have to do in the lounge?
Regards, mav -- Black holes are the places where God divided by 0...
...ignoring the fact that it is pretty obvious anyway...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
I went looking for a resolution to a small problem with using Graphics.FromHwnd and getting an OutOfMemory Exception. It turns out if the handle number that is entered is invalid, then this exception is thrown. If you are using Spy++ to retrieve handle numbers keep in mind that these numbers are in Hex and need to be converted to base 10 format if you want this to work or try something like this TryParse statement to convert the Hexadecimal numbers for you.
int.TryParse(textBox1.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out _int)
nothing
If you have something like this that you feel worth passing on to other members, you should do so at Tips/Tricks[^].
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
-
What does this have to do in the lounge?
Regards, mav -- Black holes are the places where God divided by 0...
mav.northwind wrote:
What does this have to do in the lounge?
It's got words in it. What do I win?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997