Solved

VB6 Conversion Help

Posted on 2004-03-25
6
567 Views
Last Modified: 2008-03-17
Hi,

Converting a VB6 program and want to remove all the VB6 stuff even though the program works, anyone tell me if threre is a .NET equilivent to

Private Declare Function SetCursorPos Lib "user32" (ByVal x As Integer, ByVal y As Integer) As Integer
Private Declare Function GetDesktopWindow Lib "user32" () As Integer
Private Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Integer) As Integer
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Integer, ByVal hdc As Integer) As Integer
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINTAPI) As Integer
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Integer, ByRef lpExitCode As Integer) As Integer
Private Declare Function GetCurrentProcess Lib "kernel32" () As Integer

Also there are references to

AxMSComctlLib
MsComctlLib
Microsoft.VisualBasic.Compatibality
stdole

all the rest are system. which look like .net references.

Can you see where a reference is used in code.
0
Comment
Question by:Plucka
6 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 10675918
0
 
LVL 18

Author Comment

by:Plucka
ID: 10675942
I think that shows me how to use them, I want to eliminate them by using .net framework classes if possible.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10675977
GetCursorPos - see Control.MousePosition Property

GetCurrentProcess property - see Process.GetCurrentProcess Method, Process.Handle Property
GetExitCodeProcess - see Process.ExitCode Property

I will try to find other functions also.
0
 
LVL 4

Expert Comment

by:Nazdor
ID: 10686855
.net is "supposed" to be platform independent, so there are certain tasks that simply do not currently live in the .net world.   Most this is to do with window handling (eg GetDesktopWindow, EnumerateWindows).  For these you need to you platform interop.

You will probably find this link of use:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/win32map.asp

0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10854205
PAQd, no points refunded.

GhostMod
Community Support Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question