Volume Serial Number -- Easy One 
Author Message
 Volume Serial Number -- Easy One

I need a way to get the volume serial number of a mounted CD.  I can use the
DIR command to get the volume ID, but not the serial number.

Please help!

Mirage
-Post within group-



Fri, 13 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

See "How to Get or Create a Unique Audio CD Volume Label
Last reviewed: February 29, 1996
Article ID: Q147654" at http://support.microsoft.com/support

Quote:

>I need a way to get the volume serial number of a mounted CD.  I can use
the
>DIR command to get the volume ID, but not the serial number.

>Please help!

>Mirage
>-Post within group-



Fri, 13 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

How 'bout using the GetVolumeInformation API:

Declare Function GetVolumeInformation Lib "kernel32" Alias
"GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal
nFileSystemNameSize As Long) As Long

Woxpro



Wed, 18 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

Quote:

>How do i make a program to wait in the code. I got a couple of strings with
>sendkeys but the program are sending it to fast. How do I slow it down or
>putting a delay between them?
>I tried with
>Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
>Sleep 1000

>but it doesnt work.

>Anyone got a better idea?

dim tTime as date
  tTime = Now
    Do
     DoEvents
     Loop Until DateDiff("s", tTime, Now) > X  'where X is the number of
seconds to wait.

This works like a charm, and your program won't 'freeze' during the wait.
Other threads will continue to run including the screen refresh.

Good Luck!
Mirage



Fri, 20 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One


Quote:


>>How do i make a program to wait in the code. I got a couple of strings with
>>sendkeys but the program are sending it to fast. How do I slow it down or
>>putting a delay between them?

Dim t as double
t = now + 5     ' 5 seconds
do while t > now
        doevents
loop

LC.



Fri, 20 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

Hi Eric,

basically, you got the right idea, but there is one statement missing.

a) Your program freezes every time you let it "sleep".
b) In my programs, I use a sleep of 250 milliseconds in a loop AND
c) do never forget to add the statement "DoEvents" after (or before)
each sleep.

Your solution could be:

WHILE...
        (do something important)
        Sleep 250
        DoEvents
LOOP

Your program has no time left to react for the sended keys, if you
don't give it the chance to do events.

Good luck,
Guido.



Quote:
>How do i make a program to wait in the code. I got a couple of strings with
>sendkeys but the program are sending it to fast. How do I slow it down or
>putting a delay between them?
>I tried with
>Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
>Sleep 1000

>but it doesnt work.

>Anyone got a better idea?

>Regards




Fri, 20 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

Sleep...that's an new one on me.

Are there any advantages to using that rather than a straightforward timer
control? Specifically, does the SLEEP API force the program to cease
processing? I ask as I have a couple of routines which are sapping way to
much CPU and need calming down a bit. They are well DoEvented but use the
MSCOMM control which utilises 100% CPU when sending data - sleeping for a
few milliseconds between every string sent might help...

Simon

Quote:

>Hi Eric,

>basically, you got the right idea, but there is one statement missing.

>a) Your program freezes every time you let it "sleep".
>b) In my programs, I use a sleep of 250 milliseconds in a loop AND
>c) do never forget to add the statement "DoEvents" after (or before)
>each sleep.

>Your solution could be:

>WHILE...
> (do something important)
> Sleep 250
> DoEvents
>LOOP

>Your program has no time left to react for the sended keys, if you
>don't give it the chance to do events.

>Good luck,
>Guido.



>>How do i make a program to wait in the code. I got a couple of strings
with
>>sendkeys but the program are sending it to fast. How do I slow it down or
>>putting a delay between them?
>>I tried with
>>Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
>>Sleep 1000

>>but it doesnt work.

>>Anyone got a better idea?

>>Regards




Fri, 20 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One


Quote:
>Sleep...that's an new one on me.

>Are there any advantages to using that rather than a straightforward timer
>control? Specifically, does the SLEEP API force the program to cease
>processing? I ask as I have a couple of routines which are sapping way to
>much CPU and need calming down a bit. They are well DoEvented but use the
>MSCOMM control which utilises 100% CPU when sending data - sleeping for a
>few milliseconds between every string sent might help...

>Simon

Sleep effectively relinquishes all CPU use for the time specified unlike
DoEvents which actually loops through the message queue dispatching the
entries (which is why your process shows active -- it is).  The downside of
Sleep is that your app (or at least the thread issuing the Sleep call) can
not respond to any events including shutdown requests or user activity
during the sleep period.  If you use too long a delay your app can appear
"not responding" even though it is just trying to be nice.  Short Sleep
calls can be very useful.


Fri, 20 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

How about :

This example uses the Timer function to pause the application.
The example also uses DoEvents to yield to other processes during the pause.

Dim PauseTime, Start, Finish, TotalTime

If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
     PauseTime = 5 ' Set duration.
     Start = Timer ' Set start time.
     Do While Timer < Start + PauseTime
          DoEvents ' Yield to other processes.
     Loop
     Finish = Timer ' Set end time.
     TotalTime = Finish - Start ' Calculate total time.
     MsgBox "Paused for " & TotalTime & " seconds"
 Else
     End
 End If

Quote:



>: >Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
>: >Sleep 1000

>the sleep function looks like it should work, but instead try
>gettickcount.

>(declare gettickcount and then)..

>Sub SleepMS(ms as integer)

>S = gettickcount
>do
> doevents
>loop until (gettickcount >= (s + ms))

>end sub



Fri, 20 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

: >Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
: >Sleep 1000

the sleep function looks like it should work, but instead try
gettickcount.

(declare gettickcount and then)..

Sub SleepMS(ms as integer)

S = gettickcount
do
        doevents
loop until (gettickcount >= (s + ms))

end sub



Sat, 21 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

: How about :

: This example uses the Timer function to pause the application.
: The example also uses DoEvents to yield to other processes during the pause.

ive never used timer, but by your example it has a granularity in seconds,
as opposed to the (effectively near) miliseconds of gettickcount.  ergo
getticount makes more sense to me in the general case, but clearly it
depends upon your application.

- adrian



Sun, 22 Oct 2000 03:00:00 GMT  
 Volume Serial Number -- Easy One

Adrian:

I think Timer returns the number of seconds since midnight as a single so it
should be more accurate than whole seconds.

mj

Quote:


>: How about :

>: This example uses the Timer function to pause the application.
>: The example also uses DoEvents to yield to other processes during the
pause.

>ive never used timer, but by your example it has a granularity in seconds,
>as opposed to the (effectively near) miliseconds of gettickcount.  ergo
>getticount makes more sense to me in the general case, but clearly it
>depends upon your application.

>- adrian



Mon, 23 Oct 2000 03:00:00 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Volume Serial Number -- Easy One

2. Here is a hard one.... Volume Serial Number

3. HD VOLUME SERIAL NUMBER

4. Hard Drive Volume Serial Number

5. I WOULD LIKE TO OBTAIN THE SERIAL NUMBER OF VOLUME

6. Retreiving remote volume serial number

7. HD VOLUME SERIAL NUMBER

8. HOW TO change the volume serial number

9. Volume Serial Number????

10. Determining Disk Volume Serial Number?

11. Get disk volume serial number

12. How to Get Volume Serial Number?

 

 
Powered by phpBB® Forum Software