The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Jimg on March 17, 2009, 06:14:52 PM

Title: constants values
Post by: Jimg on March 17, 2009, 06:14:52 PM
Is there some site one can go to, type in a standard windows constant name, and get back a numerical value?

e.g.   I want  -  CF_NOVERTFONTS

Yes, I finally find CF_NOVERTFONTS = &H1000000 in a few places, but

searching through the Google debris that prints out is a real pain and msdn is worthless for getting actual values.

There ought to be a site for this.

Title: Re: constants values
Post by: Vortex on March 17, 2009, 06:32:08 PM
A good trick is to use the powerful and light-weighted Pelles IDE. Simply type CF_NOVERTFONTS, right click it and the IDE will open commdlg.h highlighting the definition of CF_NOVERTFONTS :

#define CF_NOVERTFONTS  0x01000000L
Title: Re: constants values
Post by: drizz on March 17, 2009, 07:02:30 PM
under masm?

PUSHCONTEXT RADIX
.RADIX 16
%ECHO CF_NOVERTFONTS =  &H&@CatStr(%(CF_NOVERTFONTS))
POPCONTEXT RADIX


Title: Re: constants values
Post by: MichaelW on March 17, 2009, 07:49:03 PM
Good idea drizz :U

Encapsulated in a macro that displays the value of a constant or the size of a structure:

WHATIS MACRO arg
  PUSHCONTEXT RADIX
  .RADIX 16
  %ECHO arg = @CatStr(%(arg))h
  POPCONTEXT RADIX
ENDM

Title: Re: constants values
Post by: Vortex on March 17, 2009, 08:32:13 PM
Nice idea :U
Title: Re: constants values
Post by: Jimg on March 17, 2009, 08:34:08 PM
?????

I have no idea what you guys are talking about.

I have no files named commdlg.h or any other .h files other than a few that are in C:\Windows\System32
I searched every file for the string and found none.
Title: Re: constants values
Post by: Vortex on March 17, 2009, 08:51:10 PM
Hi Jimg,

The .h file is from Pelles C development set.

windows.inc ( Version 1.4c RELEASE April 2008 coming with Masm32 V10 ) defines CF_NOVERTFONTS

Line 13106 :

CF_NOVERTFONTS                   equ 01000000h
Title: Re: constants values
Post by: drizz on March 17, 2009, 09:15:12 PM
Jimg, you don't have PSDK (http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm) (.h files) or Win32Inc (http://www.japheth.de/Win32Inc.html) (.inc files) ?
Title: Re: constants values
Post by: Mark Jones on March 17, 2009, 09:15:40 PM
Hey Jim, I plugged that name into this:
http://www.masm32.com/board/index.php?topic=4018.0

Then double-clicked the result to open it, and searched for that name to find:

CF_NOVERTFONTS                   equ 01000000h
Title: Re: constants values
Post by: Jimg on March 17, 2009, 10:49:28 PM
Interesting Mark.  I put it in the root of F: where I keep everything related to programming.

I put in the string and searched, but it didn't find anything.

I reset the first search path to   F:\*.*

This time when I searched, it just kept playing a three note tune over and over :)

Anyway, as you probably know, I have my own searcher here http://www.masm32.com/board/index.php?topic=7198.0

When I tried mine from the root of f:, it found
"F:\masm32\help\WIN32.HLP"
  bunch of binary stuff that drives the message editor crazy

"F:\VBProgs\a MattHart Progs\CHOOSFNT\choosfnt.frm"
141: Private Const CF_NOVERTFONTS = &H1000000

"F:\VBProgs\LogicPuzzle\Logic.frm"
2501: 'Private Const CF_NOVERTFONTS = &H1000000

"F:\VBProgs\LogicPuzzle\Baks\Logic.frm"
2207: 'Private Const CF_NOVERTFONTS = &H1000000

"F:\VBProgs\LogicPuzzle\Baks\bak0\Logic.frm"
1923: 'Private Const CF_NOVERTFONTS = &H1000000

"F:\VBProgs\LogicPuzzle\Baks\bak1\Logic.frm"
137: 'Private Const CF_NOVERTFONTS = &H1000000

"F:\VBProgs\LogicPuzzle\Baks\bak2\Logic.frm"
168: 'Private Const CF_NOVERTFONTS = &H1000000

"F:\VSCommon\Tools\Winapi\WIN32API.TXT"
15348: Const CF_NOVERTFONTS = &H1000000

"F:\WinAsm\Progs\StyleFlags\StyleFlags.asm"
318:             db  "CF_NOVERTFONTS", 0


I never thought to look in my old VB stuff. It's been ten years since I did that logic puzzle program.  I'll have to remember that old WIN32API.TXT file.

Still, these constants ought to be easily available somewhere. 
Title: Re: constants values
Post by: mitchi on March 17, 2009, 10:49:52 PM
In Visual Studio, you mouse hover the constant and the value tooltip pops up. No ?
Title: Re: constants values
Post by: Mark Jones on March 17, 2009, 11:19:23 PM
Hi Jim, I'm out of time at the moment but will check out your tool when I can. Just a note that IncFind does not recurse directories -- it is a simple tool only designed to search for wildcards in up to 5 folders. Try pointing a path to \masm32\include\*.inc or similar and see if it finds it. (Curious, are you using Vista? It hasn't been tested on Vista at all.)
Title: Re: constants values
Post by: Jimg on March 17, 2009, 11:26:48 PM
Nope.  It not in any of my include files.  What include file did you find it in?

I'm using XP sp2.  Forever.
Title: Re: constants values
Post by: Mark Jones on March 18, 2009, 02:03:28 PM
LibSearchTool found the equate in \masm32\include\windows.inc (version 1.4c.)

Just tried your tool, very handy. It too found it in the same location:

"X:\masm32\include\windows.inc"
13106: CF_NOVERTFONTS                   equ 01000000h
Title: Re: constants values
Post by: Jimg on March 18, 2009, 02:35:38 PM
How embarrasing  :red :red

I'm still using version 1.3 of windows.inc

But still, my original question stands in general.  It's not the first time I came up against an unknown constant.

And Drizz-  No, I don't have the PSDK.  It's just too huge, puts a ton of crap on my system root and in the registry, even though I install it elsewhere, and requires a help viewer I don't have or want to install.  Yes, these are all my personal problems, I understand.  Is there some where to just get all the .h files without all the hassle?

edit: I just downloaded Win32Inc from Japeth's site.  Thanks Drizz, this may be the answer. :U



Title: Re: constants values
Post by: Jimg on March 20, 2009, 02:55:43 PM
I just needed HFILE_ERROR for an api.  It wasn't anywhere in masm32, but it was in Win32Inc.  Thanks again Drizz.