.


:




:

































 

 

 

 


Windows API




Windows .

1. RegisterClass;

2. CreateWindow;

3. ShowWindow.

 

, , Windows . - . CreateWindow . , .

HWNDCreateWindow (

LPCTSTR lpClassName, // //

LPCTSTR lpWindowName, //

DWORD dwStyle, //

int x, //

int y, //

int nWidth, //

int nHeight, //

HWND hWndParent, // (handle - ) // -

HMENU hMenu, // //

HANDLE hInstance, //

LPVOID lpParam //

);

 

. , BUTTON, , , Object Pascal PChar.

. Delphi Button2. Button2 .

procedure TForm1.Button2Click(Sender: TObject);

var

hw: HWND;

begin

hw:= CreateWindow(

PChar(BUTTON),

PChar(MyWindow),

WS_VISIBLE,

100,30,

70,50,

0,

0,

0,

nil);

//ShowWindow(hw,SW_SHOW);

end;

WS_VISIBLE . CreateWindow. ShowWindow .

, MyWindow. . Windows.

. Windows. Windows .

, Form1? CreateWindow : dwStyle, hWndParent hInstance. : WS_CHILD; - -: Form1.Handle; , : hInstance. Delphi , : var HInstance: LongWord. SysInit. Windows NT/2000/XP .

, CreateWindow Form1:

hw:= CreateWindow(

PChar(BUTTON),

PChar(MyWindow),

WS_CHILD or WS_VISIBLE,

100,30,

85,50,

Form1.Handle,

0,

hInstance,

nil);

 

Windows

. , , - . , , . , , , , .. Windows API , . Pen , Brush .

CreateObject. , . SelectObject. , DeleteObject.

SelectObject , . , Windows API, , .

:

HGDIOBJ SelectObject(

HDC hdc, //

HGDIOBJ hgdiobj //

);

 

SelectObject. HGDIOBJ .

hgdiobj HGDIOBJ . :

Pen CreatePen, CreatePenIndirect

Brush CreateBrushIndirect, CreateDIBPatternBrush, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush

Font CreateFont, CreateFontIndirect

Bitmap CreateBitmap, CreateBitmapIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBSection

Region CombineRgn, CreateEllipticRgn, CreateEllipticRgnIndirect, CreatePolygonRgn, CreateRectRgn, CreateRectRgnIndirect

 

Font ; Bitmap , () ; Region , , , . , , . .





:


: 2016-10-30; !; : 950 |


:

:

- , .
==> ...

1747 - | 1561 -


© 2015-2024 lektsii.org - -

: 0.013 .