473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Constants question

In C# 2.0 or better
What is the Best Way to Define Windows System Constants
WM_COMMAND, BN_CLICKED, etc

Should i use a Static Class
namespace WinConstants
{
static class Users
{
public const int WM_COMMAND = 0x0111;
}

}

or is there a Better Way now some constants change based on WINVER

Im not Sure how to handle this Situation
'in the vc Commctl.h Button Msgs change based
on the WinVer
From VC. vs studio 8 winusers.h
#define BN_CLICKED 0
#define BN_PAINT 1
#define BN_HILITE 2
#define BN_UNHILITE 3
#define BN_DISABLE 4
#define BN_DOUBLECLICKED 5
#if(WINVER >= 0x0400)
#define BN_PUSHED BN_HILITE
#define BN_UNPUSHED BN_UNHILITE
#define BN_DBLCLK BN_DOUBLECLICKED
#define BN_SETFOCUS 6
#define BN_KILLFOCUS 7
#endif /* WINVER >= 0x0400 */

Oct 14 '08 #1
3 2633
On Oct 14, 2:57*pm, "DaveL" <dvs_...@sbcglobal.netwrote:
In C# 2.0 or better
What is the Best Way to Define Windows System Constants
WM_COMMAND, BN_CLICKED, etc

Should i *use a Static Class
namespace WinConstants
{
static class Users
{
* public const int WM_COMMAND = 0x0111;

}
}

or is there a Better Way now some constants change based on WINVER

Im not Sure how to handle this Situation
'in the vc Commctl.h *Button Msgs change based
on the WinVer
From VC. vs studio 8 winusers.h

#define BN_CLICKED * * * * *0
#define BN_PAINT * * * * * *1
#define BN_HILITE * * * * * 2
#define BN_UNHILITE * * * * 3
#define BN_DISABLE * * * * *4
#define BN_DOUBLECLICKED * *5
#if(WINVER >= 0x0400)
#define BN_PUSHED * * * * * BN_HILITE
#define BN_UNPUSHED * * * * BN_UNHILITE
#define BN_DBLCLK * * * * * BN_DOUBLECLICKED
#define BN_SETFOCUS * * * * 6
#define BN_KILLFOCUS * * * *7
#endif /* WINVER >= 0x0400 */
maybe enum ???
Oct 14 '08 #2
"DaveL" <dv*****@sbcglobal.netwrote in message
news:mY***************@nlpi061.nbdc.sbc.com...
In C# 2.0 or better
What is the Best Way to Define Windows System Constants
WM_COMMAND, BN_CLICKED, etc

Should i use a Static Class
namespace WinConstants
{
static class Users
{
public const int WM_COMMAND = 0x0111;
}

}
From VC. vs studio 8 winusers.h
Sounds good, except for one picky thing: it's winuser.h, not winuserS.h, so
don't call it Users, call it User.
Oct 14 '08 #3
namespace winconstants
{
public static class WinUser
{
}
public static class CommCtl
{
{
}
and so forth

the actual class is WinUuser

i flubbed up posting it here
sorry
DaveL
"Jeff Johnson" <i.***@enough.spamwrote in message
news:e0**************@TK2MSFTNGP02.phx.gbl...
"DaveL" <dv*****@sbcglobal.netwrote in message
news:mY***************@nlpi061.nbdc.sbc.com...
>In C# 2.0 or better
What is the Best Way to Define Windows System Constants
WM_COMMAND, BN_CLICKED, etc

Should i use a Static Class
namespace WinConstants
{
static class Users
{
public const int WM_COMMAND = 0x0111;
}

}
>From VC. vs studio 8 winusers.h

Sounds good, except for one picky thing: it's winuser.h, not winuserS.h,
so don't call it Users, call it User.

Oct 14 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Raymond Hettinger | last post by:
Comments are invited on the following proposed PEP. Raymond Hettinger ------------------------------------------------------- PEP: 329
20
by: 2obvious | last post by:
I've been trying to create read-only global variables by creating constants (Const) in my global.asa, but I can't seem to reference them. Sticking them in an include works fine, but it seems more...
29
by: Joe | last post by:
This is a very basic question, but why can't I do the following ? class schedule { private: static const string mScheduleFile = "schedule.txt"; .... }
4
by: jsnX | last post by:
Say I would like my namespace to have some constants associated with it, like this: ========== ===== namespace broadpen { struct defaults { static const double w = 10.0; static const double...
8
by: Marty | last post by:
Hi, I'm new to C#, I used to code in VB.NET. Where is the best place to declare all my constants and global objects in my C# project to have them accessible globally? I have an event logger...
4
by: gabriel | last post by:
Greetings, I am working on a project and cannot choose the best way to achieve this : I got a method which returns an error code like this : DISK_FULL or PERMISSION_DENIED. Those are...
17
by: Neil Cerutti | last post by:
The Glk API (which I'm implementing in native Python code) defines 120 or so constants that users must use. The constants already have fairly long names, e.g., gestalt_Version, evtype_Timer,...
14
by: adam.timberlake | last post by:
This is a really basic question for all you people out there who know PHP. This is not a problem but just something I'm confused about. I was reading the article below and wondered why are normal...
2
by: Leslie Sanford | last post by:
I want to define a set of floating point constants using templates insteand of macros. I'd like to determine whether these constants are floats or doubles at compile time. In my header file, I have...
54
by: shuisheng | last post by:
Dear All, I am always confused in using constants in multiple files. For global constants, I got some clues from http://msdn.microsoft.com/en-us/library/0d45ty2d(VS.80).aspx So in header...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.