Data structures in the Windows API

Source: Internet
Author: User
Tags java se

It is worth noting that Win32 development is a C language programming, therefore, it is very important to understand the data type. Windows API re-defines some data types with typedef or define macros for historical reasons or for convenience in Windows.h.

    • UINT represents an unsigned integer unsigned int in the C language
    • PSTR = string pointer char *
    • WPARAM represents unsigned short int in a 16-bit period of windows and is now a uint
    • LPARAM means long
    • The return type of the WndProc function lresult is actually a long
    • The ingress function WinMain the specified WINAPI and WndProc are indicated by the _stdcall, which represents the way in which the parameters of a function call occur between Windows and the user application.

In addition, handles are a large number of types used in Windows APIs, such as HInstance, HWND, HDC, Hicon, Hcuror, Hbrush. They are actually a 32-bit integer that represents a particular object. As far as I know, this thing seems to be a legacy of windows in a single-tasking period, marking different instances of the same program so that memory inheritance can precede them.

Windows variables conform to Hungarian notation, with the first lowercase letters representing the type attributes of the variable, such as:

    • SZ in szCmdLine represents a string ending with "\"
    • The letter H at the beginning of HInstance and hprevinstance represents the handle handle
    • The starting letter I of the icmdshow indicates the integer type

And for structural variables, such as MSG structure, it is directly expressed with MSG; WNDCLASS structure wndclass; Paintstructure structure PS, and so on.

Now look at what Windows really deserves to learn, be able to build a system kernel and application layer in C, and then encapsulate Windows APIs in other languages, building com, ATL, MFC, and so on. NET and so on to a higher level of development layer. Now the visual Studio2015 actually embeds the Java SE Development, a platform that can write desktop, Mobile Phone, Android, iOS programs. It's too expensive to hear that Windows is the most cherished programmer's platform, but now visual Studio 2015 has free licensed Community Edition lisence available.

Data structures in the Windows API

Related Article

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.