Please keep in mind that I 'm testing what is possible and that there is a loot of nonsense in the code
The idea is to hide a window when I'm clicking with the middle mouse button and that I restore through a icon in the system area
Posting it here is hardly the same as comparing it. Your enum-declaration is not a UINT, but defaults to INT. I suggest you use the version from the P/Invoke website, preferably with the same name. Below code works;
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
PrivateFunction ShowWindow(ByVal hwnd AsIntPtr, ByVal nCmdShow As WindowShowStyle) AsBooleanEndFunctionPrivateEnum WindowShowStyle : uint
Hide = 0
Show = 5EndEnumSub Main()
Dim p = Process.Start("calc.exe")
Console.WriteLine("Any key to hide")
Console.WriteLine("Any key to show")
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
Dim height As Double'inches
Dim weight As Double 'pounds
Dim name As String
Dim stats As Appearance
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim personl, person2 As Person
Dim person1 As String = Michael
(missing lines –come from a, b, c, d, & e listed below)
(a) Give person, the name Michael
(b) Set Michael's height and weight to 71 and 190, respectively.
(c) Give person2 the name Jacob.
(d) Set Jacob's height and weight to 70 and 175, respectively.
(e) If one person is both taller and heavier than the other, display a sentence of the form
Does anyone know of a way to throw errors in vb.Net based on the error number? I need to build a list of just that since, as unnbeleivable as it sounds, MS apparently can't provide a table of error codes matched to their descriptions like they did in vb6. If that means they are too numerous to list, then if they can't stand the heat, get out of the kitchen, right?
Anyway, the Throw() method seems to be based on the user providing the error description so that the error can be thrown, and THEN you can query the Err structure to get the corresponding number. But I don't see a way of going in reverse...Providing an error number and having the exception thrown, so you can get at the description.
In that same regard, I could go back and use the error codes from vb6.....IF they matched up with the ones in vb.Net. That's one hell of an assumption!
The exceptions don't really have error numbers. The Err object is a hold over from the VB6 days. It's not used in VB.NET code. It's only there for backwards compatibility in old VB6 projects that were converted to VB.NET.
Well, my predicament is that I am finishing up a port-over of a vb6 project, with old style "On Error Resume and Goto" statements. So I need all possible errors that can be raised at certain spots. And since .net supports backward compatability, then the least they can do is show a table of vb6 error codes vs. descriptions. BUT then again, if this is TRUE backwards compatability, then the code numbers would not have changed. I hate making assumptions like that, though.
Still...Would be nice if they would put some of the old stuff in the net documentation, so you don't have to leave the net IDE to go look for a legacy feature that net supports. In that sense, it really IS part of net...Just not its new framework. I guess I'm just nitpicking.
Again. It has nothing to do with .NET at all. It's legacy junk that's only there for backwards compatibility. It offers nothing to .NET development and why would you duplicate documentation that is already out there and redocument language features that have been unsupported for years now?
It really is NOT part of .NET. What you see in a converted application are methods and hacks that look and work like old VB6 code. It's just a bunch of adaptations cobbled together to make .NET code look and work like old VB6 functionality.