Home > Software engineering >  How to learn Windows programming
How to learn Windows programming

Time:11-06

The following content from: https://zhuanlan.zhihu.com/p/24773204





One is to cheat, but good things to share, and need to learn together




There are a lot of the early introduction of children said to me, they want to learn the "bottom" technology, because of high technical content, so want to learn the Windows c + + development, watching calls in the parameters of the super, super trouble to call the Windows API, feel cool, so I thought, had this article, according to the I do Windows client experience for many years, with you about Windows c + +, the start from which on the one hand, this will not be a technical depth, and only occasionally involves some terms and some introductory books, for the veteran Windows development, should be looking at fun,

First of all to talk about the original Windows development,

如果打开"Windows程序设计"这本书,关于Windows开发的来龙去脉就一目了然了,但是要注意,"Windows程序设计"是一本纯讲述Windows API的书,确切的说,这本书主要讲的是关于Windows 用户态的API,也就是User32.dll GDI32.dll这两个库文件中的函数,大部分的内容都是关于Windows最基本的窗口元素的操控方面的API,比如创建窗口,绘制窗口,关闭窗口,消息循环等等,这本书不需要你有C++方面的知识,理论上说只要你有C语言的基础就可以看懂,但是如果你连C语言的基础也没有,看这本书可能会发生一些困难,如果你学过其它一门非面向对象的语言,这本书实际上也能够勉强看懂,我在大学的时候就看了这本书,但是直到现在也没有看完,书中的某些知识,实际上在Windows开发中已经很少用到了,我个人认为是没有必要把这本书从头到位看一遍的,在看了前面几章以后,我就蠢蠢欲动,写了一些简单的程序,迅速巩固了关于这些API调用的记忆,为今后进化到Windows C++阶段打下了一个良好的基础,所以,写程序是很重要的,这个阶段,我建议大家写一些简单的程序,比如打字测速程序,自己创建一个消息循环,创建一个窗口,创建一个光标,用GDI函数输出图形及文字,这样下来,基本的Windows程序设计概念就有了,不过注意写的时候不要大段的Copy书上的代码,全部自己写,否则无助于理解各个API的含义,这个程序,因为是自己写的第一个Windows程序,所以时间限定在一个月到一个半月之内比较合适,度过这个阶段以后,Windows编程的基本概念就应该在你脑海中形成了,

Below to enter the second stage, that is, the c + + style Windows development, which is of great demand on workplace Windows c + + programmers do,

Then you need to know the things of the old called MFC, MFC is what, is actually a very primitive, with code to c + + library of the border, of course, because it is a library of c + +, so you must have some knowledge of c + +, but don't because the original small it, MFC than the traditional way of Windows SDK development is a major step forward, because no matter how to say, it managed to touch the little edge of object oriented, have a little the meaning of object oriented, such as a window that can be encapsulated into CWnd class, there is a member function to create window, map function also is encapsulated in the window, the window of the CWnd and there will be other derived classes, such as the CView CFrameWnd and various window control, to learn MFC, you're basically on Windows introduction to c + + development, in other words, if you learn to be pass, should be able to find in the market of Windows c + + development work, in fact, now many companies still use MFC the workhorse, although the MFC with popular degree of easy to use interface library now worse than it is too far away, but the MFC interface with high efficiency, rich details to manipulate it remains indisputable facts,

At this stage, you can do some simple slightly obtained a mesa program, such as the development of a based on the core IE browser, the reason I asked you to develop the program, because IE related developments can learn a lot of knowledge related to COM, COM also is indispensable skill for Windows client developers, it's like MFC the tenacious vitality, even worse,

This stage, if you are familiar with the MFC enough, you can also contact the WTL this lightweight template interface library, actually if there is the foundation of MFC, the learning process of WTL is very happy, many concepts of the MFC, such as message mapping, have corresponding things in WTL, WTL is smaller, the encapsulation of higher-end (template library), but the official Microsoft does not support, so unlike the MFC have special documentation on MSDN, most importantly, WTL and ATL can combine very well, which makes the WTL invoked on ATL COM components written or written ATL COM component invokes the WTL window become simple and easy, so, in my temper, now is more recommend use WTL instead of MFC, but there is no doubt that WTL learning cost is higher, so many things,

