Solved

Desktop Icons and Mouse

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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 …
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…
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…
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…

734 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