>>Okay, some progress...try this now in command window:
>>
>>cJobName = "Bon Matin"
>>DECLARE INTEGER PrintWindow IN DibApi32 ;
>> INTEGER HWnd, ;
>> INTEGER fPrintArea, ;
>> INTEGER fPrintOpt, ;
>> INTEGER wxScale, ;
>> INTEGER wyScale, ;
>> STRING @ szJobName
>>nRetVal = PrintWindow(3,1,1,0,0,@cJobName)
>>
>>and see what happens, do you get past the error?
>No error, nothing happens (no printing)
>(nRetval=21)
>More progress...
>And now ?
>
>Merci beaucoup et bonne journée
>
>Michel
Michel,
A return value of 21 means the function that copies the window to a DIB failed. Two things can cause this. One is an invalid printarea argument and 1 is a valid value. The other is the HWnd parameter does not contain a valid Windows HWnd handle. I think that's your problem.
Make sure you are passing a Windows HWnd handle not a VFP WHANDLE. They are not the same thing.