?
Solved

Desktop Icons and Mouse

Posted on 1998-09-14
3
Medium Priority
?
137 Views
Last Modified: 2010-04-30
Hi all,
    Does anyone know how i can open the My Computer window, Network Neighborhood window and Recycling bin window??? I need it to open when i click a button. Also does anyone know a custom control or anything else that will let me move the mouse cursor and let me double click and click the left and maybe the right mouse button?? thanks
                  - Bart
0
Comment
Question by:Bart235
[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
3 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1434808
What are you asking? You open the icons by clicking on them? Do you want them to be open at startup? Open all three with one click?

"does anyone know a custom control or anything else that will let me move the mouse cursor and let me double click and click the left and maybe the right mouse button??"

Umm, I thought this is how Windows works? Obviously I'm not understanding what you're after here...
0
 
LVL 2

Accepted Solution

by:
wj7ster earned 300 total points
ID: 1434809
You can use the SetCursorPos API to position the mouse

' --------------------------------------------------------------------------------------------------
Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

Then you can use the mouse_event API to simulate button clicks etc.

Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Public Const MOUSEEVENTF_RIGHTUP = &H10
Public Const MOUSEEVENTF_RIGHTDOWN = &H8
Public Const MOUSEEVENTF_MOVE = &H1
Public Const MOUSEEVENTF_MIDDLEUP = &H40
Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_ABSOLUTE = &H8000

Here is an explanation of the mouse_event API parameters:

Parameter      Description
dwFlags            A combination of the MOUSEEVENTF_xxx constants above.  I think the are pretty sraight forward.
dx, dy            Specifies the absolute position or relative movement depending on if the MOUSEEVENTF_ABSOLUTE flag is specified.
cButtons      Unused
dwExtraInfo      Typically unused
      
' ---------------------------------------------------------------------------------------------------
'In order to open the folders...use

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Useage:

lRet = ShellExecute(Me.hWnd, vbNullString, [PathToOpen], vbNullString, "C:\", 1)

' ---------------------------------------------------------------------------------------------------

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1434810
Bought This Question.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

771 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