◇ [Delphi] Network neighbor replication file Uses shellapi; copyfile (pchar ('newfile.txt'), pchar ('// computername / direction / targer.txt'), false); ◇ [Delphi] produces mouse drag effect Mousemove event, Dragover event, Enddrag event implementation, Label: Var XPanel, Ypanel, XLabel, Ylabel: Integer; xPanel: = x; Ypanel: = Y; PANEL DRAGOVER Event: XPanel: = X; YPANEL: = Y; Label Mousemove event: xlabel: = x; ylabel: = y; Label's enddrag event: label.left: = xPanel-xlabel; label.top: = YPANEL-YLabel; ◇ [Delphi] obtaining WINDOWS directory uses shellapi; var windir: array [0..255] of char; getwindowsdirectory (windir, sizeof (windir)); or read from the registry location: HKEY_LOCAL_MACHINE / Software / Microsoft / Windows / CurrentVersion SystemRoot key , Acquisition, C: / Windows [Delphi] on Form or other container, line VAR X, Y: array [0..50] of integer; canvas.pen.color: = CLRED; canvas.pen.style: = psdash; form1.canvas.moveto (Trunc (x [i]), trunc (y [i])); Form1.canvas.LineTo (Trunc (x [j]), trunc (y [j])); ◇ [Delphi] string list uses var tips: tstringlist; tips: = tstringlist.create; tips.loadfromfile ('filename.txt'); edit1.text: = tips [0]; tips.add ('Last Line Additional String " Tips.Insert (1, 'INSERT STRING AT NO 2 LINE'); Tips.Savetofile ('newfile.txt'); tips.free; ◇ [Delphi] Simple clipboard operation Richedit1.selectall; Richedit1.copytoclipboard; richedit1.cuttoclipboard; Edit1 .pastefromclipboard; ◇ [Delphi] About file, directory operation chDIR ('c: / abcdir'); go to directory MKDIR ('DIRNAME'); establish directory RMDIR ('DIRNAME'); delete directory getCurrentDir; // Take the current directory Name, no '/' getdir (0, s); // Take the work directory name s: = 'c: / abcdir'; deleetfile ('abc.txt'); // Delete file renamefile ('ild.txt', 'new.txt'); // Document Name ExtractFileName (fileListBox1.FileName); // Take the file name extractfileext (filelistbox1.filename);
// Take a file suffix ◇ [Delphi] Process file attribute Attr: = filegettt (fixelistbox1.filename); if (attr and fareadonly) = FareadOnly kil1 ... // read-only if (attr and fasysfile) = FasystemFile Then ... // System IF (attr and faarch) = faarchive the ... // Archive IF (attr and fahidden) = Fahidden Then ... // Hide ◇ [Delphi] Export Out-of-Document file Winexec // Call executable Winexec 'command.com / c copy * * c: /.', SW_Normal); winexec ( 'start abc.txt'); ShellExecute or ShellExecuteEx // startup file associated program function executefile (const filename, params, defaultDir: string; showCmd : integer: Thandle; Executefile ('c: /abc/a.txt', 'x.abc', 'c: / abc /', 0); Executefile ('http://tingweb.yeah.net ", '', '', 0); EXECUTEFILE ('Mailto: Tingweb@wx88.net', '', '', 0); ◇ [Delphi] gets the system running process name var HcurrentWindow: hwnd; sztext: array [0 ..254] of char; begin hCurrentWindow: = Getwindow (handle, GW_HWndFrist); while hCurrentWindow <> 0 do begin if Getwindowtext (hcurrnetwindow, @ sztext, 255)> 0 then listbox1.items.add (strpas (@sztext)) HcurrentWindow: = getWindow (hcurrentwindow, gw_hwndnext); end; end; ◇ [delphi] About assembly embedding ASM END; can be arbitrarily modified Eax, ECX, EDX; Modify ESI, EDI, ESP, EBP, EBX. ◇ [Delphi] About Type Conversion Function FLOATTOSTR / / Floating Stroke Floattostrf // Floating Point Run Strings INTTOHEX // Integer Transfer 16 Enter TimeTStr DateTostr DateTimetostr FMTSTR DATSTR DATIMETOSTR FMTSTR DATOSTR DATIMETOSTR FMTSTR DATOSTR DATIMETOSTR FMTSTSTR DATOTSTIMETIMETIME FORMATDATDATIME FORMATDATIME (' YYYY-MM-DD, HH-MM-SS ', date); ◇ [Delphi] string process and function INSERT (OBJ, TARGET, POS); // String Target is inserted in POS. If the insertion result is greater than the maximum length of Target, multiple characters will be cut off. Such as POS is 255, it will generate an error. For example, st: = 'brian', INSERT ('OK', ST, 2) will make ST to 'Brokian'. Delete (ST, POS, NUM); // From the POS (integer) position in the ST string, the number of substrings of NUM (integer) characters are started. For example, st: = 'brian', the delete (ST, 3, 2) will become BRN.
Str (Value, ST); // Convert value value (integer or real) into a string in ST. For example, when A = 2.5E4, the STR (A: 10, ST) will make the value of the ST '25000'. VAL (ST, VAR, CODE); // converts string expressions to a corresponding integer or real value, stored in VAR. St must be a string representing a value and complies with the rules of the numerical constant. During the conversion process, if an error is not detected, the variable code is set to 0, otherwise it is positioned as the first error character. For example, st: = 25.4e3, X is a real variable, the VAL (ST, X, CODE) will make the X value of 25400, the Code value is 0. Copy (st.pos.num); // Returns a substring containing Num (integer) characters at a position POS (integer) in the ST string. If the POS is greater than the length of the ST string, it will return an empty string. If POS is outside 255, it will cause an error. For example, st: = 'brian', then COPY (ST, 2, 2) returns 'ri'. Concat (ST1, ST2, ST3 ..., STN); // Connect all the strings indicated by all the variables, and returns the connected value. If the length 255 of the result will generate an operation error. For example, St1: = 'brian', ST2: = '', ST3: = 'WILFRED', then CONCAT (ST1, ST2, ST3) returns 'Brian Wilfred'. Length (ST); // Returns the length of the string expression ST. For example, St: = 'brian', the longth (ST) returns 5. POS (OBJ, TARGET); // Returns the first appearance of the string OBJ at the target string Target, if the target does not match the string, the return value of the POS function is 0. For example, Target: = 'Brian Wilfred', the return value of POS ('WIL', TARGET) is 7, and the return value of POS ('Hubet', Target) is 0.
◇ [Delphi] About Processing Registry Uses Registry; Var REG: Tregistry; Reg: = Tregistry.create; REG.ROOTKEY: = 'HKEY_CURRENT_USER'; Reg.OpenKey ('Control Panel / Desktop', false); reg.writestring 'Title Wallpaper', '0'); reg.writeString ( 'Wallpaper', filelistbox1.filename); reg.closereg; reg.free; ◇ [DELPHI] on the keyboard constant name VK_BACK / VK_TAB / VK_RETURN / VK_SHIFT / VK_CONTROL / VK_MENU / VK_PAUSE / VK_ESCAPE / VK_SPACE / VK_EFT / VK_RIGHT / VK_UP / VK_DOWN F1 - F12: $ 70 (112) - $ 7B (123) AZ: $ 41 (65) - $ 5A (90) 0-9: $ 30 (48 $ 39 (57) ◇ [Delphi] Preliminary judgment program Native DELPHI software DOS Tips: This Program Must Be Run Under Win32. VC software DOS Tips: This Program Cannot Be Run in Dos Mode. ◇ [Delphi] Operation Cookie Response.cookies ("name") .Domain: = 'http://www.086net.com'; with response.cookies.add do beg, name: = 'username'; value: = 'username'; end ◇ [Delphi ] Added to the document menu connection Uses shellapi, shlobj; shaddtorecentdocs (Shard_path, pchar (filepath)); // Added ShaddtoreCentDocs (Shard_Path, NIL); // Empty ◇ [Miscellaneous] Backup Intelligent ABC Input French Word Windows / System / user.rem windows / system / tmmr.rem ◇ [Delphi] Judgment Mouse Buttons If getasynckeyState (vk_lbutton) <> 0 THEN .. . // Left IF getasynckeyState (vk_mbutton) <> 0 THEN ... / / Middle key if getasynckeyState (vk_rbutton) <> 0 the ... // Right-click [Delphi] Set the maximum display of the Form onFormCreate event Self. width: = screen.width; self.height: = screen.height; ◇ [DELPHI] button OnCreate event message receiving processing: Application.OnMessage: = MyOnMessage; procedure Tform1.MyOnMessage (var MSG: TMSG; var handle: Boolean) Begin if msg.Message = 256 Then ... // Any key if msg.Message = 112 Then ... // f1 if msg.Message = 113 Then ... // f2 end; ◇ [Miscellaneous] Hide Shared folder sharing effect: Access, but invisible (in resource management, network neighbors) Take a shared name: Direction $ Access:
// Computer / Dirction / ◇ [Java Script] Java Script webpage Common effects page 60 second timing Close