form.handle
调用api函数查找工具栏

解决方案 »

  1.   

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    public static extern IntPtr FindWindowEx(IntPtr parent, IntPtr next, string sClassName, string sWindowTitle);
    用这个API来获取工具栏上的一个按扭的HandleBtn,如果返回值HandleBtn.ToInt32() <= 0则说明工具栏不存在
    如:FindWindowEx(handleWinForm,IntPtr.Zero,"Button","BtnCaption")
      

  2.   

    获取工具栏上的一个按扭的句柄handleBtn
      

  3.   

    你可以打开VS自带的Spy++工具查看