NeuralJack
Well-known member
- Joined
- Jul 28, 2005
- Messages
- 138
I need to know if im missing something big here. I program and program in VB.net just fine and very quickly until I have to use an API. At that moment it is EXACTLY like i was hit by a Mac Truck. One damn API declaration and usage will blow a whole in my progress for 1-3 solid days before i give up and ask on a forum how it should be used. Of course, when i ask on the forums there is about a 15 day period before the first response.. so there goes all productivity out the window. I am still very thrilled for any help by forum folks even if its months after the initial post. Forums rock. BUT, it doesnt change the fact that APIs and VB.NET together are not working well with ME.
I have never had a problem trying to figure out how to do something with my own research online for the correct code to use, EXCEPT when APIs are involved. By now I have many APIs figured out, after much grief, but now and then a new one comes up (now its MoveWindow API). The problem with APIs and VB.net seems to be that all of the APIs examples and declarations are in VB6 or earlier (at all the websites).. AND MOST (BUT NOT ALL) ARE NOT COMPATIBLE WITH .NET in that form. You have to tweak with those examples/declarations in a way that is rarely published anywhere that i can find. I search and search for the proper API usage in VB .NET with no success. Sometimes if you post on forums about this, the replys will just be links to more websites with yet more examples on how they were used in VB 6!
Most .NET programmers may not even notice this sort of thing becuase they dont use many various APIs or something. I use APIs constantly because i need to interface/react with programs outside of my own program.
Id be thrilled if some folks could answer a few questions for me:
1. Am I the only one?
2. Is there a source where i can find API declarations and examples for specifically VB.net? AllAPI site is terrible because its all, you guessed it, VB 6 or earlier garbage. Youd think by now .NET would have some API sites.
3. Are there tricks to converting API usage in VB6 to VB.Net?
4. My recent prob is with MoveWindow API if anyone can help.
This dont work:
Declaration:
Usage:
- Yes, i have the correct window handle cuase ive tested it with SetForeGroundWindow.
I have never had a problem trying to figure out how to do something with my own research online for the correct code to use, EXCEPT when APIs are involved. By now I have many APIs figured out, after much grief, but now and then a new one comes up (now its MoveWindow API). The problem with APIs and VB.net seems to be that all of the APIs examples and declarations are in VB6 or earlier (at all the websites).. AND MOST (BUT NOT ALL) ARE NOT COMPATIBLE WITH .NET in that form. You have to tweak with those examples/declarations in a way that is rarely published anywhere that i can find. I search and search for the proper API usage in VB .NET with no success. Sometimes if you post on forums about this, the replys will just be links to more websites with yet more examples on how they were used in VB 6!
Most .NET programmers may not even notice this sort of thing becuase they dont use many various APIs or something. I use APIs constantly because i need to interface/react with programs outside of my own program.
Id be thrilled if some folks could answer a few questions for me:
1. Am I the only one?
2. Is there a source where i can find API declarations and examples for specifically VB.net? AllAPI site is terrible because its all, you guessed it, VB 6 or earlier garbage. Youd think by now .NET would have some API sites.
3. Are there tricks to converting API usage in VB6 to VB.Net?
4. My recent prob is with MoveWindow API if anyone can help.
This dont work:
Declaration:
Code:
Declare Function MoveWindow Lib "user32" Alias "MoveWindow" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Code:
MoveWindow(hWnd, 100, 100, 400, 300, True)
- Yes, i have the correct window handle cuase ive tested it with SetForeGroundWindow.