PC Review


Reply
Thread Tools Rate Thread

API Inform user there is not media in the Drive & which kind of media the user has to insert

 
 
rebelscum0000
Guest
Posts: n/a
 
      7th May 2007
Dear all

Windows XP W/SP2, Access 2003 W/SP3

How do I inform to the user that there is not media in the Drive in
browse mode AND which kind of media the user has to insert?

Insert Disk Media, CD, DVD or USB...

Please insert a disk, Media, CD, DVD into drive <Drive>:.

For example the user Select Drive (X, There is not CD into the
Drive..
My Code only ends.. I want to inform user There is not CD into the
Drive, like when the user Click on 31/2 Floppy (A

I do not want to call Dir(Drive & ":\*.*")

If there any API, which inform the user
That there is not media, In the X Drive and what kind of Media, the
user has to insert (CD, DVD. Memory Card, USB...)

I.e.

Insert CD

[Icon] Please insert a CD into Drive X:.

[Cancel]


I know the error value is either 75 or 76 then it means that the path
is not found or the drive is not ready

Another problem I have is when the user select A: and there is not
disk
I click on Cancel, the Msgbox close but not my Browse window, how do I
close it?

insert disk

[Icon] Please insert a disk into Drive A:.

[Cancel]



Finally, I want to use an icon from %SystemRoot%\system32\SHELL32.dll
To use in one of these icons in my Msgbox but I do not know how to
extract it any idea?

Thanks in advance

Regards,
Antonio Macias

My code:

Dim MyDlg As New DialogClass 'Common Dialogs Class Module for Access
and VBA
Dim MyDialogResponse As Integer
Dim GetFolder As String
Dim strDrive As String
Dim FirstFolder As String
Dim LastFolder As String
Dim vArr As Variant
Dim itemCount As Integer
Dim j As Integer
Dim strItems As String
Dim TempCRCFile As String
Dim TempTXTFile As String
Dim ccgFF As Integer
Dim egfFF As Integer
Dim amcFF As Integer
Dim newDirectory As String


'On Error GoTo ErrorHandling
'GoTo Replace_First_Process:
'GoTo Replace_Second_Process:
'GoTo Fix_FileExtensions:

'Start Event Open_Windows_Browse
'Opens the Browse Dialog
With MyDlg
.TypeFile = 0 'All file Types
.TypeFile = 4 'Text Files
.DialogType = "Browse"
End With

'Show the select type of dialog selected with the properties
desired
MyDlg.Show

'Waits for the user to click a button, and returns an Integer
indicating which button
'the user clicked .DialogType = "Browse"
MyDialogResponse = Len(MyDlg.ReturnFilePath)

If MyDialogResponse = 0 Then
'User chose Cancel.
MsgBox "User Cancelled", vbExclamation, "Browse"
End
Else
'User Chose OK.
End If

'The name for the chosen file or directory
'Drive>:\ OR <Drive>:\Folder OR <Drive>:\Folder\Folder..
GetFolder = MyDlg.ReturnFilePath
Debug.Print "GetFolder = " & GetFolder

 
Reply With Quote
 
 
 
 
=?Utf-8?B?S0FSTCBERVdFWQ==?=
Guest
Posts: n/a
 
      7th May 2007
>>How do I inform to the user that there is not media in the Drive in
browse mode AND which kind of media the user has to insert?
You did not say what program you were working in but I bet it is not Access,
the relational database that is a part of Microsoft Office Professional.
This newsgroup is for Access.

--
KARL DEWEY
Build a little - Test a little


"rebelscum0000" wrote:

> Dear all
>
> Windows XP W/SP2, Access 2003 W/SP3
>
> How do I inform to the user that there is not media in the Drive in
> browse mode AND which kind of media the user has to insert?
>
> Insert Disk Media, CD, DVD or USB...
>
> Please insert a disk, Media, CD, DVD into drive <Drive>:.
>
> For example the user Select Drive (X, There is not CD into the
> Drive..
> My Code only ends.. I want to inform user There is not CD into the
> Drive, like when the user Click on 31/2 Floppy (A
>
> I do not want to call Dir(Drive & ":\*.*")
>
> If there any API, which inform the user
> That there is not media, In the X Drive and what kind of Media, the
> user has to insert (CD, DVD. Memory Card, USB...)
>
> I.e.
>
> Insert CD
>
> [Icon] Please insert a CD into Drive X:.
>
> [Cancel]
>
>
> I know the error value is either 75 or 76 then it means that the path
> is not found or the drive is not ready
>
> Another problem I have is when the user select A: and there is not
> disk
> I click on Cancel, the Msgbox close but not my Browse window, how do I
> close it?
>
> insert disk
>
> [Icon] Please insert a disk into Drive A:.
>
> [Cancel]
>
>
>
> Finally, I want to use an icon from %SystemRoot%\system32\SHELL32.dll
> To use in one of these icons in my Msgbox but I do not know how to
> extract it any idea?
>
> Thanks in advance
>
> Regards,
> Antonio Macias
>
> My code:
>
> Dim MyDlg As New DialogClass 'Common Dialogs Class Module for Access
> and VBA
> Dim MyDialogResponse As Integer
> Dim GetFolder As String
> Dim strDrive As String
> Dim FirstFolder As String
> Dim LastFolder As String
> Dim vArr As Variant
> Dim itemCount As Integer
> Dim j As Integer
> Dim strItems As String
> Dim TempCRCFile As String
> Dim TempTXTFile As String
> Dim ccgFF As Integer
> Dim egfFF As Integer
> Dim amcFF As Integer
> Dim newDirectory As String
>
>
> 'On Error GoTo ErrorHandling
> 'GoTo Replace_First_Process:
> 'GoTo Replace_Second_Process:
> 'GoTo Fix_FileExtensions:
>
> 'Start Event Open_Windows_Browse
> 'Opens the Browse Dialog
> With MyDlg
> .TypeFile = 0 'All file Types
> .TypeFile = 4 'Text Files
> .DialogType = "Browse"
> End With
>
> 'Show the select type of dialog selected with the properties
> desired
> MyDlg.Show
>
> 'Waits for the user to click a button, and returns an Integer
> indicating which button
> 'the user clicked .DialogType = "Browse"
> MyDialogResponse = Len(MyDlg.ReturnFilePath)
>
> If MyDialogResponse = 0 Then
> 'User chose Cancel.
> MsgBox "User Cancelled", vbExclamation, "Browse"
> End
> Else
> 'User Chose OK.
> End If
>
> 'The name for the chosen file or directory
> 'Drive>:\ OR <Drive>:\Folder OR <Drive>:\Folder\Folder..
> GetFolder = MyDlg.ReturnFilePath
> Debug.Print "GetFolder = " & GetFolder
>
>

 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      8th May 2007
rebelscum0000 <(E-Mail Removed)> wrote:

>How do I inform to the user that there is not media in the Drive in
>browse mode AND which kind of media the user has to insert?


>If there any API, which inform the user
>That there is not media, In the X Drive and what kind of Media, the
>user has to insert (CD, DVD. Memory Card, USB...)


If it's anywhere check vbnet.mvps.org. And look in the file I/O
section. At least that's what I think it's called. Internet is down
right now so I can't tell you exactly what to look for.

VB API calls almost always work just fine in Access.

>Finally, I want to use an icon from %SystemRoot%\system32\SHELL32.dll
>To use in one of these icons in my Msgbox but I do not know how to
>extract it any idea?


Do a search on ExtractIcon and ExtractAssociatedIcon. I don't recall
where I found code that I am using in the Auto FE Updater.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
new xp media user tipp Windows XP Video 0 5th Mar 2007 12:07 AM
User name to log in XP Media Ctr =?Utf-8?B?RHIuIFBhbHBhdGluZQ==?= Windows XP Security 4 16th Oct 2005 03:12 PM
restart removable media everytime after insert of media (DLT) =?Utf-8?B?UGF1bCBSb29zZW1leWVycw==?= Microsoft Windows 2000 Advanced Server 5 16th May 2005 09:07 AM
NTBackup - user not authorized for media, no tape drive available. GSV Three Minds in a Can Windows XP General 0 16th Aug 2003 09:04 PM
XP Media Edition Available to End User Keith Windows XP Customization 1 27th Jul 2003 11:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:53 PM.