Jump to content

Need Some guidance 4 GUICtrlCreateMonthCal


Aliisonline
 Share

Recommended Posts

Me creating this script:

#Include <Misc.au3>

#include <GUIConstants.au3>

GUICreate( "Get date", 210,190)

$Date = GUICtrlCreateMonthCal ("",10, 10)

GUISetState()

While 1

Sleep ( 50 )

If _IsPressed("01") Then

Run ('notepad.exe')

WinWaitActive ("Untitled - Notepad")

Send (GUICtrlRead($Date));RIGHT HERE I WANT TO SEND THE DATE IN MM/DD/YYYY format but it sends in YYYY/MM/DD forma, but don't know how :graduated:

ExitLoop

EndIf

WEnd

Link to comment
Share on other sites

1 Way:

#Include <Misc.au3>
#include <GUIConstants.au3>
GUICreate( "Get date", 210,190)
$Date = GUICtrlCreateMonthCal ("",10, 10)
GUISetState()
While 1
Sleep ( 50 )
If _IsPressed("01") Then
Run ('notepad.exe')
WinWaitActive ("Untitled - Notepad")
$date = GUICtrlRead($Date)
$date = StringMid($date, 6, 3) & StringRight($date, 2) & "/" & StringLeft($date, 4)
Send ($Date);RIGHT HERE I WANT TO SEND THE DATE IN MM/DD/YYYY format but it sends in YYYY/MM/DD forma, but don't know how :nuke:
ExitLoop
EndIf
WEnd

If your PC have that format just use:

#include <Misc.au3>
#include <GUIConstants.au3>
#include <Date.au3>
GUICreate("Get date", 210, 190)
$Date = GUICtrlCreateMonthCal("", 10, 10)
GUISetState()
While 1
    Sleep(50)
    If _IsPressed("01") Then
        Run('notepad.exe')
        WinWaitActive("Untitled - Notepad")
        $Date = GUICtrlRead($Date)
        ; Current date/time in the pc's format
        Send(_DateTimeFormat($Date, 2));RIGHT HERE I WANT TO SEND THE DATE IN MM/DD/YYYY format but it sends in YYYY/MM/DD forma, but don't know how :nuke:
        ExitLoop
    EndIf

WEnd
Edited by JoHanatCent
Link to comment
Share on other sites

Thanks a lot buddy your first suggestion is GOOD. :graduated: I said first one good cause in the first 1 i did not have to change anything and it send the date in MM/DD/YYYY format, the second one was gooooood also but in the second if i click the date less than 10 it don't display the leading zero before one digit (DD). Any way thanks a lot man. Right now it is almost 11:30 PM, in morning i will try to understand the syntax which you used to accomplish this task. :(

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...