Important alert: (current site time 7/16/2013 2:28:19 AM EDT)
 

winzip icon

New API Viewer 1.0.3 (Final)

Email
Submitted on: 5/25/2007 8:45:16 AM
By: David Ross Goben 
Level: Advanced
User Rating: By 35 Users
Compatibility: VB 6.0
Views: 27890
author picture
(About the author)
 
     Updated to feature a binary-embedded Manifest and allowed constant lookups to be interactive. This Add-In is a working replacement for the API Viewer that comes with VB6. The New API Viewer comes as a stand-alone executable and as an Add-In to the Visual Basic 6 IDE. Additional features in the New API Viewer that are not in the standard API Viewer: * It gives you the ability to declare dynamically constants as Long in the selected local copy of a constant. This allows the user to keep program speed optimal by not slowing down for variant conversions. Although constants can be of types other than Long, the VB6 API interface uses only Long Integer values for its constants. * It gives you the ability to create new constants right within the viewer. Assigned values are expected to be numeric, as is required by the VB6 API interface, but the values can be declared as hexadecimal, octal, or binary. You can also apply + or - offsets. Constants are created as all-capitals. No complex checks are performed on the value. It simply assumes that you know what you are doing, because such checks can involve complex offsets and naming of other constants. The viewer will also check to ensure that the newly entered constant does not already exist. * It gives you the ability to create new API Declarations right within the viewer and add them to your API list. * It gives you the ability to create new User-Defined Types right within the viewer and add them to your API list. * It gives you the ability to create new Enumerations right within the viewer and add them to your API list. * You can Delete entries from the API list. * It gives you the ability to edit Declared Subroutine and Function parameter lists, and apply these changes to new subroutine or function names (for example, saving a modified version of SendMessage to SendMessageByNum, after changing the lParam as Any to ByVal lParam As Long). The built-in Declaration Editor makes such changes a breeze with just a few clicks of the mouse. * It automatic checks for new parameter dependencies. If an added declaration or user-defined type requires another user-defined type not included in the selection list, you can view the requested types in a dialog and select them or reject them for inclusion in your selection list. This can make resolving declaration headaches such as with the complicated AccessCheck Function, which requires the additional inclusion of the GENERIC_MAPPING, PRIVILAGE_SET, and SECURITY_DESCRIPTOR types. These additional types in turn require the ACL and LUID_AND_ATTRIBUTES types. These newer types in turn also require the LUID type. The New API Viewer makes farming these additional types a breeze with a few quick clicks of the mouse. * Additions created within the New API Viewer can be optionally saved for later re-used in the API data file. New entries are appended to the API file with a date- and time-stamp marker. * It immediate displays updates when you toggle between Private and Public declaration options, define parameters as arrays or fixed-length strings, change a return type, or change the referencing verb (ByRef/ByVal or None). * It includes a copy of and richly expanded freeware API32.TXT by Dan Appleman (president of Desaware, Inc.), which he had derived from the original Win32API.TXT file. On top of that, I have also included several thousand new Constants, Declarations, and Type declarations.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 15 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

4/14/2007 10:33:48 AMJason Newland

David, this is great, man. Something I've been looking for to save searching the internet for a "how do I do that API call".

Five globes :)
(If this comment was disrespectful, please report it.)

 
4/14/2007 1:24:18 PMKenneth Foster

David, nice utility.I have'nt got into depth with it but what I have looked at, shows a lot of thought.Keep it up.
(If this comment was disrespectful, please report it.)

 
4/15/2007 10:30:35 AMKenaso

I attempted to capture CopyMemory API and only received either the word Private or Public, depending on my declaration. The API before and after CopyMemory were captured perfectly.

(If this comment was disrespectful, please report it.)

 
4/15/2007 8:05:38 PMDavid Ross Goben

Kenaso, I caught that myself. I fixed it, along with adding some enhanced features such as checking for unresolved constant declarations (not a bug, but an improvement). I am uploading version 1.0.1 tonight. I'll email you the quick fix.
(If this comment was disrespectful, please report it.)

 
4/16/2007 8:38:55 AMSteppenwolfe

Most complete list of constants I have seen:
http://m00.cx/mpl/win32api.txt
(If this comment was disrespectful, please report it.)

 
4/16/2007 9:28:49 AMDavid Ross Goben

SteppenWolfe, thanks, but I have a collection of over 50,000 constants that I wish I could add, though a VB listbox control, which I use here, is limited to 32,767 entries (signed short integer). I had considered using my DynamicNodes control (CodeId=56771), but it would still require a UI. I may either write one (not really that big a task, and maybe a nice next project, unless someone else has altrady come up with one. I'll look (here I am, a professional VC++ and .NET developer, hooked on VB6 and the amazing things it can do). Another project is to write an app that reads C++ header files and converts them to VB6 Declare, Const, Type, and Enum formats for appending to our API data files.
(If this comment was disrespectful, please report it.)

 
4/16/2007 10:30:51 AMDavid Ross Goben

As a follow-up of my last note, a ListView control could easily handle 50,000 entries, but like all collection-based controls, it is MUCH slower than a listbox. But I suppose what I could do is simply take this 50,000+ list of constants and release it as two Const-only API files to support this huge list, but this sounds like more effort on the part of the user.
(If this comment was disrespectful, please report it.)

 
4/16/2007 5:52:15 PMOption Explicit

David, check out my MorphListBox submission. It can easily handle hundreds of thousands of entries, is much quicker than a standard VB listbox (even when loading n sorted order), and can easily be modified to look much more like a standard VB listbox than my admittedly gaudy examples would indicate ;)
(If this comment was disrespectful, please report it.)

 
4/16/2007 10:52:18 PMDavid Ross Goben

