To get the focused element of picker using CDateTimeCtrl class

Deeptha S 1 Reputation point
2023-02-09T12:02:51.5766667+00:00

Hi

Iam using mfc CDateTimeCtrl class for my date picker .It displays day ,month ,year elements.

So microsoft allows me to set focus on each of the elements in the date picker like day ,year .or month.

Is there an api to know which element is being focused .

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,413 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,849 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,022 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 12,596 Reputation points Microsoft Vendor
    2023-02-10T07:36:09.91+00:00

    Hi, Deeptha S
    I'm afraid you can't tell which element is being focused.
    Void OnNMSetfocusDatetimepicker(NMHDR* pNMHDR, LRESULT* pResult)
    The parameters NMHDR* pNMHDR sent by day ,year and month are the same.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.