Results 1 to 10 of 10

Thread: Open floppy

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    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

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    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

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Open floppy

    vb Code:
    1. Private Sub Form_Load()
    2.     Shell "Explorer.exe A:\"
    3. End Sub
    CS

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    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

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Open floppy

    vb Code:
    1. Shell "Explorer.exe A:\", vbNormalFocus

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    Re: Open floppy

    Thanks

    I'll try this

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    [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
  •  



Click Here to Expand Forum to Full Width