"Sin Jeong-hun" <ty*******@gmail.comwrote in message
news:11**********************@a34g2000cwb.googlegr oups.com...
Often, I need to call Windows APIs in C#. Signatures and macro
constants can be easily found at MSDN but the constants values are not
shown. I have to search the .h file for those constants values. Is
there any online site that I can search real values for WinAPI
constatns such as PBM_SETSTATE?
The only valid resource for WinAPI constants, macro's, API declarations etc... are the
header files. You can't expect a web site to publish the header files don't you? Note that
before using you to find out whether the constant, API etc.. is supported on the target
system anyway.
Searching the header files isn't that hard, all you need is a tool like findstr.exe that you
run from the commandline to search the API constant whatever.
For instance following command:
findstr /N "PBM_SETSTATE" *.h
searches all header files in the current folder for a string PBM_SETSTATE, and takes no more
than a couple of seconds to print:
CommCtrl.h:3218:#define PBM_SETSTATE (WM_USER+16) // wParam = PBST_[State]
(NORMAL, ERROR, PAUSED)
All you need to do now is open the file in your favorite editor and go to the line number
3218 to find the constant and inspect it's context, this is a lot faster than searching a
site with the added benefit that you get the correct data.
Willy.