Memory Management [4]

An example of using a private heap: Unit unit1; interfaceuses windows, messages, extensions, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; Procedure button1click (Sender:

Get functions of the variable type

The vartype function under the variants unit can obtain the variable type, but it returns only a number. You need to combine these constants defined in the System Unit: Varempty = $0000; varnull = $0001; varsmallint = $0002; varinteger = $000

Sysutils. strcomp, sysutils. stricomp

Both strcomp and stricomp compare the pchar string size functions, but the latter is case insensitive. Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class

Sysutils. strcopy, sysutils. strecopy

Both strcopy and strecopy copy the source pchar string to the target pchar string, but the return value is different; The first address of the result returned by strcopy and the end (#0) Address of the result returned by strecopy. Unit unit1;

Sysutils. strlcat

Strlcat is similar to strcat. The extra parameter of strlcat seems to be limiting the result length. Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class

Memory Management [6]

In this example: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; memo1: tmemo; memo2: tmemo;

Winapi: offsetrect-move rectangle

In this example: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; button3: tbutton; button4: tbutton;

Winapi: setrectempty, isrectempty

Setrectempty: Empty the rectangle; Isrectempty: determines whether the rectangle is empty; The so-called rectangle is null, that is, the rectangle is region-free, or right. Unit unit1; interfaceuses windows, messages, sysutils, variants,

Getclientrect, clientrect, getwindowrect, boundsrect

Getclientrect and clientrect obtain the client rectangle of the window; Getwindowrect and boundsrect are window rectangles; In addition, there is a Windows. getclientrect (using the same method as getwindowrect, they are all API functions

Winapi: getkeynametext-Get the key name based on the keyboard message

In this example: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs; Type tform1 = Class (tform) Procedure formcreate (Sender: tobject ); procedure mymsg (var msg: twmkeydown); message

Questions about pointer initialization-reply "rainy day 2 ″

Problem Source: http://www.cnblogs.com/del/archive/2008/05/02/1179416.html#1179645 A global variable can be initialized. If you do not initialize it, it will be automatically initialized; A local variable cannot be initialized. Although you

Memory Management [1]

Windows is a multi-task operating system, and a task is an application (Application Program ), An application occupies a process; in a process, multiple threads can be run (so there are many "multi-thread programming" topics ). For Win32,

Adjust tedit text alignment

For example, align edit1 text to the right: Setwindowlong (edit1.handle, gwl_style, getwindowlong (edit1.handle, gwl_style) or es_right ); In this example: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes,

Create a special window [6]

In this example: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, extctrls; Type tform1 = Class (tform) Panel1: tpanel; Procedure formcreate (sender: tobject); Procedure panel1click

Winapi: strokepath-outlines a path

In this example: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs; Type tform1 = Class (tform) Procedure formpaint (Sender: tobject); end; vaR form1: tform1; implementation {$ R *.

Winapi: getregiondata

Getregiondata (RGN: hrgn; {region handle} P2: DWORD; {region data buffer size} P3: prgndata {regional data structure trgndata pointer, see the table below}): DWORD; {1} // If the trgndata structure is successfully returned, rename the _ rgndata

Who is faster to determine whether an object exists?

The following three methods are used to determine whether an object exists (assign value: If OBJ nil then... If Boolean (OBJ) then... If assigned (OBJ) then... Through the test below, the conclusion is that obj NIL is the slowest; Boolean (OBJ)

Winapi: setbkmode-set the background Mode

In this example: Code File: Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, extctrls; Type tform1 = Class (tform) radiogroup1: tradiogroup; procedure

Winapi: Wrong rect, wrong Sid, and wrong prefixsid-determine whether a rectangle (or other structures) is equal

Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; button3: tbutton; Procedure button1click (Sender: tobject);

# Use of symbols-Reply to "cook"

Problem Source: http://www.cnblogs.com/del/archive/2008/05/19/1089944.html#1203165 1. # This character can be represented by a character encoding followed by a decimal or hexadecimal character encoding; For example, the character "a" is encoded in 6

Total Pages: 64722 1 .... 54253 54254 54255 54256 54257 .... 64722 Go to: GO

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.