[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

Desktop Icons and Mouse

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
Bart235
Asked:
Bart235
1 Solution
 
mark2150Commented:
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
 
wj7sterCommented:
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
 
MirkwoodCommented:
Bought This Question.
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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now