Solved

How can I open “My Computer” window

Posted on 2002-07-26
7
234 Views
Last Modified: 2010-05-02
Hi,

What is the code which may do the following:
Open “My Computer” window by pressing “F11”  or any other Key. I use Windows 98.

Your efforts are completely appreciated.

Thanx in advance
Ray14
0
Comment
Question by:ray14
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 7179932
Private Sub Command1_Click()
Shell "command.com /c explorer.exe /n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", vbHide
End Sub
0
 
LVL 1

Accepted Solution

by:
adam8 earned 200 total points
ID: 7179974
If you put a timer on the form and set it's interval to say, 80, then this will check for when you press the F11, or whatever button.

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Private Sub Timer1_Timer()
    If GetAsyncKeyState(vbKeyF11) = -32767 Then
        'Run My Computer
    End If
End Sub
0
 
LVL 1

Expert Comment

by:adam8
ID: 7179984
To run My Computer you can use.

Shell "Explorer /n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", vbNormalFocus
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 28

Expert Comment

by:vinnyd79
ID: 7179990
You could use something like this to create a hotkey to launch My Computer

http://www.freevbcode.com/ShowCode.Asp?ID=987
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 7179997
The link I posted for the hotkey will respond even if your app does not have the focus.
0
 

Author Comment

by:ray14
ID: 7180146
Hi Experts,

Thank you so much, you gave me excellent answers specially "adam8" who let me use F Keys as I asked in my quesion.

Please, I shall be very happy if you give me the code which can close the window (My Computer) by pressing F10

Many Thanks in advance
Ray14
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 7180204
you could try changing the timer routine to this:

Private Sub Timer1_Timer()
   If GetAsyncKeyState(vbKeyF11) = -32767 Then
    ' run my computer
   End If
   If GetAsyncKeyState(vbKeyF10) = -32767 Then
       SendKeys "%{F4}", True
   End If
End Sub

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question