Solved

How can I open “My Computer” window

Posted on 2002-07-26
7
231 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 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