Sign in to follow this  
Followers 0
autoguy100

Date Selection In Calendar

2 posts in this topic

Hi,

How do i pass a date in the calendar window. Attached calendar window from my application.

The following code is generated by Macro generator,

Opt("WinTitleMatchMode", 4)

WinWait("Defer To Date","Project")

ControlClick("Defer To Date","Project","DTPicker20WndClass1")

ControlClick("Defer To Date","Project","DTPicker20WndClass1")

WinWait("classname=msvb_lib_monthview","")

ControlClick("classname=msvb_lib_monthview","","msvb_lib_monthview0")

WinWait("Defer To Date","Project")

ControlClick("Defer To Date","Project","DTPicker20WndClass2")

WinWait("classname=msvb_lib_monthview","")

ControlClick("classname=msvb_lib_monthview","","msvb_lib_monthview0")

Share this post


Link to post
Share on other sites



If its any help, I wrote this little popup calendar program which copies the selected date to the clipboard so I can paste it into other programs, Word documents, for example.

; AutoIt:   v3.1.1.113 (beta)
; Author:   Graham Taylor (NIST)
; Name:     Quick Calendar
; Version:  v 1.0a
; Date:     23/03/2006
; Function: Quick Calendar, which copies selected date to Clipboard

#include <GUIConstants.au3>
#Include <Date.au3>
#NoTrayIcon

GUICreate("Quick Calendar", 210, 210, (@DesktopWidth - 250), 100, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS), $WS_EX_TOPMOST)

$Date = GUICtrlCreateMonthCal("", 10, 10, 190, 150, $MCS_NOTODAY)
; MENU
$mnuFile = GUICtrlCreateMenu("&File")
$itmExit = GUICtrlCreateMenuItem("&Exit", $mnuFile)

; Copy to Clipboard
$btnSendToClip = GUICtrlCreateButton("Copy to Clipboard", 55, 165, 100, 20)

GUISetState()

; Run the GUI until the dialog is closed
While 1
 $msg = GUIGetMsg()
 Select
  
  Case $msg = $btnSendToClip
   $TheDate = _DateTimeFormat( GUICtrlRead($Date), 2)
   ClipPut($TheDate)
   GUISetState(@SW_MINIMIZE, "Quick Calendar")
   
  Case $msg = $GUI_EVENT_CLOSE
   GUISetState(@SW_MINIMIZE, "Quick Calendar")
   
  Case $msg = $itmExit
   $sure = MsgBox(292, "Quick Calendar", "Are you sure you want to exit?", 10)
   If $sure = 6 Then ExitLoop
   
 EndSelect
 
WEnd

Exit

Hi,

How do i pass a date in the calendar window. Attached calendar window from my application.

The following code is generated by Macro generator,

Opt("WinTitleMatchMode", 4)

WinWait("Defer To Date","Project")

ControlClick("Defer To Date","Project","DTPicker20WndClass1")

ControlClick("Defer To Date","Project","DTPicker20WndClass1")

WinWait("classname=msvb_lib_monthview","")

ControlClick("classname=msvb_lib_monthview","","msvb_lib_monthview0")

WinWait("Defer To Date","Project")

ControlClick("Defer To Date","Project","DTPicker20WndClass2")

WinWait("classname=msvb_lib_monthview","")

ControlClick("classname=msvb_lib_monthview","","msvb_lib_monthview0")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0