C# 2008[DllImport("User32.dll")]
public static extern IntPtr FindWindow(string className, string windowName);当我调用这个函数的时候
我知道在英文版的时候windowName是 "Windows"
而在中文版的时候   windowName是 "窗口"
在其他的版本有其他的名字,
我怎么样才能让正确的知道  windowName?
希望有人帮我解决下,再次先 诚挚的感谢!

解决方案 »

  1.   

    好像有点难,不会,帮你顶(是不是可以用类名className,这个一般都一样)
      

  2.   

    查看了 MSDN,关于此方法的说明,贴一段代码:
    Visual C++  Copy Code 
    // activate an application with a window with a specific class name
    BOOL CMyApp::FirstInstance()
    {
       CWnd *pWndPrev, *pWndChild;   // Determine if a window with the class name exists...
       pWndPrev = CWnd::FindWindow(_T("MyNewClass"), NULL);
       if (NULL != pWndPrev)
       {
          // If so, does it have any popups?
          pWndChild = pWndPrev->GetLastActivePopup();      // If iconic, restore the main window
          if (pWndPrev->IsIconic())
             pWndPrev->ShowWindow(SW_RESTORE);      // Bring the main window or its popup to the foreground
          pWndChild->SetForegroundWindow();      // and you are done activating the other application
          return FALSE;
       }   return TRUE;
    }
     
    可以看出,第二个参数可以设置为 Null