Win32 API: Unmanaged equivalent Process.MainWindowHandle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShadowLocke
    New Member
    • Jan 2008
    • 116

    Win32 API: Unmanaged equivalent Process.MainWindowHandle

    Hi all,

    Can anyone tell me what the unmanaged equivalent is to get the main window handle of a process?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Can't you just pass in the managed handle reference to the unmanged code? It returns an IntPtr to the native handle?
    Code:
    myProcess.Handle
    Otherwise, just look up the Win32_API for it?

    Comment

    • ShadowLocke
      New Member
      • Jan 2008
      • 116

      #3
      Originally posted by Plater
      Can't you just pass in the managed handle reference to the unmanged code? It returns an IntPtr to the native handle?
      Code:
      myProcess.Handle
      Otherwise, just look up the Win32_API for it?

      The Win32 API is what I am looking for. I haven't found an API or solid technique to accomplish this. (Im programming in a proprietary language but have access to the API, but no access to .NET classes)

      Comment

      • ShadowLocke
        New Member
        • Jan 2008
        • 116

        #4
        Originally posted by ShadowLocke
        The Win32 API is what I am looking for. I haven't found an API or solid technique to accomplish this. (Im programming in a proprietary language but have access to the API, but no access to .NET classes)
        Found an answer:

        Last edited by Plater; May 20 '08, 12:41 PM. Reason: linking

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          If you have no access to .NET classes, why did you post in .NET forum?
          I will move this to C/C++, I think they have answers for win32_API

          Comment

          Working...