Next, it's time to learn COM, COM, or several books about the basic theory of the COM to see, such as "COM technology insider" this book I recommend better, more shallow, is suitable for the beginners, COM also pan aimin "COM principle and application", also I have ever seen so so also ok, although still feeling in front of the better, as far as the acclaimed "COM essentialism", I think don't look at, look at the beginning of the book, didn't see a few pages of distraction, it is obscure, I say, "COM essentialism" this book, if you don't have a good c + + or don't see the, pure difficult for oneself,

Wait to have the basic concept of COM, you can see "in-depth analytical ATL, ATL is used to write COM, although it also encapsulates some window, controls, but this book is a little bit of deep, large section of the code, beginners look or have difficulty, I had a lot of places is force yourself to finish, after finished, the harvest is not small,

In development experience do you have a Windows program, you can see "Windows core programming, this book is about Windows kernel of all things, such as process, the kernel object, thread, DLL, SEH, in my opinion, this book echo each other at a distance" Windows programming ", make up for the deficiencies of the former, the large space tells the story of Kernel32. DLL function, inside a lot of the book I've read several times, one of the top three domestic Internet company interview, the interviewer's many questions in this book are all things, so it is strongly recommended that you take this book to learn well,

Summary, reading is very important, but don't forget to write the code, I have to feel, the time of reading and writing code in favour is better, learn war war, knowledge comes from practice, this is the most important thing,

CodePudding user response:

A top, a long way to go ah, I also started from "Windows programming",

CodePudding user response:

This author is about to do the client... As written don't know how many IE browser kernel programmers don't think beginners need to learn programming IE... Most of the interface or don't do IE engine, to learn COM up to ADO, DirectX are more versatile, such as components,

Is learn VC after work, I see the MSDN (cd-rom version, when the network is a dial-up, online can't see) and Visual c + + the sample code began to work after a month, after to get started is to run the Windows SDK sample, after all, do the development of the Windows message loop and thread synchronization of these two fundamental to learn, COM is it took six months to understand, the boss will not wait that long,

CodePudding user response:

refer to the second floor Jiang Sheng response:
the author is about to do the client... As written don't know how many IE browser kernel programmers don't think beginners need to learn programming IE... Most of the interface or don't do IE engine, to learn COM up to ADO, DirectX are more versatile, such as components,

Is learn VC after work, I see the MSDN (cd-rom version, when the network is a dial-up, online can't see) and Visual c + + the sample code began to work after a month, after to get started is to run the Windows SDK sample, after all, do the development of the Windows message loop and thread synchronization of these two fundamental to learn, COM is it took six months to understand, the boss will not wait that long,

People?? Automation, in fact I do not do programming, a electron microscope on hand, is a UVC camera. A picture button above, know about the USB with a week, also caught the key packet, understand the UVC is a standard protocol, can look online have introduced by directshow capture key event, to see miss lu programming guide, because don't know how Com this stuff, see of fog, and in a week then at pan Com principle and application of former three chapters, the Com is a little shallow understanding, and looking back the book teacher lu, introduces Com can finally can accept a little before, but there are many functions to the link that look not to understand, lost the , don't know where to learn, have more popular directshow books? Also look at elder to give directions

CodePudding user response:

reference 1st floor mmcanyu response:
a, a long way to go ah, I also started from "Windows programming",

People?? Automation, in fact I do not do programming, a electron microscope on hand, is a UVC camera. A picture button above, know about the USB with a week, also caught the key packet, understand the UVC is a standard protocol, can look online have introduced by directshow capture key event, to see miss lu programming guide, because don't know how Com this thing, the book's leave a, fog, and in a week then at pan Com principle and application of former three chapters, the Com is a little shallow understanding, and looking back the book teacher lu, introduces Com can finally can accept a little before, but there are many functions to the link that look not to understand, lost the , don't know where to learn, have more popular directshow books? Also look at elder to give directions

CodePudding user response:

reference 1st floor mmcanyu response:
a, a long way to go ah, I also started from "Windows programming",

Can you leave a WeChat, learning together

CodePudding user response:

Directshow I'm chew directx SDK sample directly, but now directshow moved to Windows SDK inside,nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related