What is the proper VB.NET way to declare these VB6 dlls?
Public Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Public Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Public Declare Function PostMessage Lib "user32" _
Alias "PostMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Declare Function IsWindow Lib "user32" _
(ByVal hwnd As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" _
(ByVal hwnd As Long, _
lpdwProcessId As Long) As Long 3 6491
In article <41**********************************@microsoft.co m>, Cutlass wrote: What is the proper VB.NET way to declare these VB6 dlls?
Public Declare Function WaitForSingleObject Lib "kernel32" _ (ByVal hHandle As Long, _ ByVal dwMilliseconds As Long) As Long
Public Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As System.IntPtr, _
ByVal dwMilliseconds As Integer) As Integer
Private Declare Function CloseHandle Lib "kernel32" _ (ByVal hObject As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As System.IntPtr) As Boolean
Public Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long
Public Auto Declare Function FindWindow Lib "user32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As System.IntPtr
Public Declare Function PostMessage Lib "user32" _ Alias "PostMessageA" _ (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long
Public Declare Auto Function PostMessage Lib "user32" _
(ByVal hWnd As System.IntPtr, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Boolean
Public Declare Function IsWindow Lib "user32" _ (ByVal hwnd As Long) As Long
Public Declare Function IsWindow Lib "user32" _
(ByVal hWnd As System.IntPtr) As Boolean
Public Declare Function OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Integer, _
ByVal bInheritHandle As Boolean, _
ByVal dwProcessId As System.IntPtr) As System.IntPtr
Public Declare Function GetWindowThreadProcessId Lib "user32" _ (ByVal hwnd As Long, _ lpdwProcessId As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" _
(ByVal hWnd As System.IntPtr, _
ByRef lpdwProcessId As System.IntPtr) As System.IntPtr
--
Tom Shelton [MVP]
THANKS!
No my VB6 calls fail, can you help?
Dim hWindow As Long
Dim hThread As Long
Dim hProcess As Long
Dim lProcessId As Long
Dim lngResult As Long
Dim lngReturnValue As Long
Dim iLoopCnt As Integer
hWindow = FindWindow(vbNullString, "(Inactive " & sDir & "\EDIAPIS.EXE)")
hThread = GetWindowThreadProcessId(hWindow, lProcessId)
hProcess = OpenProcess(SYNCHRONIZE, 0&, lProcessId)
lngReturnValue = PostMessage(hWindow, WM_CLOSE, 0&, 0&)
lngResult = WaitForSingleObject(hProcess, 20000)
"Tom Shelton" wrote: In article <41**********************************@microsoft.co m>, Cutlass wrote: What is the proper VB.NET way to declare these VB6 dlls?
Public Declare Function WaitForSingleObject Lib "kernel32" _ (ByVal hHandle As Long, _ ByVal dwMilliseconds As Long) As Long
Public Declare Function WaitForSingleObject Lib "kernel32" _ (ByVal hHandle As System.IntPtr, _ ByVal dwMilliseconds As Integer) As Integer
Private Declare Function CloseHandle Lib "kernel32" _ (ByVal hObject As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _ (ByVal hObject As System.IntPtr) As Boolean
Public Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long
Public Auto Declare Function FindWindow Lib "user32" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As System.IntPtr
Public Declare Function PostMessage Lib "user32" _ Alias "PostMessageA" _ (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long
Public Declare Auto Function PostMessage Lib "user32" _ (ByVal hWnd As System.IntPtr, _ ByVal wMsg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As Integer) As Boolean
Public Declare Function IsWindow Lib "user32" _ (ByVal hwnd As Long) As Long
Public Declare Function IsWindow Lib "user32" _ (ByVal hWnd As System.IntPtr) As Boolean
Public Declare Function OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Integer, _ ByVal bInheritHandle As Boolean, _ ByVal dwProcessId As System.IntPtr) As System.IntPtr
Public Declare Function GetWindowThreadProcessId Lib "user32" _ (ByVal hwnd As Long, _ lpdwProcessId As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" _ (ByVal hWnd As System.IntPtr, _ ByRef lpdwProcessId As System.IntPtr) As System.IntPtr
-- Tom Shelton [MVP]
Can't you just add them as references and act upon them once instantiated?
"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl... In article <41**********************************@microsoft.co m>, Cutlass wrote: What is the proper VB.NET way to declare these VB6 dlls?
Public Declare Function WaitForSingleObject Lib "kernel32" _ (ByVal hHandle As Long, _ ByVal dwMilliseconds As Long) As Long
Public Declare Function WaitForSingleObject Lib "kernel32" _ (ByVal hHandle As System.IntPtr, _ ByVal dwMilliseconds As Integer) As Integer
Private Declare Function CloseHandle Lib "kernel32" _ (ByVal hObject As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _ (ByVal hObject As System.IntPtr) As Boolean
Public Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long
Public Auto Declare Function FindWindow Lib "user32" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As System.IntPtr
Public Declare Function PostMessage Lib "user32" _ Alias "PostMessageA" _ (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long
Public Declare Auto Function PostMessage Lib "user32" _ (ByVal hWnd As System.IntPtr, _ ByVal wMsg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As Integer) As Boolean
Public Declare Function IsWindow Lib "user32" _ (ByVal hwnd As Long) As Long
Public Declare Function IsWindow Lib "user32" _ (ByVal hWnd As System.IntPtr) As Boolean
Public Declare Function OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Integer, _ ByVal bInheritHandle As Boolean, _ ByVal dwProcessId As System.IntPtr) As System.IntPtr
Public Declare Function GetWindowThreadProcessId Lib "user32" _ (ByVal hwnd As Long, _ lpdwProcessId As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" _ (ByVal hWnd As System.IntPtr, _ ByRef lpdwProcessId As System.IntPtr) As System.IntPtr
-- Tom Shelton [MVP] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Johann Blake |
last post by:
I can hardly believe I'm the first one to report this, but having gone
through the newsgroup, it appears that way.
I would like to open a solution in the VS.NET IDE that consists of
multiple...
|
by: Shiraz |
last post by:
Hi
I just made an installer for an application that uses two external COM dlls.
On the surface, everything seems to be running smoothly and the the
application runs without any errors. However,...
|
by: Devender Khari |
last post by:
Hi Friends,
I'm facing a situation as follows, need help on identifying possible issues.
There is an MFC application developed in VC6.0, say ABCVC6.exe and another
developed in VC.NET, say...
|
by: ZMan |
last post by:
Scenario:
This is about debugging server side scripts that make calls to
middle-tier business DLLs. The server side scripts are legacy ASP 3.0
pages, and the DLLs are managed DLLs...
|
by: Oenone |
last post by:
I'm sure there's an obvious way to do this, but I'm missing it so far.
I have an ASP.NET application that relies on several DLLs to work. Currently
in order to get my site working I have to put...
|
by: Brian Bischof |
last post by:
I'm having troubles getting the debugging process to work consistenly for
external classes. I got it to work once and then I turned it off. But now I
can't get re-enabled. Here is what I'm doing....
|
by: Dave |
last post by:
Hello
The application I'm building an installer for uses dlls which were
developed originally in C. Since the application itself is developed in
C#, these dlls were wrapped using SWIG....
|
by: Jeff Lynn |
last post by:
Help!
I recently upgraded my VS V6 to VS 2005 and was unable to build projects
that were perfectly ok under VS V6. Where VS 2005 fails was in the linker
resolving external DLLs, which are Open...
|
by: gopal |
last post by:
I am developing an application in CSharp - windows forms based, which
copies the DLLs both unmanaged and managed DLLs from a shared folder
and will overwrite the existing versions of managed &...
|
by: =?Utf-8?B?UmljaGFyZA==?= |
last post by:
Hi,
I usually deploy my ASP .NET application to the server by publishing, using
Visual Studio 2005 publish feature. This creates the Bin folder on the
server, with the compiled DLLs.
I've...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |