Windows API Programming the next day 2015.11.15

Source: Internet
Author: User

Now in the company overtime, but, do not like the current job, want to go to change to C #, but the foundation is too weak, in hard study. Come on

Comment on this code another day, then go to move (Jia) Brick (ban) go ...

1#include <windows.h>2 /*3 Get System infomation and Copy to a File4 */5 intMainintargc, TCHAR argv [])6 {7     //File Handle8 HANDLE hfile;9 DWORD Dwwritten;Ten     //Char Array to Store the Path of the System infomation One TCHAR Szsystemdir [MAX_PATH]; A     //Get System Directory - getsystemdirectory (Szsystemdir, MAX_PATH); -  the     //creat File SystemRoot.txt -hfile =CreateFile ( -         "SystemRoot.txt", - Generic_write, +         0, Null,create_always, - File_attribute_normal, + NULL A         ); at     if(hfile! =Invalid_handle_value) -     { -         //Write the System infomation to the File SystemRoot.txt -         if(! WriteFile (hfile, Szsystemdir, Lstrlen (Szsystemdir), &dwwritten, NULL)); -         { -             returnGetLastError (); in         } -     } to     //Close the File + CloseHandle (hfile); -     return 0; the}
View Code

Windows API Programming the next day 2015.11.15

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.