Solved

How can I open “My Computer” window

Posted on 2002-07-26
7
229 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best way to parse out a json string in VB6? 10 218
VB6 ListBox Question 4 48
vbModal 12 57
VB6 - Cannot type when doing an extract from MSHFlexgrid to Excel 6 18
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

809 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