Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. where can I find the Win32 API constants for C#

where can I find the Win32 API constants for C#

Scheduled Pinned Locked Moved C#
questioncsharpjsonhelptutorial
5 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wernand
    wrote on last edited by
    #1

    Hi All, Excuse me for my bad English. Who can tell me where I can found the constants needed to program win32 api within C#. For example in the Win32 API reference, I found the following procedure: AddFontResourceEx The AddFontResourceEx function adds the font resource from the specified file to the system. Fonts added with the AddFontResourceEx function can be marked as private and not enumerable. int AddFontResourceEx( LPCTSTR lpszFilename, // font file name DWORD fl, // font characteristics PVOID pdv // reserved ); Where fl stands for Flags used to define how the private font resource is loaded. FR_PRIVATE FR_NOT_ENUM I can find in my books that these constants in C# corresponds with the flags: public const Int32 FR_PRIVATE = 0x10; public const Int32 FR_NOT_ENUM = 0x20; But now my question. Where can I find the values like 0x10, 0x20 or all the others? I can't find it anywhere, who can help me with this. Thanks and regards, Wernand The Netherlands

    W N 2 Replies Last reply
    0
    • W Wernand

      Hi All, Excuse me for my bad English. Who can tell me where I can found the constants needed to program win32 api within C#. For example in the Win32 API reference, I found the following procedure: AddFontResourceEx The AddFontResourceEx function adds the font resource from the specified file to the system. Fonts added with the AddFontResourceEx function can be marked as private and not enumerable. int AddFontResourceEx( LPCTSTR lpszFilename, // font file name DWORD fl, // font characteristics PVOID pdv // reserved ); Where fl stands for Flags used to define how the private font resource is loaded. FR_PRIVATE FR_NOT_ENUM I can find in my books that these constants in C# corresponds with the flags: public const Int32 FR_PRIVATE = 0x10; public const Int32 FR_NOT_ENUM = 0x20; But now my question. Where can I find the values like 0x10, 0x20 or all the others? I can't find it anywhere, who can help me with this. Thanks and regards, Wernand The Netherlands

      W Offline
      W Offline
      Wernand
      wrote on last edited by
      #2

      I have found it on the msdn site from Microsoft. You can simple search in C++ SDK with findstr you get then the values: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include>findstr "FR_PRIVATE" *.h WinGDI.h:#define FR_PRIVATE 0x10 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include>findstr "FR_NOT_ENUM" *.h WinGDI.h:#define FR_NOT_ENUM 0x20 :-D

      L 1 Reply Last reply
      0
      • W Wernand

        I have found it on the msdn site from Microsoft. You can simple search in C++ SDK with findstr you get then the values: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include>findstr "FR_PRIVATE" *.h WinGDI.h:#define FR_PRIVATE 0x10 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include>findstr "FR_NOT_ENUM" *.h WinGDI.h:#define FR_NOT_ENUM 0x20 :-D

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Remember to just include the WinGDI.h in your program, and not to use the values directly. Your English is very good by the way, probably better than most people's Dutch! (Zeker weten). Ciao, Pauwl

        H 1 Reply Last reply
        0
        • L Lost User

          Remember to just include the WinGDI.h in your program, and not to use the values directly. Your English is very good by the way, probably better than most people's Dutch! (Zeker weten). Ciao, Pauwl

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          Um, he's coding a C# app which doesn't use/understand include files. He has to define these (as consts, an enum, whatever) in his source.

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          1 Reply Last reply
          0
          • W Wernand

            Hi All, Excuse me for my bad English. Who can tell me where I can found the constants needed to program win32 api within C#. For example in the Win32 API reference, I found the following procedure: AddFontResourceEx The AddFontResourceEx function adds the font resource from the specified file to the system. Fonts added with the AddFontResourceEx function can be marked as private and not enumerable. int AddFontResourceEx( LPCTSTR lpszFilename, // font file name DWORD fl, // font characteristics PVOID pdv // reserved ); Where fl stands for Flags used to define how the private font resource is loaded. FR_PRIVATE FR_NOT_ENUM I can find in my books that these constants in C# corresponds with the flags: public const Int32 FR_PRIVATE = 0x10; public const Int32 FR_NOT_ENUM = 0x20; But now my question. Where can I find the values like 0x10, 0x20 or all the others? I can't find it anywhere, who can help me with this. Thanks and regards, Wernand The Netherlands

            N Offline
            N Offline
            Nick Seng
            wrote on last edited by
            #5

            Try this site[^] The examples are for VB, but I'm sure it wouldn't be too hard to translate it to C#.


            "if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler. Support Bone

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups