Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Shell Execute Lib

Posted on 2001-07-08
7
Medium Priority
?
546 Views
Last Modified: 2008-02-26
I have the following at the head of code in a vb6 ap:

Private 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

What does this do?  Where can I find info about Lib functions?
0
Comment
Question by:fayb
[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
7 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 6263155
Go to http://www.mvps.org/vb/ and look for API index
0
 
LVL 7

Expert Comment

by:q2eddie
ID: 6263165
Hi, fayb.

Whenever I have a question about win apis, I usually visit some of the sites at www.mvps.org and www.allapi.net before asking it.

#Links
1. "Visual Basic Win32 Shell Routines - ShellExecute Madness"
http://www.mvps.org/vbnet/index.html?code/shell/shellexecute.htm

Bye. -e2
0
 
LVL 2

Expert Comment

by:TravisHall
ID: 6263276
Information about the API functions used most often, those which are a standard part of the OS, can be found in the Windows SDK, which is a free download from Microsoft. This document often doesn't give a lot of information about how to use API function, but it does detail what they do, parameters, return values and that sort of thing.

Sorry, I don't know the current URL for this. You should be able to find it easily enough yourself if you go to www.microsoft.com and snoop around a bit.

As for ShellExecute, it performs an operation provided by the shell specified by the lpOperation parameter, on the file specified by lpFile. Typical operations are edit, explore, find, open and print. For more details, you really should check out the Windows SDK.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6263580
ShellExecute is the real function called when you use shell function in VB, only that with that api you get more control of what is happening.
For API info, i agree with others comments: go to www.allapi.net (they have a tool with tons of explanations and source file using those apis)
0
 

Accepted Solution

by:
bppraveen001 earned 400 total points
ID: 6263798
Hello fayb,

      API (Application Program Interface) is a set of predefined Windows functions used to control the appearance and behavior of every Windows element. Every user action causes the execution of several or more API function telling Windows what's happened.

       It is something like the native code of Windows. Other languages just act as a shell to provide an automated and easier way to access APIs. VB has done a lot in this direction. It has completely hidden the APIs and provided a quite different approach for programming under Windows. But if you want to use API's explicity in VB you can do that by declaring the specified API function either in the Standard Module with Public scope or the in Module where you want to call that API function (it is better to declare these API's in the General Declration part of the Module).

       In this case ShellExecute is a API which has its declaration in shell32.dll, this API is used to open a file with its Default program. For Eg: Opening Sample.doc with MSWord document, Opening a Web Page from the Default browser.
     
       To find about the API you can use API Text Viewer application which is under Microsoft Visual Studio 6.0 -> Microsoft Visual Studio 6.0 Tools-> API Text Viewer

bpp
0
 

Expert Comment

by:bppraveen001
ID: 6263811
Hello fayb,

      API (Application Program Interface) is a set of predefined Windows functions used to control the appearance and behavior of every Windows element. Every user action causes the execution of several or more API function telling Windows what's happened.

       It is something like the native code of Windows. Other languages just act as a shell to provide an automated and easier way to access APIs. VB has done a lot in this direction. It has completely hidden the APIs and provided a quite different approach for programming under Windows. But if you want to use API's explicity in VB you can do that by declaring the specified API function either in the Standard Module with Public scope or the in Module where you want to call that API function (it is better to declare these API's in the General Declration part of the Module).

       In this case ShellExecute is a API which has its declaration in shell32.dll, this API is used to open a file with its Default program. For Eg: Opening Sample.doc with MSWord document, Opening a Web Page from the Default browser.
     
       To find about the API you can use API Text Viewer application which is under Microsoft Visual Studio 6.0 -> Microsoft Visual Studio 6.0 Tools-> API Text Viewer

bpp
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6264253
The specifics of the API have been explained by others.

www.allapi.net gives the basics of the format of the API call.

For more information try msdn.microsoft.com

V.
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!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

721 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