|
-
Mar 11th, 2007, 09:18 PM
#1
Thread Starter
Lively Member
Open floppy
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
-
Mar 11th, 2007, 11:09 PM
#2
Re: Open floppy
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 12th, 2007, 06:42 PM
#3
Thread Starter
Lively Member
Re: Open floppy
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
-
Mar 12th, 2007, 06:44 PM
#4
Re: Open floppy
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/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 12th, 2007, 06:47 PM
#5
Re: Open floppy
vb Code:
Private Sub Form_Load()
Shell "Explorer.exe A:\"
End Sub
-
Mar 12th, 2007, 07:04 PM
#6
Re: Open floppy
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 13th, 2007, 09:38 AM
#7
Thread Starter
Lively Member
Re: Open floppy
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
-
Mar 13th, 2007, 09:44 AM
#8
Re: Open floppy
vb Code:
Shell "Explorer.exe A:\", vbNormalFocus
-
Mar 13th, 2007, 11:40 AM
#9
Thread Starter
Lively Member
-
Mar 15th, 2007, 12:38 PM
#10
Thread Starter
Lively Member
[Resolved] Open floppy
Hey Everyone
This is what i came up with.
Thanks to all
Reston
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|