I will be uploading version 1.0.2, which fixed a minor bug (newly loaded constants were not being refreshed in frmAddConst.frm). Also added an enhancement: smoother resizing for the Add-In version (I followed my own advice from one of my tutorials here on PSC ;>). I am also adding over 200 new MAPI constants to the API32.txt file, plus adding 2 new API files featuring over 46,000 new constants. I think that is close to being enough to keep most people happy.
(If this comment was disrespectful, please report it.)

 
4/17/2007 10:47:23 AMskansoft

Great! 5 Globes.
(If this comment was disrespectful, please report it.)

 
4/17/2007 5:28:29 PMLaVolpe

If you are interested, I posted as part of an API Viewer parsing engine, a almost-done "listbox" that is really a picturebox. Since it only shows a few items at a time, updating it from an open file is extremely fast. Here's the post: txtCodeID=59632, it will need a little work to conform for you.
(If this comment was disrespectful, please report it.)

 
4/18/2007 9:35:16 AMMark

Thanks David, great submission! 5
(If this comment was disrespectful, please report it.)

 
5/16/2007 8:53:45 PMNicholas Adams

Excellant work. Greatly improves upon the standard API viewer that ships with VB6. I actually use this INSTEAD of the default version, although I also have the Advanced API Viewer found here on PSC and ALLAPI viewer. Now what I REALLY need is an API Viewer that combines the best features of ALL THREE! Until then I will just have to get by. haha. As a self-taught VB6 hobbyist I am greateful fo the New API Viewer. Especially its ability to expand the win32api.txt from within the interface.
Thank you.
(If this comment was disrespectful, please report it.)

 
5/26/2007 8:43:13 AMNorm Cook

Hmm, at first glance, FindFirstFile is not in the list of declares but it shows up in the api32.txt file.
(If this comment was disrespectful, please report it.)

 
5/27/2007 8:47:22 PMDavid Ross Goben

Norm, FindFirstFile shows up when I bring it up. It is declared in Win32.txt just like the other declares, so there is no reason why it should not. Strange.
(If this comment was disrespectful, please report it.)

 
5/30/2007 10:39:40 PMPaul Turcksin

It's a simple "Thanks", but it's from the bottom of my heart!
(If this comment was disrespectful, please report it.)

 
10/3/2007 11:08:46 AMKenaso

David,
To add an icon to your addin:
1. Convert your ICo file to a BMP.
2. Add this BMP to the RES file. I left the default of "101" as an index.
3. Add the RES file to the AddIn project.

In the Connect.dsr file:
1. Locate procedure AddinInstance_OnConnection
2. Locate these lines:
Set mcbMenuCommandBar = AddToAddInCommandBar("New API Viewer")
'sink the event
3. Replace the "'sink the event" line with these lines.
' ******** This will add a bitmap to the AddIn menu *********
' This command loads the bitmap with an ID of 101 to the clipboard
Clipboard.SetData LoadResPicture(101, vbResBitmap)
' Paste the bitmap from the clipboard to the command control
mcbMenuCommandBar.PasteFace
' Connect the event handler to receive the
' events for the new command bar control.

Thank you for this application and keep up the great coding.
(If this comment was disrespectful, please report it.)

 
1/8/2008 1:09:43 AMJon

thank you for sharing.

you can convert icons to bitmps in vb very quickly like this...

Add an image and picturebox to your form or whatever, and set their visible properties to false.
with the picturebox, set appearance to flat, and borderstyle to none.

Sub AddToCommandBar()

On Error GoTo AddToCommandBarErr

VBInstance.CommandBars(2).Visible = True
Set mcbMenuCommandBar = VBInstance.CommandBars(2).Controls.Add(1, , , VBInstance.CommandBars(2).Controls.Count)
mcbMenuCommandBar.Caption = "Commenter"

frmAddIn.pic.BackColor = vbMenuBar
Set frmAddIn.pic.Picture = frmAddIn.imgComment.Picture
Set frmAddIn.pic.Picture = frmAddIn.pic.Image

Clipboard.SetData frmAddIn.pic.Picture
mcbMenuCommandBar.PasteFace

Set Me.MenuHandler = VBInstance.Events.CommandBarEvents(mcbMenuCommandBar)

Exit Sub

AddToCommandBarErr:
MsgBox Err.Description

End Sub
(If this comment was disrespectful, please report it.)

 
1/20/2008 11:54:48 PMJon

Hi David, I have modified this submission. You can view it here -> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=69943&lngWId=1
(If this comment was disrespectful, please report it.)

 
4/13/2008 7:00:46 AMRobert Onutor

Thanks for a good job

Give me a feed back

Thanks again
(If this comment was disrespectful, please report it.)

 
8/28/2011 2:42:45 AMJeremy

Great code and thanks for sharing. Helpfull comments - in the code and here, though this pages text dissapears behind the grey box on the right in 1024x768 (max res for Beleina 15"), CTRL + MouseWheel donesn't reveal it. Like the SETUP1 trip in VB6 PFdir, your code here is amazingly helpfull. Wow. Many thanks.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.