Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove Windows Printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00420415
Message ID:
00420450
Vues:
20
>>>Hello.
>>>Anybody know way for delete windows printer from system? With using Win32API. If possible without WSH
>>
>>Denis,
>>
>>I think that the WSH method probably maps to WNetCancelConnection2(). FWIW, here's the descriptions of the two:
* WSHNetwork object
>>object.RemovePrinterConnection strName, [bForce], [bUpdateProfile]
>>* API
>>DECLCARE INTEGER WNetCancelConnection2 IN Win32API;
>>  STRING @lpname, INTEGER dwflags, INTEGER fForce
In both cases the first parameter is the device name. The WSH method's bForce optional parameter is the same as the fForce parameter in WNetCancelConnection2() the differences being that it's optional with the WSH and is either .T. or .F., in the API call it's required, but defined in the C declaration as a BOOL, so 0 would equal .F. and 1 would equal .T. The dwflags parameter in the API call is either 0 which does not update the profile or CONNECT_UPDATE_PROFILE (1) which does.
>>
>>This help?
>
>Hi George!
>Thanks for your reply.
>I need UNINSTALL local printer device. (Not disconnect network printer). That is part of UNINSTALL program.

Denis,

I'm not sure whether or not WNetCancelConnection2() can do this. The WSH can, and if it does map to this function, then you may be able to do this. I'd give it a shot, it might work. If it does, why don't you let us know.

>P.S.
>By the way, I use your lnkfiles.DLL... Very usefull lib. Thanks.

Much appreciated.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform