我在word里建立了一个超链接,我想获取其屏幕显示的内容,不知怎么实现。
其中Hyperlink类有个获取屏幕显示的函数GetScreenTip();但是不知怎么用,请高手指点,谢谢!

解决方案 »

  1.   

    // Create a normal DC and a memory DC for the entire screen. The 
    // normal DC provides a "snapshot" of the screen contents. The 
    // memory DC keeps a copy of this "snapshot" in the associated 
    // bitmap. 
     
    hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL); 
    hdcCompatible = CreateCompatibleDC(hdcScreen); 
     
    // Create a compatible bitmap for hdcScreen. 
     
    hbmScreen = CreateCompatibleBitmap(hdcScreen, 
                         GetDeviceCaps(hdcScreen, HORZRES), 
                         GetDeviceCaps(hdcScreen, VERTRES)); 
     
    if (hbmScreen == 0) 
        errhandler("hbmScreen", hwnd); 
     
    // Select the bitmaps into the compatible DC. 
     
    if (!SelectObject(hdcCompatible, hbmScreen)) 
        errhandler("Compatible Bitmap Selection", hwnd); 
     
            // Hide the application window. 
     
            ShowWindow(hwnd, SW_HIDE); 
     
             //Copy color data for the entire display into a 
             //bitmap that is selected into a compatible DC. 
     
            if (!BitBlt(hdcCompatible, 
                   0,0, 
                   bmp.bmWidth, bmp.bmHeight, 
                   hdcScreen, 
                   0,0, 
                   SRCCOPY)) 
     
            errhandler("Screen to Compat Blt Failed", hwnd); 
     
            // Redraw the application window. 
     
            ShowWindow(hwnd, SW_SHOW);