Solved

VB6 Conversion Help

Posted on 2004-03-25
6
565 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
Comment Utility
0
 
LVL 18

Author Comment

by:Plucka
Comment Utility
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
Comment Utility
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
Comment Utility
.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
Comment Utility
PAQd, no points refunded.

GhostMod
Community Support Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

15 Experts available now in Live!

Get 1:1 Help Now