Results 1 to 8 of 8

Thread: Value of constants

  1. #1

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Resolved Value of constants

    I want to use the following API function: http://msdn.microsoft.com/library/de...ure_window.asp

    How do i know what values the following constants should be set to?

    WS_CHILD
    WS_VISIBLE

    p.s. These constants are described here, but no values are listed

    http://msdn.microsoft.com/library/de...ndowStyles.asp
    Last edited by x-ice; Feb 24th, 2007 at 07:16 PM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Value of constants

    Code:
    // Constant values were found in the "windows.h" header file.
        private const int WS_CHILD = 0x40000000,
                          WS_VISIBLE = 0x10000000;

  3. #3

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Value of constants

    Quote Originally Posted by Hack
    Code:
    // Constant values were found in the "windows.h" header file.
        private const int WS_CHILD = 0x40000000,
                          WS_VISIBLE = 0x10000000;
    Do would i go about finding these constants myself?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Value of constants

    Quote Originally Posted by x-ice
    Do would i go about finding these constants myself?
    I Googled them and Google returned a link to MSDN, so I would image it would be easier just to eliminate the middle man and go straight to MSDN.

  5. #5

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671
    Ok thanks

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Value of constants

    One thing that you should note however, is that MSDN isn't always that straight forward.

    For example, this is the MSDN link that Google returned. In order to find those declares, you have to scroll about half way down the page until you see a C# example (you will go through a VB and C++ example before you get to C#).

    That is the way it is with a lot of their examples, so if you don't see what you are looking for when the page loads, just scroll around. You will probably find it.

  7. #7

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Value of constants

    Quote Originally Posted by Hack
    One thing that you should note however, is that MSDN isn't always that straight forward.

    For example, this is the MSDN link that Google returned. In order to find those declares, you have to scroll about half way down the page until you see a C# example (you will go through a VB and C++ example before you get to C#).

    That is the way it is with a lot of their examples, so if you don't see what you are looking for when the page loads, just scroll around. You will probably find it.
    Yes, i noticed that.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Value of constants

    The Windows API documentation on MSDN was originally written for C++ developers. It thus assumes that you have the header file in which those constants are declared, so it doesn't need to tell you. I've always been able to find an example on the Web that uses any constant that I've needed to use, so Google is the first place to go. You may also find an example in the API-Guide, which you can download an install locally.

    Edit: I just had a quick look at www.pinvoke.net and thay have a list of constants accessible from the menu on the left-hand side. I don't know if it is absolutely complete but it is extensive.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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