Solved

Shell Execute Lib

Posted on 2001-07-08
7
502 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
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

743 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

15 Experts available now in Live!

Get 1:1 Help Now