Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to floppy
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00330178
Message ID:
00392154
Views:
11
Is there a good book with Foxpro examples (or just a good book) on Windows API?



>Hi:
>
>Here is another way.
>
>IF NOT IsDiskin("a:")
> = MESSAGEBOX("Drive 'A:' not available")
>ENDIF
>
>FUNCTION IsDiskIn
>LPARAMETERS tcDrive
> *
> * Defines from Winbase.h
> *
> #DEFINE SEM_FAILCRITICALERRORS 0x0001
> #DEFINE SEM_NOGPFFAULTERRORBOX 0x0002
> #DEFINE SEM_NOALIGNMENTFAULTEXCEPT 0x0004
> #DEFINE SEM_NOOPENFILEERRORBOX 0x8000
>
> *
> * SetErrorMode determines whether the system handles serious errors
> * or whether the program handles them
> *
> DECLARE INTEGER SetErrorMode IN win32api INTEGER
>
> *
> * Declare local variables
> *
> LOCAL lnResult,llIsDisIn,lcDrive
>
> *
> * Initilize
> *
> llIsDisIn = .F.
> lnResult = 0
> lcDrive = tcDrive
>
> *
> * Turn off critical errors
> *
> lnResult = SetErrorMode(SEM_FAILCRITICALERRORS)
>
> *
> * Check and see if the disk is in
> *
> IF DISKSPACE(lcDrive) = -1
> llIsDisIn = .F.
> ELSE
> llIsDisIn = .T.
> ENDIF
>
> *
> * Reset the thing the way we found them
> *
> lnResult = SetErrorMode(lnResult)
>
> *
> * Return the result
> *
> RETURN llIsDisIn
>ENDFUNC
>HTH,
>
>--Paul
>
>
>>Dear All:
>>
>>Back in the FoxPro for Windows days I was using a third party library called ZDRVSTAT to check the status of my diskettes when writing files to diskettes.
>>
>>It was never updated. What can I use to check disk status and handle properly the input/output problems when writing to diskette?
>>
>>Thanks in advance,
>>Bruce Strom
Bruce Strom

Prayer of St Ephrem:
O Lord and Master of My Life,
Take from me the spirit of sloth, meddling, ambition and vain talk.
But give me a spirit of prudence, humility, patience and love.
Yes Lord and King grant me to see my own sins and faults
and not judge my brother.
For You are Blessed Forever and Ever. Amen.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform