Hey everyone
I have this program that deletes some files off a floppy.
The thing is i want to have my program open the floppy when run.
Thanks
Printable View
Hey everyone
I have this program that deletes some files off a floppy.
The thing is i want to have my program open the floppy when run.
Thanks
What do you mean by "open the floppy"? Eject it or access its files? If eject then its not do-able as its a manual mechanical button press.
What i mean is when someone double clicks the floopy icon on the desktop it shows what files are on the floppy. I was hoping that when my program ran it would do the same as above.
Hope this helps
Yes, then you can shellexecute explorer and pass the floppy drive path so it open explorer to that drive showing the file contents (if any).
vb Code:
Private Sub Form_Load() Shell "Explorer.exe A:\" End Sub
If you want to get fancy you could use some APIs to check if there is a floppy in the drive and if its available. Prevents any errors. ;)
That seems to work but it only opens to the task bar. Can we set it to open so the user can see what is there?
Reston
vb Code:
Shell "Explorer.exe A:\", vbNormalFocus
Thanks
I'll try this
Hey Everyone
This is what i came up with.
Thanks to all
Reston
:wave:
Vb Code _________________________________
Private Sub Command1_Click()
On Error GoTo a:
ACE = 69
If Dir$("A:\*.T", vbNormal) <> "" Then
'File exists
Kill "A:\*.T"
End If
a:
If Err.Number = 52 Then
MsgBox "Please Insert a Disc!", vbOKOnly, "Floppy Disc Error"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Shell "Explorer.exe A:\", vbNormalFocus
Dim r As RECT
Dim nTop As Long, nLeft As Long
Call SystemParametersInfo(SPI_GETWORKAREA, 0, r, 0)
'convert pixels to twips
r.Bottom = r.Bottom * Screen.TwipsPerPixelY
r.Right = r.Right * Screen.TwipsPerPixelX
'calculate the new top and left values of the form
nTop = r.Bottom - Me.Height
nLeft = r.Right - Me.Width
'move the form
Me.Move nLeft, nTop
End Sub
Private Sub MoveMe()
Dim r As RECT
Dim nTop As Long, nLeft As Long
Call SystemParametersInfo(SPI_GETWORKAREA, 0, r, 0)
'convert pixels to twips
r.Bottom = r.Bottom * Screen.TwipsPerPixelY
r.Right = r.Right * Screen.TwipsPerPixelX
'calculate the new top and left values of the form
nTop = r.Bottom - Me.Height
nLeft = r.Right - Me.Width
'move the form
Me.Move nLeft, nTop
End Sub