Solved

VB6 Conversion Help

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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET - Error - Object not set in Module 4 39
How come this regular expression allows "e"? 14 45
JSON Deserialize issue 6 26
Amazon S3 Images with .Net 3 13
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 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