Chinaunix首页 | 论坛 | 博客
  • 博客访问: 735246
  • 博文数量: 769
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4985
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:37
文章分类

全部博文(769)

文章存档

2011年(1)

2008年(768)

我的朋友

分类:

2008-10-15 16:40:34

      我在看了一篇同名的文章,是用Delphi写的。试了以后效果还行,主要是利用了TDdeClientConv,于是改成CB版的贴出来。蓝色字符为手动添加的。

    Unit1.Cpp
    //---------------------------------------------------------------------------

    #include
    #pragma hdrstop

    #include "Unit1.h"
    //---------------------------------------------------------------------------
    #pragma package(smart_init)
    #pragma resource "*.dfm"
    TForm1 *Form1;
    //---------------------------------------------------------------------------
    __fastcall TForm1::TForm1(Tcomponent* Owner)
    : Tform(Owner)
    {
    }
    //---------------------------------------------------------------------------
    String TForm1::Get_URL(AnsiString Servicio)
    {
    TDdeClientConv *Cliente_DDE=new TDdeClientConv(NULL);
    char *temp;
    Cliente_DDE->SetLink(Servicio,"WWW_GetWindowInfo");
    temp=Cliente_DDE->RequestData("0xFFFFFFFF");
    Cliente_DDE->CloseLink();
    delete Cliente_DDE;
    return String(temp);
    }
    //---------------------------------------------------------------------------
    void __fastcall TForm1::Button1Click(Tobject *Sender)
    {
    ShowMessage(Get_URL("IeXPlore"));
    }
    //---------------------------------------------------------------------------

    Unit1.H
    //---------------------------------------------------------------------------

    #ifndef Unit1H
    #define Unit1H
    //---------------------------------------------------------------------------
    #include

[1]  

【责编:landy】

--------------------next---------------------

阅读(319) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~