Solved

VB6 Conversion Help

Posted on 2004-03-25
6
566 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now