Results 1 to 13 of 13

Thread: API Constants List?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    4

    Angry API Constants List?

    In all the discriptions of API functions that i read they all have constans associated with them, but it never says what values the constans are. I've searched all over the MSDN and I can never seem to find a listing of the constants and their values, alot of times API Viewer doesn't have the constants I need. So if you could just point me in the right direction to find a list like that.... that would be great. And if a list like that doesnt exist then to be more specific im tring to find the constants for the messages for the TreeView control.

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    I understand your problem completely.

    The thing to do is to download the API Guide from www.allapi.net (it has been down recently, but hopefully it's back up). It's a directory of the most common/useful API's, with examples and all sorts of info such as the Types to use and constants.

  3. #3
    Megatron
    Guest
    Since all the constants are (indirectly) written in the windows.h header file, you could use write a small C++ program to help you.
    Code:
    #include <iostream>
    #include <windows.h>
    using namespace std;
    
    int main()
    {
    	// Replace WM_QUIT with the constant name
    	cout << WM_QUIT;
    	return 0;
    }

  4. #4
    Lively Member
    Join Date
    Aug 2001
    Location
    Crossroads of America
    Posts
    72
    In vb6, there is a file at the following location:

    C:\Program Files\Microsoft Visual Studio\Common\Tools\Winapi\WIN32API.TXT

    This file includes the visual basic definitions/declarations for (almost) every API function, struct (type), constant, etc.

    Hope this helps

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    I have VC++ installed, and when I need a constant declaration which isn't in the VB API viewer, I do a search in the Microsoft Visual Studio\VC98 directory, and I almost always find what I need.

  6. #6
    Tygur
    Guest
    Yeah, if you have VC++ installed, it is very easy to find the declarations. The header files are in the "Microsoft Visual Studio\VC98\Include" directory and all the api constants are declared in them. Just look for all files in there containing the name of the constant you're looking for. Then open up the files you find in notepad and search for it. It shouldn't be too hard to translate from the C++ #declare line to the VB Const line.

    That's how I find the constants that aren't in the API Viewer

  7. #7
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Well you also google your way out of trouble. This usually gives you an example of how to implement as well.

  8. #8
    Megatron
    Guest
    Originally posted by Tygur
    It shouldn't be too hard to translate from the C++ #declare line to the VB Const line.
    C++ doesn't have a #declare directive. You're probably referring to #define.

  9. #9
    Tygur
    Guest
    Originally posted by Megatron

    C++ doesn't have a #declare directive. You're probably referring to #define.
    Whoops..
    Thanks, shows how long it's been since I had to do that..

  10. #10
    Junior Member
    Join Date
    Oct 2001
    Posts
    22

    API Constants

    If you dont know the name of the constant how can you possibly find it?

  11. #11
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    The names of the constants needed for the API functions can be found in the MSDN library.

  12. #12
    Junior Member
    Join Date
    Oct 2001
    Posts
    22
    Thank You Frans
    Pardon my ignorance but how do I access the MSDN Library? I have Visual Studio but; unfortunately, I am not well versed in any part other than Visual Basic.
    Thanks Again
    CWCookman

  13. #13
    Tygur
    Guest
    What version of Visual Studio do you have?
    If you have 6.0, you can easily get to the MSDN Library by going to the VB6 help. It's part of the MSDN Library.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width