32 bit equivalent of 16 bit API call GetModuleUsage 
Author Message
 32 bit equivalent of 16 bit API call GetModuleUsage


Quote:
> I have a 16 bit program that I now want to bring to 32 bit.  The 16 bit
> uses the API Function GetModuleUsage. But this is not supported in 32 bit

> The code is something like this:

>    handle = Shell(---- Prints a Fax-----)
>    While GetModuleUsage(handle)> 0 then
>            DoEvents
>    Wend

> As the Faxes can be quite long I want it to wait until it's finished
> printing, before moving on to the next one.

> ANY IDEAS?

Try this:

        handle = Shell("command.com /c " + "your command to print the fax",
1)

        OpenProcess = OpenProcess(SYNCHRONIZE, True, handle)

        Do While WaitForSingleObject(OpenProcess, 0)  > 0
            DoEvents
        Loop

        ret = TerminateProcess(OpenProcess, 0&)
        ret = CloseHandle(OpenProcess)
        MsgBox "Printing has terminated!"

Add the following declarations.

    Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal _
        dwAccess As Long, ByVal fInherit As Integer, ByVal hObject _
        As Long) As Long

    Private Declare Function TerminateProcess Lib "kernel32" (ByVal _
        hProcess As Long, ByVal uExitCode As Long) As Long

    Private Declare Function CloseHandle Lib "kernel32" (ByVal _
        hObject As Long) As Long

    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
        hHandle As Long, ByVal dwMilliseconds As Long) As Long

    Private Const SYNCHRONIZE = 1048576



Mon, 06 Mar 2000 03:00:00 GMT  
 32 bit equivalent of 16 bit API call GetModuleUsage

I have a 16 bit program that I now want to bring to 32 bit.  The 16 bit
uses the API Function GetModuleUsage. But this is not supported in 32 bit

The code is something like this:

        handle = Shell(---- Prints a Fax-----)
        While GetModuleUsage(handle)> 0 then
                DoEvents
        Wend

As the Faxes can be quite long I want it to wait until it's finished
printing, before moving on to the next one.

ANY IDEAS?

Thanks a lot, suggestions welcome.


Thanks a lot,

Brian Shinners

From a lovely sunny afternoon here in Dublin, Ireland



Mon, 06 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 32 bit equivalents to 16 bit calls....

2. 16 bit API calls in VB 3 supported in 32 bit VB 4.0

3. 16-bit/32-bit API calls

4. Calling 16 bit DLL's in VB5 ENV(32 bit)

5. calling a 16-bit dll from VB 32-bit

6. Need to write 32-bit DLL to do 16-bit calls to a software interrupt

7. calling a 16-bit dll from a 32-bit application

8. How to call a 16-bit dll in a 32-bit application

9. Need help calling 16-bit app from 32-bit app

10. Calling 16 bit DLL from 32 bit app

11. Can VB4.0 32 Bit call a 16 bit DLL

 

 
Powered by phpBB® Forum Software