Solved

Shell Execute Lib

Posted on 2001-07-08
7
534 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
Independent Software Vendors: 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!

 
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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

617 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