求MSDN未公开的API,用于窗口前端显示的。

解决方案 »

  1.   

    BringToFront??是什么东西啊
    用来做什么啊
      

  2.   

    双击托盘图标的时候,如果FORM是隐藏的,还是好用的。如果它没隐藏,而是在其它FORM下面,就不好用了。网上说有个未公开的API,我忘了叫什么了。
      

  3.   

    //是说这2个么?
    [DllImport("User32.dll")] 
    private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow); 
    [DllImport("User32.dll")] 
    private static extern bool SetForegroundWindow(IntPtr hWnd); 
    //以上的方法声明为私有,对其进一步包装,
    /// <summary>
    /// 功能:HandleRunningInstance静态方法为获取应用程序句柄,设置应用程序为前台运行,并返回bool值。      
    /// 实现:确保窗口没有被最小化或最大化。
    ///       设置为前台显示。
    /// </summary>
    /// <param name="instance">准备设置成前台运行的程序</param>
    /// <returns></returns>
    private bool HandleRunningInstance(Process instance) 

    //确保窗口没有被最小化或最大化 
    ShowWindowAsync(instance.MainWindowHandle, WS_SHOWNORMAL); 
    //设置为foreground window 
    return SetForegroundWindow(instance.MainWindowHandle); 
    }
      

  4.   


    private const int WS_SHOWNORMAL = 1;
      

  5.   

    No , ^*^Waiting for answer ^*^
      

  6.   

    This function : SwitchToThisWindow()