HWND  hTaskWnd = FindWindow(TEXT("Shell_TrayWnd"), NULL);
if ( NULL != hTaskWnd)
{
ShowWindow(   hTaskWnd,   SW_HIDE   ) ;
}
隐藏任务是可以做到的,开始按钮就跟着一起隐藏了,但是过一段时间开始按钮,就又出来了,只剩下单独的开始按钮,没有任务栏了,不知道是什么原因产生这样的效果?求解释,后来我尝试不隐藏任务栏的情况下,单独隐藏开始按钮,没有成功,在spy++里面,看不到开始按钮的属性,也可能是我对spy++使用得不熟练,有谁知道的,指点下我
HWND hDeskWnd = GetDesktopWindow();
if(hDeskWnd)
{
HWND hStart = FindWindowEx(hDeskWnd, NULL, TEXT("Button"), NULL);
if( NULL != hStart )
{
ShowWindow(hStart,SW_HIDE);
}
}
这样是不出效果的

解决方案 »

  1.   

    HWND hWnd = FindWindow(L"Shell_TrayWnd",NULL);   
    HWND hStar =FindWindowEx(NULL,NULL,L"Button",NULL);ShowWindow(hWnd,SW_HIDE);
    ShowWindow(hStar,SW_HIDE);
      

  2.   

    最好是有win7环境,测试过了的,给点意见或者想建议也行
      

  3.   

    在WIN7x64亲自测试:可以隐藏,但是隐藏完了之后,任务栏依然有开始按钮那个图标(只是没有了热点状态),并且还可以点击
    也就是说根本就不能用ShowWindow的方法来隐藏了.
      

  4.   

    那win7下,如果想达到隐藏开始按钮这个功能,应该从什么思路下手呢?
      

  5.   

    代码实现修改注册表;修改本地策略或者组策略
    可以看看这个
    http://social.microsoft.com/Forums/de-CH/window7betacn/thread/b2712888-594b-4bf0-9c27-23d08634b0ba
      

  6.   

    这个是屏蔽用户对win键的使用,和我想隐藏开始键,没有关系的吧?
      

  7.   


    看看这个吧 http://topic.csdn.net/u/20100614/16/b5d55c10-1d32-42af-8d36-e4dfa7e41e7c.html
      

  8.   

    Win7 64bit. The following code works.void CDialogAppDlg::OnBnClickedButton1()
    {
        // TODO: Add your control notification handler code here
        HWND hWnd = ::FindWindow(TEXT("Shell_TrayWnd"), NULL);
        if ( NULL != hWnd)
        {
            ::ShowWindow( hWnd, SW_HIDE ) ;
        }    hWnd = ::FindWindow(TEXT("Button"), NULL);
        if ( NULL != hWnd)
        {
            ::ShowWindow( hWnd, SW_HIDE ) ;
        }
    }void CDialogAppDlg::OnBnClickedButton2()
    {
        // TODO: Add your control notification handler code here
        HWND hWnd = ::FindWindow(TEXT("Shell_TrayWnd"), NULL);
        if ( NULL != hWnd)
        {
            ::ShowWindow( hWnd, SW_SHOW ) ;
        }
        
        hWnd = ::FindWindow(TEXT("Button"), NULL);
        if ( NULL != hWnd)
        {
            ::ShowWindow( hWnd, SW_SHOW ) ;
        }  }