Using C++builder to implement Windows 2000 Messenger

Source: Internet
Author: User

This article describes how to use C++builder to implement a detailed approach to Messenger, which uses the following techniques:

1. Multi-line program technology to prevent deadlock in the interface.

2. The network enumeration is used to enumerate online users.

3. Converting from ansistring to Unicode using Unicode conversion functions.

4. The use of Simple irregular window technology.

5. Install automatically and add yourself to the system start-up.

6. System Tray Technology.

Programming Method:

1. Some controls added to the form as shown in the Picture: tlistview,ttreeview,tmemo, menus, trays, buttons, status bar

2. Add code for each control as written in this article.

3. The following is the sending function

void __fastcall Tformmain::buttonsendclick (tobject *sender)
{
ansistring message,username,fromname;
Tlistitem *listitem;
if (checkboxanony->checked) fromname=editanony->text;
Else Fromname= "";
message=memo1->text;
if (message== "") {showmessage ("Please Enter words to send");
if (! Listview1->selcount) {
if (treeview1->selected==null) {showmessage ("Please select Destnation");
username=treeview1->selected->text;
if (treeview1->selected->level==1) username=username+ "*";
New Netmessagesend (false,username,fromname,message,checkboxgetret->checked);
return;  
}
listitem=listview1->selected;
username=listitem->caption;
if (treeview1->selected->level==0) username+= "*";
while (username[1]== ' \]) username=username.substring (2,username.length ()-1);
New Netmessagesend (false,username,fromname,message,checkboxgetret->checked);
for (int i=1;iselcount; i++) {
Listitem=listview1->getnextitem (listitem,sdall,titemstates () < username=listitem->caption;
if (treeview1->selected->level==0) username+= "*";
while (username[1]== ' \]) username=username.substring (2,username.length ()-1);
New Netmessagesend (false,username,fromname,message,checkboxgetret->checked);
}
}

Here is the Network node enumeration function, which is a thread.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.