none
VB 2010 Wrapped WIN32

    Question

  • Where can I find a complete listing of the Win32 functions that are wrapped in VB2010, along with their call formats?  The only one I seem to find is Registry access.  My short-list is "PostMessage", "SendMessage", "FindWindow", and "FindWindowEx".

    Thanks, X.

    Wednesday, July 03, 2013 4:15 AM

Answers

  • Thanks everyone, Pinvoke appears to have what I'm looking for.

    • Marked as answer by xytsrm2 Friday, July 05, 2013 3:24 AM
    Friday, July 05, 2013 3:24 AM
  • Thanks Acamar,

    It's a good list, mapping Win32 to the Net Framework.  Too bad it doesn't include the Net Framework call parameters.

    • Marked as answer by xytsrm2 Wednesday, July 10, 2013 1:48 PM
    Wednesday, July 10, 2013 1:48 PM

All replies

  • I don't know how useful you will find this, but here's an example of sendmessage wrapped in .net... I still use win32 api if I need to..

    Option Strict On
    Imports System.Runtime.InteropServices
    Public Class Form1
        Const WM_SetText As Integer = &HC
        Friend WithEvents TextBox1 As New txbx With {.Parent = Me}
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim str As String = "hello world"
            Dim ptr As IntPtr = Marshal.StringToHGlobalAuto(str)
            Dim WindowsMessage As Message = Message.Create(TextBox1.Handle, WM_SetText, IntPtr.Zero, ptr)
            TextBox1.sendmsg(WindowsMessage)
        End Sub
        Public Class txbx
            Inherits TextBox
            Sub New()
            End Sub
            Public Sub sendmsg(message As Message)
                MyBase.WndProc(message)
            End Sub
        End Class
    End Class


    “If you want something you've never had, you need to do something you've never done.”

    Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.


    Wednesday, July 03, 2013 4:45 AM
  • Thanks Paul,

    Actually what I was looking for is some listing with call-formats of all the Win32 functions currently incorporated into .Net.  However, it seems easier to stick with Win32 directly; although I understand that there are changes necessary to the standard Win32 format (e.g. Longs are now Integers, Integers are Shorts,  and IntPtr is required for function returns.

    X.

    Friday, July 05, 2013 1:47 AM
  • Maybe at http://www.pinvoke.net/

    or http://allapi.mentalis.org/apilist/apilist.php

    you could download this too I suppose http://allapi.mentalis.org/agnet/apiguide.shtml


    Please BEWARE that I have NO EXPERTISE! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become unstable or something to that effect. :) I can only surmise that is due to Global Warming of the threads.



    Friday, July 05, 2013 2:05 AM
  • Actually what I was looking for is some listing with call-formats of all the Win32 functions currently incorporated into .Net.

    You won't find any such listing.    The Win32 API calls that are incorporated into the framework are those that are required for the functions and methods of its classes.  Some of them might be implemented as a 'wrapper' in order to provide access to a particular function, but most are just a component of whatever activity the managed code needs to execute.

    Any Win32 API that you need to use can be accessed from managed code. Pinvoke gives you the calling convention for most of them.  There is nothing in the framework that controls that - if you reference the DLL and if the DLL supports that call then you can use it in your code.   So the list you are after is actually the Win32 API list.

    Friday, July 05, 2013 3:03 AM
  • Thanks everyone, Pinvoke appears to have what I'm looking for.

    • Marked as answer by xytsrm2 Friday, July 05, 2013 3:24 AM
    Friday, July 05, 2013 3:24 AM
  • Thanks everyone, Pinvoke appears to have what I'm looking for.

    This is a part of what you were referring to .  I don't know if it's ever been updated.

    http://msdn.microsoft.com/en-us/library/aa302340.aspx

    Saturday, July 06, 2013 12:23 PM
  • Thanks Acamar,

    It's a good list, mapping Win32 to the Net Framework.  Too bad it doesn't include the Net Framework call parameters.

    • Marked as answer by xytsrm2 Wednesday, July 10, 2013 1:48 PM
    Wednesday, July 10, 2013 1:48 PM