0

I need to return the IntPtr of the windows windows media player, but only that when it goes through the IntPtr line it returns 0x00000000 ie IntPtr.Zero. This should not be happening because it is the Windows Media Player itself.

I've already left the Windows Media Player window open while debugging this code, but it still returns IntPtr.Zero. What do I need to do to change this?

At the time of giving the command below, returns 0x00000000

IntPtr hWnd = FindWindow("wmplayer", null);

Here is the code

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

public IntPtr ScreenHandle() {
    IntPtr hWnd = FindWindow("wmplayer", null); // here is the problem   
    return hWnd;         
}
sYsTeM
  • 37
  • 3
  • 18

0 Answers0