zoukankan      html  css  js  c++  java
  • Windows 7下VS2008升级

    本方法由同事薛军涛首创,本人以通用程序实现。

     

    在Windows 7下,VS2008试用版无法正常升级到正式版。原因是维护页面的注册码输入框和升级按钮被隐藏。通过本补丁,可让注册码输入框和升级按钮恢复正常显示。

    补丁下载地址

    ------------------------------------------------------------

    关键函数如下:

    void CREGVS2008Dlg::OnBnClickedButtonAutoreg()
    {
     HWND hWnd;
     INT i;

     // 定位“Microsoft Visual Studio 2008 安装程序 - 维护页”窗口
     hWnd = ::FindWindow( NULL, TEXT("Microsoft Visual Studio 2008 安装程序 - 维护页") );
     if( hWnd == NULL )
     {
      hWnd = ::FindWindow( NULL, TEXT("Microsoft Visual Studio 2008 Setup - Maintenance Page") );
      if( hWnd == NULL )
      {
       MessageBox( TEXT("没有发现“Microsoft Visual Studio 2008 安装程序 - 维护页”窗口!") );
       return;
       
     }

     // 进入第1层子窗口
     hWnd = ::GetTopWindow( hWnd );

     // 进入第4个子窗口
     for( i = 0; i < 3; i++ )
     {
      hWnd = ::GetNextWindow( hWnd, GW_HWNDNEXT );
     }

     // 进入第2层子窗口
     hWnd = ::GetTopWindow( hWnd );

     // 进入第9个子窗口
     for( i = 0; i < 8; i++ )
     {
      hWnd = ::GetNextWindow( hWnd, GW_HWNDNEXT );
     }

     // 进入注册码填写窗口
     for( i = 0; i < 5; i++ )
     // 激活文本框
      ::ShowWindow( hWnd, SW_SHOW );
      ::EnableWindow( hWnd, TRUE );

      // 进入下一个文本框
      hWnd = ::GetNextWindow( hWnd, GW_HWNDNEXT );
     }

     // 进入升级按钮
     for( i = 0; i < 2; i++ )
     {
      hWnd = ::GetNextWindow( hWnd, GW_HWNDNEXT );
     }

     // 激活升级按钮
     ::ShowWindow( hWnd, SW_SHOW );
     ::EnableWindow( hWnd, TRUE );

     return;
    }

  • 相关阅读:
    [C++] split string by string
    工作三个月心得经验
    Ubuntu Command-Line: Enable Unlimited Scrolling in the Terminal
    What is the PPA and How to do with it ?
    WCF vs ASMX WebService
    The ShortCuts in the ADT (to be continued)
    when does the View.ondraw method get called
    Browsing Storage Resources with Server Explorer
    Get start with Android development
    C++ Frequently asking question
  • 原文地址:https://www.cnblogs.com/skyshenwei/p/1635730.html
Copyright © 2011-2022 走看看