How do I GetModuleFileName() if I only have a window handle (hWnd)?

前端 未结 5 2062
误落风尘
误落风尘 2020-12-15 11:11

I\'m trying to get the name of the executable of a window that is outside my C# 2.0 application. My app currently gets a window handle (hWnd) using the GetForegroundWindow()

5条回答
  •  醉梦人生
    2020-12-15 12:04

    try this to get the file name of the executable :

    C#:

    string file = System.Windows.Forms.Application.ExecutablePath;
    

    mfg

提交回复
热议问题