DjDeep00 Posted July 10, 2006 Share Posted July 10, 2006 I want to be able to choose a date range in a calendar. I am able to choose it in the GUI but I need help reading it from the GUI. Here is my script: #include <GUIConstants.au3> #include <date.au3> #include <GuiMonthCal.au3> opt('MustDeclareVars', 1) Dim $Date, $Date2, $Btn_Dates, $Combo, $msg, $Status GUICreate( "Set Max Sel Count", 450, 254) $Date2 = GUICtrlCreateMonthCal (_NowCalcDate(), 10, 10, 190, 155,$MCS_MULTISELECT) _GUICtrlMonthCalSetMaxSelCount ($Date2, 100) $Status = GUICtrlCreateLabel("", 0, 234, 450, 20, BitOR($SS_SUNKEN, $SS_CENTER)) $Btn_Dates = GUICtrlCreateButton("Dates", 180, 180, 90, 30) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Btn_Dates Msgbox(0,"Date",GUICtrlRead($Date2)) EndSelect WEnd Link to comment Share on other sites More sharing options...
GaryFrost Posted July 10, 2006 Share Posted July 10, 2006 a regular guictrlread won't work, don't have time to figure this out myself at the moment but here's a link to the infohttp://msdn.microsoft.com/library/en-us/sh...getselrange.asp SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
DjDeep00 Posted July 11, 2006 Author Share Posted July 11, 2006 lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) MCM_GETSELRANGE, // message ID (WPARAM) wParam, // = 0; not used, must be zero (LPARAM) lParam // = (LPARAM) (LPSYSTEMTIME) lprgSysTimeArray; ); Here is what I have so far. Please advise. Func _GUICtrlMonthCalGetRange($h_monthcal) If IsHWnd($h_monthcal) Then Local $a_ret = DllCall("user32.dll", "int", "SendMessage", "hwnd", $h_monthcal, "int", $MCS_MULTISELECT, "int", 0, "int", 0) Return $a_ret[0][0] Else Return GUICtrlSendMsg($h_monthcal, $MCS_MULTISELECT, 0, 0) EndIf EndFunc Link to comment Share on other sites More sharing options...
GaryFrost Posted July 11, 2006 Share Posted July 11, 2006 don't forget: lprgSysTimeArray Pointer to a two-element array of SYSTEMTIME structures that will receive the lower and upper limits of the user's selection. The lower and upper limits are placed in lprgSysTimeArray[0] and lprgSysTimeArray[1], respectively. This parameter must be a valid address and cannot be NULL. 1st off you need to be using MCM_GETSELRANGE not MCS_MULTISELECT I played around with this a little yesterday, haven't had time to keep at it. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
DjDeep00 Posted July 11, 2006 Author Share Posted July 11, 2006 don't forget: lprgSysTimeArray Pointer to a two-element array of SYSTEMTIME structures that will receive the lower and upper limits of the user's selection. The lower and upper limits are placed in lprgSysTimeArray[0] and lprgSysTimeArray[1], respectively. This parameter must be a valid address and cannot be NULL. 1st off you need to be using MCM_GETSELRANGE not MCS_MULTISELECT I played around with this a little yesterday, haven't had time to keep at it. Not sure how you got the value for Global Const $MCS_MULTISELECT = 0x2. What will be the value for $MCM_GETSELRANGE? Sorry for all the questions. This is my first time making a UDF. If possible if you can show me how to do this then I might not have to bug anyone in the future. Thanx in advance. Link to comment Share on other sites More sharing options...
GaryFrost Posted July 11, 2006 Share Posted July 11, 2006 (edited) Global Const $MCM_GETRANGE = ($MCM_FIRST + 17) either google or use something like APIViewer 2004 Edited July 11, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
argumentum Posted May 25, 2011 Share Posted May 25, 2011 Global Const $MCM_GETRANGE = ($MCM_FIRST + 17) either google or use something like APIViewer 2004 I need help with this, I'd like to read a range. Anyone ever got this to work ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now