MFC typing training and entertainment program (1)

Source: Internet
Author: User

Today, I finally completed the typing Training Program. Let's briefly introduce the overall idea and share it with you.

In the main window, find the dictionary in the file path (path search in the subwindow), apply for dynamic memory, store the read content, and randomly display words.

The ontimer message response is used to define an int ntimecount. The ntimecount variable is used to auto-increment the ntimecount variable and the related ntimecount operations enable the program to automatically update words within a certain period of time, this time period is set based on the difficulty. When you enter the same word as the displayed word, it can be updated smoothly. If you have entered the correct word within the specified time period, you can perform the next comparison operation automatically, in this case, you only need to set ntimecount to 0, but if it times out, the input box is automatically cleared and updated. Set the int iright and INT iwrong variables to store the number of correct and wrong inputs. For scoring.

For the pause operation, you can directly stop the auto-increment operation of the time counter. However, you need to record the value of the ntimecount variable when the pause is performed for the recovery operation.

End operation: end all operations, end time counter auto-increment, and operations related to the previous program.

 

This section describes how to exchange data between the subwindow and the main window. The font selection is not satisfactory. The font format of the system cannot be cited. For the combo box with the control, use addstring to obtain the user's selection and pass it to the main window variables. Color settings: You have defined eight colors. In the Sub-window, if the position of the selected content in the drop-down box is obtained, the integer is returned to the main window variable, you can switch the font color. You can also choose difficulty. The key to dictionary selection is to combine the dictionary paths. Otherwise, the dictionary cannot be opened and the contents cannot be read.

To be continued ......

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.