Solved

How can I open “My Computer” window

Posted on 2002-07-26
7
227 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

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…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

772 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