Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common functions of VC

Shulou Source: shulou.com Published: 2022-06-03 05:54:00 10月04日 Update

What are the common functions of VC? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

SetWindowPos

Function function: this function changes the size, position and Z order of a child window, pop-up top-level window. Child windows, pop-up windows, and top-level windows are sorted according to the order in which they appear on the screen, the top-level window is set to the highest level, and is set to the first window in Z order.

Function prototype: BOOL SetWindowPos (HWN hWnd,HWND hWndlnsertAfter,int Xjinint Yjinint cx,int cy,UNIT.Flags)

SetWindowLong

Function function: this function changes the properties of the specified window. the function also sets a specified 32-bit value at the specified offset of the window's additional storage space. Function prototype: LONG SetWindowLong (HWND hWnd,int nlndex,LONG dwNewLong)

ClientToScreen and ScreenToClient (transfer) ClientToScreen (

) is to convert window coordinates to screen coordinates

ScreenToClient () converts screen coordinates to window coordinates

The screen coordinates are relative to the upper left corner of the screen, while the window coordinates are relative to the upper left corner of the window user area.

Under VC, some functions use window coordinates and some use screen coordinates, which should be distinguished when used.

A form is divided into two parts: system area and client area

Things like titles and menus are system areas, which are controlled by the system, and the client area is your territory!

Width, Height refers to the whole, ClientWidth, ClientHeight refers to the client area, the two subtract

In the system area!

ClientToScreen converts coordinates from the current form to full screen!

ScreenToClient is to convert the screen coordinates to the coordinates relative to the current form!

GetDlgItem

The function function returns the handle to the child element of the specified parameter ID in the window, and you can manipulate the child element in the window through the returned handle.

1 function description

▪

1) .CWindow::GetDlgItem

▪

2). CWnd::GetDlgItem

▪

3) .Windows SDK

IntersectRect

CRect::IntersectRect BOOL IntersectRect (LPCRECT lprcDst, LPCRECT lpRect1, LPCRECT lpRect2); IntersectRect function calculates the intersection of two source rectangles and places the coordinates of the intersection rectangle in the target rectangle. If the source rectangle does not intersect, then an empty rectangle (coordinates are both 0) is set. Return value: if the intersection is not empty, a non-zero value is returned; otherwise, 0 is returned if the intersection is empty.

After reading the above, have you mastered the common functions of VC? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Function coordinate screen rectangle system intersection function customer form Top level Common Pop-up location element content prototype handle that is upper-left corner method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Huawei Linux MySQL