Sign in to follow this  
Followers 0
TuMiM

Calendar integration

3 posts in this topic

I am trying to integrate a calendar option in my script gui so that the user can choose a date which will be passed to the main script. I have been looking for a while but I can't figure out how i would do this. My current script is below and i added a button where the calendar would be but not sure how to make it launch and then pipe the answer back into the main gui.

#include <Date.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Dim $whichbutton, $ButtonC1, $ButtonC2, $ButtonC3, $ButtonC4, $ButtonC5, $ButtonC6, 

$INIMDI1, $INIMDI2, $INIMDI3, $INIMDI4, $INIMDI5, $INIMDI6, $CALDATE
global $input,$room,$log
$NOWDATE=(@YEAR & @MON & @MDAY)
$PATH = IniRead(@ScriptDir & "\LogLaunch.ini", "Global", "Path", "")
main()
Func main()
;$Form1_1 = GUICreate("Log Launch", 1001, 649, 3, 20)
$Form1_1 = GUICreate("Log Launch",@DesktopWidth,@DesktopHeight,0,0 , $WS_OVERLAPPEDWINDOW 

+ $WS_VISIBLE + $WS_CLIPSIBLINGS) 

$iniBut1 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button1","")
$iniBut2 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button2","")
$iniBut3 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button3","")
$iniBut4 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button4","")
$iniBut5 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button5","")
$iniBut6 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button6","")


