Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help on CDateTimeCtrl class

Need help on CDateTimeCtrl class

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John502
    wrote on last edited by
    #1

    Hi, I need some help on DateTime control, by default it will displays the current date on datetime picker. If you have changed that date to next month then i need to display one error message box. just like for example today date is 3/2/2009 and i have selected date in datetime picker as 20/2/2009. This is wrong right..? So i need to throw one error message box, Can any one help which event will get fired when datetime picker will changed. I have already tried with DTN_DATETIMECHANGE, it's not working, that the event is getting executing repeatedly.. Can any one help me regarding this..? Thanks in advance...

    L 1 Reply Last reply
    0
    • J John502

      Hi, I need some help on DateTime control, by default it will displays the current date on datetime picker. If you have changed that date to next month then i need to display one error message box. just like for example today date is 3/2/2009 and i have selected date in datetime picker as 20/2/2009. This is wrong right..? So i need to throw one error message box, Can any one help which event will get fired when datetime picker will changed. I have already tried with DTN_DATETIMECHANGE, it's not working, that the event is getting executing repeatedly.. Can any one help me regarding this..? Thanks in advance...

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Why DTN_DATETIMECHANGE does not work for you? It is WM_NOTIFY message and once it is fired all you need is to cast lpChange = (LPNMDATETIMECHANGE) lParam; and read DWORD dwflags; // this should be GDT_VALID and then SYSTEMTIME st; to see what time was selected. Then if it is month from now display a message.

      J 1 Reply Last reply
      0
      • L Lost User

        Why DTN_DATETIMECHANGE does not work for you? It is WM_NOTIFY message and once it is fired all you need is to cast lpChange = (LPNMDATETIMECHANGE) lParam; and read DWORD dwflags; // this should be GDT_VALID and then SYSTEMTIME st; to see what time was selected. Then if it is month from now display a message.

        J Offline
        J Offline
        John502
        wrote on last edited by
        #3

        Thanks for your answer, i am able to solve the problem..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups