I won't try to convert the entire function, but I can give a few suggestions, in case you want to try the conversion yourself.
Private Declare would be DECLARE in VFP.
Strings - I believe - have to be passed as fixed length strings. IOW, create a variable with space(n), and pass it to the function. I am not sure if variables have to be passed by reference, if you want the function to change it.
For MsgBox(), see MESSAGEBOX().
Functions have to be called with parentheses. For instance, OpenPrinter(par1, par2).
HTH, Hilmar.
>******************************************
>I have example in VB, how convert to VFP?
>******************************************
>
>Private Declare Function OpenPrinter Lib "winspool.drv" Alias
>"OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long,
>pDefault As Any) As Long
>
>Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter
>As Long) As Long
>
>Private Declare Function EnumJobs Lib "winspool.drv" Alias "EnumJobsA"
>(ByVal hPrinter As Long, ByVal FirstJob As Long, ByVal NoJobs As Long,
>ByVal Level As Long, pJob As Any, ByVal cdBuf As Long, pcbNeeded As
>Long, pcReturned As Long) As Long
>
>
>Dim hPrinter As Long, lNeeded As Long, lReturned As Long
>Dim lJobCount As Long
>
> OpenPrinter Printer.DeviceName, hPrinter, ByVal 0&
> EnumJobs hPrinter, 0, 99, 1, ByVal 0&, 0, lNeeded, lReturned
>
> If lNeeded > 0 Then
> ReDim byteJobsBuffer(lNeeded - 1) As Byte
> EnumJobs hPrinter, 0, 99, 1, byteJobsBuffer(0), lNeeded,
>lNeeded, lReturned
> If lReturned > 0 Then
> lJobCount = lReturned
> Else
> lJobCount = 0
> End If
> Else
> lJobCount = 0
> End If
> ClosePrinter hPrinter
> MsgBox "Jobs in printer queue: " + CStr(lJobCount), vbInformation
>
>
>Thank's
>
>Mario
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)