$Button1 = GUICtrlCreateButton($iniBut1, 80, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton($iniBut2, 326, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton($iniBut3, 574, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton($iniBut4, 77, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button5 = GUICtrlCreateButton($iniBut5, 325, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button6 = GUICtrlCreateButton($iniBut6, 573, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Log Launcher", 280, 16, 236, 33)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("For Date", 280, 66, 100, 33)
$input = GUICtrlCreateInput($NOWDATE, 350, 60, 66, 20)
$CalBut = GUICtrlCreateButton($CALDATE, 420, 60, 25, 20)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
    Case $Msg = $CalBut
        $MonthCal1 = GUICtrlCreateMonthCal($NOWDATE, 16, 16, 193, 169)
        $String = GUICtrlRead($MonthCal1)
            $Split = StringSplit($string, '/')
            $day = $split[3]
            $month = $split[2]
            $year = $split[1]
        $MDATE = ($year & $month & $day)
        $NOWDATE = $MDATE
        Case $Msg = $Button1
            $Room = $iniBut1
            MDIOPEN()
            $Whichbutton = "Button1"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button2
            $Room = $iniBut2
            MDIOPEN()
            $Whichbutton = "Button2"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button3
            $Room = $iniBut3
            MDIOPEN()
            $Whichbutton = "Button3"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button4
            $Room = $iniBut4
            MDIOPEN()
            $Whichbutton = "Button4"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button5
            $Room = $iniBut5
            MDIOPEN()
            $Whichbutton = "Button5"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button6
            $Room = $iniBut6
            MDIOPEN()
            $Whichbutton = "Button6"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            ;;;
    EndSelect
WEnd
Exit
EndFunc

;Functions
Func Form2()

;$Form1_2 = GUICreate("Channel Launch", 1001, 649, 3, 20)
$Form1_2 = GUICreate("Channel Launch", @DesktopWidth, @DesktopHeight, 0, 0, 

$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS ) 
;GUISetState(@SW_HIDE)
$iniButC1 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button1", "")
$iniButC2 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button2", "")
$iniButC3 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button3", "")
$iniButC4 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button4", "")
$iniButC5 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button5", "")
$iniButC6 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button6", "")

$RoomButton = GUICtrlCreateButton($Room, 80, 16, 50, 50, $WS_GROUP)
$ButtonC1 = GUICtrlCreateButton($iniButC1, 80, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC2 = GUICtrlCreateButton($iniButC2, 326, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC3 = GUICtrlCreateButton($iniButC3, 574, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC4 = GUICtrlCreateButton($iniButC4, 77, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC5 = GUICtrlCreateButton($iniButC5, 325, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC6 = GUICtrlCreateButton($iniButC6, 573, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Channel Launcher",280, 16, 236, 33)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("For Date", 280, 66, 100, 33)
$input = GUICtrlCreateInput($NOWDATE, 350, 60, 66, 20)
        
    While 1
    $msg = GUIGetMsg()
    Select  
            Case $Msg = $ButtonC1
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI1 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI1 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC2
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI2 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI2 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC3
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI3 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI3 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC4
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI4 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI4 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC5
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI5 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI5 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf   
            Case $Msg = $ButtonC6
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI6 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI6 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $RoomButton
            GUISetState(@SW_HIDE, $form1_2)
            main()
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case Else
;;;
EndSelect
WEnd
Exit
EndFunc

Func MDIOPEN()
$Input1 = GUICtrlRead($Input)
$INIMDI1 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log1","")
$INIMDI2 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log2","")
$INIMDI3 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log3", "")
$INIMDI4 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log4", "")
$INIMDI5 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log5", "")
$INIMDI6 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log6", "")
;$LogFile=$INIMDI1 & $INPUT1 & ".MDI"

If FileExists($PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & ".MDI") Then
;MsgBox( 4096, "Exists",'"C:\Program Files\Common Files\Microsoft 

Shared\MODI\12.0\mspview.exe"' & " " & '"' & $PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & 

".MDI" & '"' )
    Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & 

'"' & $PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & ".MDI" & '"', "",@SW_Minimize)
Sleep(1000)
WinSetState($INIMDI1 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI2 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI3 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI4 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI5 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI6 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf

EndFunc

Share this post


Link to post
Share on other sites



The examples from the Help File for GuiCtrlCreateDate don't illustrate this clearly enough for you?

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 1)

Example1()
Example2()
Example3()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    GUISetState()

    ; Run the GUI until the dialog is closed
    Do
        $msg = GUIGetMsg()
    Until $msg = $GUI_EVENT_CLOSE

    MsgBox(0, "Date", GUICtrlRead($date))
    GUIDelete()
EndFunc   ;==>Example1

; example2
Func Example2()
    Local $n, $msg

    GUICreate("My GUI get time")
    $n = GUICtrlCreateDate("", 20, 20, 100, 20, $DTS_TIMEFORMAT)
    GUISetState()

    ; Run the GUI until the dialog is closed
    Do
        $msg = GUIGetMsg()
    Until $msg = $GUI_EVENT_CLOSE

    MsgBox(0, "Time", GUICtrlRead($n))
    GUIDelete()
EndFunc   ;==>Example2

; example3
Func Example3()
    Local $date, $DTM_SETFORMAT_, $style

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)

    ; to select a specific default format
    $DTM_SETFORMAT_ = 0x1032
    $style = "yyyy/MM/dd HH:mm:s"
    GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)

    GUISetState()
    While GUIGetMsg() <> $GUI_EVENT_CLOSE
    WEnd

    MsgBox(0, "Time", GUICtrlRead($date))
EndFunc   ;==>Example3

Share this post


Link to post
Share on other sites

Thanks, I didn't even know about the DateTimeConstants. So now i got that working but i have one more problem. I cannot get the first form to pass the date that was chosed to the second form. I am assuming it's because of the changing of the style?

#include <Date.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <DateTimeConstants.au3>

Dim $whichbutton, $ButtonC1, $ButtonC2, $ButtonC3, $ButtonC4, $ButtonC5, $ButtonC6, 

$INIMDI1, $INIMDI2, $INIMDI3, $INIMDI4, $INIMDI5, $INIMDI6, $CALDATE, $input2
global $input,$room,$log,$input1
$NOWDATE=(@YEAR & @MON & @MDAY)
$PATH = IniRead(@ScriptDir & "\LogLaunch.ini", "Global", "Path", "")
main()
Func main()
;$Form1_1 = GUICreate("Log Launch", 1001, 649, 3, 20)
$Form1_1 = GUICreate("Log Launch",@DesktopWidth,@DesktopHeight,0,0 , $WS_OVERLAPPEDWINDOW 

+ $WS_VISIBLE + $WS_CLIPSIBLINGS) 

$iniBut1 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button1","")
$iniBut2 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button2","")
$iniBut3 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button3","")
$iniBut4 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button4","")
$iniBut5 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button5","")
$iniBut6 = IniRead(@ScriptDir & "\LogLaunch.ini", "Main", "Button6","")


$Button1 = GUICtrlCreateButton($iniBut1, 80, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton($iniBut2, 326, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton($iniBut3, 574, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton($iniBut4, 77, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button5 = GUICtrlCreateButton($iniBut5, 325, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Button6 = GUICtrlCreateButton($iniBut6, 573, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Log Launcher", 280, 16, 236, 33)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("For Date", 280, 66, 100, 33)
$input = GUICtrlCreateDate("", 350, 60, 220, 20)
DateSplit()
;$CalBut = GUICtrlCreateButton($CALDATE, 420, 60, 25, 20)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $Msg = $Button1
            $Room = $iniBut1
            MDIOPEN()
            $Whichbutton = "Button1"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button2
            $Room = $iniBut2
            MDIOPEN()
            $Whichbutton = "Button2"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button3
            $Room = $iniBut3
            MDIOPEN()
            $Whichbutton = "Button3"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button4
            $Room = $iniBut4
            MDIOPEN()
            $Whichbutton = "Button4"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button5
            $Room = $iniBut5
            MDIOPEN()
            $Whichbutton = "Button5"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $Msg = $Button6
            $Room = $iniBut6
            MDIOPEN()
            $Whichbutton = "Button6"
            GUISetState(@SW_HIDE, $form1_1)
            ;GUISetState(@SW_SHOW, $form1_2)
            Form2()
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            ;;;
    EndSelect
WEnd
Exit
EndFunc

;Functions
Func Form2()

;$Form1_2 = GUICreate("Channel Launch", 1001, 649, 3, 20)
$Form1_2 = GUICreate("Channel Launch", @DesktopWidth, @DesktopHeight, 0, 0, 

$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS ) 
;GUISetState(@SW_HIDE)
$iniButC1 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button1", "")
$iniButC2 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button2", "")
$iniButC3 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button3", "")
$iniButC4 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button4", "")
$iniButC5 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button5", "")
$iniButC6 = IniRead(@ScriptDir & "\LogLaunch.ini", $WhichButton, "Button6", "")

$RoomButton = GUICtrlCreateButton($Room, 80, 16, 50, 50, $WS_GROUP)
$ButtonC1 = GUICtrlCreateButton($iniButC1, 80, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC2 = GUICtrlCreateButton($iniButC2, 326, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC3 = GUICtrlCreateButton($iniButC3, 574, 116, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC4 = GUICtrlCreateButton($iniButC4, 77, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC5 = GUICtrlCreateButton($iniButC5, 325, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$ButtonC6 = GUICtrlCreateButton($iniButC6, 573, 320, 145, 121, $WS_GROUP)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Channel Launcher",280, 16, 236, 33)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("For Date", 280, 66, 100, 33)
$input2 = GUICtrlCreateDate("", 350, 60, 220, 20)
DateSplit1()
    MsgBox(0, "Time", GUICtrlRead($input))
        
    While 1
    $msg = GUIGetMsg()
    Select  
            Case $Msg = $ButtonC1
        ;DateSplit1()
                $Input3 = GUICtrlRead($Input2)
    If WinExists($INIMDI1 & $INPUT3 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI1 & $INPUT3 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT3 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT3 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC2
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI2 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI2 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC3
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI3 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI3 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC4
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI4 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI4 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $ButtonC5
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI5 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI5 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf   
            Case $Msg = $ButtonC6
                $Input1 = GUICtrlRead($Input)
    If WinExists($INIMDI6 & $INPUT1 & ".MDI - Microsoft Office Document Imaging") Then
        WinSetState($INIMDI6 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MAXIMIZE)
    ElseIf FileExists($PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI") Then
        Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " 

& '"' & $PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI" & '"', "", @SW_Maximize)
                EndIf
            Case $Msg = $RoomButton
            GUISetState(@SW_HIDE, $form1_2)
            main()
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case Else
;;;
EndSelect
WEnd
Exit
EndFunc

Func MDIOPEN()
$Input1 = GUICtrlRead($input)
$INIMDI1 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log1","")
$INIMDI2 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log2","")
$INIMDI3 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log3", "")
$INIMDI4 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log4", "")
$INIMDI5 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log5", "")
$INIMDI6 = IniRead(@ScriptDir & "\LogLaunch.ini", $Room, "Log6", "")
;$LogFile=$INIMDI1 & $INPUT1 & ".MDI"

If FileExists($PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & ".MDI") Then
;MsgBox( 4096, "Exists",'"C:\Program Files\Common Files\Microsoft 

Shared\MODI\12.0\mspview.exe"' & " " & '"' & $PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & 

".MDI" & '"' )
    Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & 

'"' & $PATH & $INIMDI1 & '\' & $INIMDI1 & $INPUT1 & ".MDI" & '"', "",@SW_Minimize)
Sleep(1000)
WinSetState($INIMDI1 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI2 & '\' & $INIMDI2 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI2 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI3 & '\' & $INIMDI3 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI3 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI4 & '\' & $INIMDI4 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI4 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI5 & '\' & $INIMDI5 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI5 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf
If FileExists($PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI") Then
Run('"C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\mspview.exe"' & " " & '"' & 

$PATH & $INIMDI6 & '\' & $INIMDI6 & $INPUT1 & ".MDI" & '"', "", @SW_Minimize)
Sleep(1000)
WinSetState($INIMDI6 & $INPUT1 & ".MDI - Microsoft Office Document Imaging", "", 

@SW_MINIMIZE)
EndIf

EndFunc
 
Func DateSplit()
    Local $style = "yyyyMMdd"
    GUICtrlSendMsg($input, 0x1032, 0, $style)
EndFunc

Func DateSplit1()
    Local $style = "yyyyMMdd"
    GUICtrlSendMsg($input2, 0x1032, 0, $style)
EndFunc

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