Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common functions of VC

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report