Solved

Desktop Icons and Mouse

Posted on 1998-09-14
3
132 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
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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now