Windows related knowledge

Source: Internet
Author: User
Tags ftp protocol

(i) loadmaps (); three parameters, which represent the picture ID of the effect to be selected before, in, to appear;
(ii) The difference between CreateThread and _beginthreadex
1. The main use of CreateThread in C when the multi-threaded return error code to the global variable errno is prone to error, it is easy to lead to data coverage problems arise.
2._beginthreadex each thread creation will have its own dedicated chunk of memory to be used by all the required functions in the common standard C runtime library.
Remember to CloseHandle prevent the kernel from leaking.
3.mfc using Writeprofileint and other methods to save the program configuration
4. Specify the function to download the URL content to the specified file Urldownloadtofile
5.createFolder method to create a folder
6.lstrcpy, strcpy, _tcscpy, wcscpy difference
1) lstrcpy is a Windows API function and the other is the C library function, which can be used for both ASCII and Unicode
2) _tscpy is a compatible function when Unicode (_UNICODE) is defined as wcscpy, and no Unicode (_UNICODE) is defined as strcpy
3) Strcopy is a call to lstrcpy, preferably using lstrcpy.
Similarities and differences of 6.MoveFile, Movefileexit and CopyFile:
Same:
1) Cross-volume operations are supported (but movefileexit to be set to movefile_copy_allowed)
Vary
1) MoveFile does not support overwriting existing files
2) When the MoveFileEx call flag is set to Movefile_replace_existing, the read-only property of File2 determines whether the call succeeds or not, and is not related to the hidden property
3) When using CopyFile, consider the read-only and hidden properties of the file.
If you want to move the file you can first remove the attribute and then move it after the corresponding add property.

WinExec (), System (), ShellExecute similarities and differences
1, winexec its first parameter must contain an executable file name.
2, System () is a C library function, it accepts a DOS command
3, from the functional createprocess->shellexecute->winexec.
4, winexec only for executable files, but the compatibility is not good.
5, ShellExecute can open any file through the Windows shell, non-class execution files automatically open through the associated program
6, WinExec must have getmessage or time-out after the return but CreateProcess and ShellExecute are directly returned


(i) Simplifying type conversions using StringStream objects
is determined at compile time, so the compiler has enough information to determine which transformations are required. The standard classes declared in the <sstream> library take advantage of this and automatically select the necessary transformations. Furthermore, the result of the conversion is stored in the internal buffer of the StringStream object. You don't have to worry about buffer overruns, because these objects automatically allocate storage space as needed.
Sstream Standard library introduces Ostringstream, Istringstream, StringStream
The Istringstream class is used to perform input operations for C + + style streaming.
The Ostringstream class is used to perform a C-style streaming output operation.
The StringStream class can also support C-style streaming input and output operations.

(ii) operation of registry-related functions
1, RegOpenKeyEx () open a specified registry key call to return 0 successfully, otherwise return a non-zero code.
2. RegQueryValueEx () Retrieves the type and setting value of the registry key specified in a registry handle that has already been opened.
3. RegSetValueEx The function sets the data and type of the specified value under the registry key.
4. RegCloseKey releases the handle to the specified registration key.

_access () Checking the properties of a file
Pathappend appends a path to another path.
FindFirstFile finds files by file name. The function goes to a folder (including subfolders) to search for the specified file. You can use the Findfirstfileex function if you want to search for files with additional properties. Its second parameter is the parameter that holds the file attribute (output parameter)
CreateToolhelp32Snapshot
The function establishes a snapshot of the process, the heap [heap] used by the process, modules [module], and the thread by getting the processing information.
In the final analysis, you can get information about the processes running in the system, thread information,
Process32First is a process fetch function, and when we take a snapshot of the current running process with the function createtoolhelp32snapshot (), we can use the Process32First function to get a handle to the first process. Its prototype is ( Use of VFP)
Process32Next is a process fetch function, and when we take a snapshot of the current running process with the function createtoolhelp32snapshot (), we can use the Process32Next function to get a handle to the next process

The 1.locale global Locale ("") sets the locale locale for the environment.
2. Parse the XML using the CMarkup class.
The 3.WinInet API can use three common Internet protocols, namely the HTTP protocol, the FTP protocol, and the Gopher protocol.
General WinInet processing function:
1) InternetOpen Initialization Winlnet.dll
2) InternetOpenUrl Open the URL and read the data.
3) Internetattemptconnect attempt to establish an Internet connection
4) InternetConnect to establish an Internet connection
HTTP Protocol processing functions:
1) HttpOpenRequest Open a handle to an HTTP request
2) Httpsendrequert (EX) sends the specified request to the HTTP server
3) HttpQueryInfo query information about an HTTP request
4) HttpEndRequest End an HTTP request
5) httpaddrequestheaders Add one or more HTTP request headers to the HTTP request handle

Resource ID numbers can be reused, but one of the most important principles is
The same type resource ID value is not heavy (except id_static).
For example, one of your dlg IDs can be heavy with a control ID, or it can be the same as a string ID.
But two string IDs must never be the same

Aps_next_resource_value is the next symbolic value that will be used for dialog resources, menu resources, and so on. The valid range of resource symbol values is 1 to 0x6fff.
_aps_next_command_value is the next symbol value that will be used for the command identification. The valid range of command symbol values is 0x8000 to 0xDFFF. (menu bar)
_aps_next_control_value is the next symbol value that will be used for the dialog box control. The valid range for the dialog control symbol value is 8 to 0xDFFF.
_aps_next_symed_value is the next symbol value that will be emitted when you manually assign a symbol value using the new command in the symbol browser. (Status bar)

Windows related knowledge

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.