Access to Win API

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ladvánszky Károly

    Access to Win API

    What is the best way to access Win API functions that are not present in the
    various extension packages. Is writing a C extension the only solution?
    Thanks for any help.

    Károly


  • Gerhard Häring

    #2
    Re: Access to Win API

    Ladvánszky Károly wrote:[color=blue]
    > What is the best way to access Win API functions that are not present in the
    > various extension packages. Is writing a C extension the only solution?[/color]

    You don't have to write a C extension, you can use ctypes instead.

    -- Gerhard

    Comment

    • Ladvánszky Károly

      #3
      Re: Access to Win API

      Thanks for your help. I remember once I tried a Python cookbook sample code
      that included ctypes but now 'import ctypes' does not work.
      Should ctypes come together with the 2.3 installation?

      Károly

      "Gerhard Häring" <gh@ghaering.de > az alábbiakat írta a következo
      hírüzenetben: mailman.1063964 485.26108.pytho n-list@python.org...
      Ladvánszky Károly wrote:[color=blue]
      > What is the best way to access Win API functions that are not present in[/color]
      the[color=blue]
      > various extension packages. Is writing a C extension the only solution?[/color]

      You don't have to write a C extension, you can use ctypes instead.

      -- Gerhard


      Comment

      • Gerhard Häring

        #4
        Re: Access to Win API

        Ladvánszky Károly wrote:[color=blue]
        > Thanks for your help. I remember once I tried a Python cookbook sample code
        > that included ctypes but now 'import ctypes' does not work.
        > Should ctypes come together with the 2.3 installation? [...][/color]

        No, it's a third-party module that you need to download and install.

        Google says it's at http://starship.python.net/crew/theller/ctypes/, but
        the Starship seems to be down ATM [1]. Maybe somebody has the ctypes
        installer for Python 2.3 and can send it to you. I only have ctypes 0.2
        for Python 2.2 here ATM.

        -- Gerhard

        [1] Probably the recent virus flood bogs down the server :-/

        Comment

        • Michael Hudson

          #5
          Re: Access to Win API

          Gerhard Häring <gh@ghaering.de > writes:
          [color=blue]
          > Ladvánszky Károly wrote:[color=green]
          > > Thanks for your help. I remember once I tried a Python cookbook sample code
          > > that included ctypes but now 'import ctypes' does not work.
          > > Should ctypes come together with the 2.3 installation? [...][/color]
          >
          > No, it's a third-party module that you need to download and install.
          >
          > Google says it's at http://starship.python.net/crew/theller/ctypes/,
          > but the Starship seems to be down ATM [1].[/color]

          It's only DNS woes. Try IP 217.160.219.194 .

          Cheers,
          mwh

          --
          Darned confusing, unless you have that magic ingredient coffee, of
          which I can pay you Tuesday for a couple pounds of extra-special
          grind today. -- John Mitchell, 11 Jan 1999

          Comment

          • Gerhard Häring

            #6
            Re: Access to Win API

            Ladvánszky Károly wrote:[color=blue]
            > Thanks for your help. I remember once I tried a Python cookbook sample code
            > that included ctypes but now 'import ctypes' does not work.
            > Should ctypes come together with the 2.3 installation?[/color]

            It's available here: http://sourceforge.net/projects/ctypes

            -- Gerhard

            Comment

            • Henk Punt

              #7
              Re: Access to Win API

              And if you are going to write a GUI app for windows with ctypes, you
              might want to check out:



              It already contains a lot of usefull stuff for windows GUI programming.

              Henk.

              Gerhard Häring <gh@ghaering.de > wrote in message news:<mailman.1 063973126.25678 .python-list@python.org >...[color=blue]
              > Ladv nszky K roly wrote:[color=green]
              > > Thanks for your help. I remember once I tried a Python cookbook sample[/color]
              > code[color=green]
              > > that included ctypes but now 'import ctypes' does not work.
              > > Should ctypes come together with the 2.3 installation?[/color]
              >
              > It's available here: http://sourceforge.net/projects/ctypes
              >
              > -- Gerhard[/color]

              Comment

              Working...