lolipop Posted March 12, 2014 Share Posted March 12, 2014 Hi, Anyone can show me thru the example below how can I enable real time reading of the value of the date? What I want is to check the date value as soon as the user click on the next date entry instead of waiting for him to click on the submit button. Any help is appreciated. Click on date1, when user leave the date1 gui control, read value of date1 Click on date 2, when user leave the date2 gui control, read value of date2 #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $date, $msg GUICreate("My GUI get date", 200, 200, 800, 200) $date1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) $date2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) $button1 = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example Link to comment Share on other sites More sharing options...
FireFox Posted March 12, 2014 Share Posted March 12, 2014 Hi, ... Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $date1 MsgBox(0, "", "date changed !") EndSwitch ... Br, FireFox Link to comment Share on other sites More sharing options...
mLipok Posted March 12, 2014 Share Posted March 12, 2014 (edited) @FireFox I think about this but this is not what he need (I think so) In your example you must change date, but i think, OP want to check date after changing focus Maybe this: expandcollapse popup#include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $date, $msg Local $date, $msg Local $hGui = GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) Local $idDate2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) Local $button1 = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) GUISetState(@SW_SHOW) Local $idLastFocus = 0 ; Local $idNewFocus = 0 ; Loop until the user exits. $idLastFocus = ControlGetFocus($hGui) While 1 ; ConsoleWrite('ControlGetFocus($hGui) = ' & ControlGetFocus($hGui) & @CRLF) If $idLastFocus <> ControlGetFocus($hGui) Then If $idLastFocus = 'SysDateTimePick321' Then ConsoleWrite('Date1 = ' & GUICtrlRead($idDate1) & @CRLF) EndIf If $idLastFocus = 'SysDateTimePick322' Then ConsoleWrite('Date2 = ' & GUICtrlRead($idDate2) & @CRLF) EndIf $idLastFocus = ControlGetFocus($hGui) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idDate1 ConsoleWrite(GUICtrlRead($idDate1) & @CRLF) Case $idDate2 ConsoleWrite(GUICtrlRead($idDate2) & @CRLF) Case $button1 EndSwitch WEnd GUIDelete() EndFunc ;==>Example EDIT: commented Local $idNewFocus = 0 because not needed Edited March 12, 2014 by mLipok Skysnake and robertocm 2 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
FireFox Posted March 12, 2014 Share Posted March 12, 2014 (edited) Instead of keep checking the focus, use WM_COMMAND. You will surely find a $ ..._KILLFOCUS. Edited March 12, 2014 by FireFox Link to comment Share on other sites More sharing options...
mLipok Posted March 12, 2014 Share Posted March 12, 2014 (edited) For the past hour I studied WM_KILLFOCUS message on MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/ms646282(v=vs.85).aspx And I was wondering how to use WM_KILLFOCUS for control, I thought that this message applies only to the entire window, not a single element of this window. If I'm wrong, please give me some tips. EDIT: I found some further example http://social.msdn.microsoft.com/Forums/en-US/3f1e08fd-be01-427e-9fb6-93776f31aa85/is-there-any-way-that-i-could-get-kill-focus-event-in-single-body-of-all-control?forum=vcmfcatl But still looking for the way to understanding how it works. Probably a little more time passed and the magic dissipate, and in its place will be knowledge Edited March 12, 2014 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted March 13, 2014 Moderators Solution Share Posted March 13, 2014 lolipop, how can I enable real time reading of the value of the date?This allows you to detect changes to the date control instantly:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 200, 200, 800, 200) $cDate1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) $cDate2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) $cButton = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Switch _WinAPI_LoWord($wParam) ; ControlID of the control Case $cDate1, $cDate2 Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If DllStructGetData($tStruct, "Code") = $DTN_DATETIMECHANGE Then ConsoleWrite("1: " & GUICtrlRead($cDate1) & " - 2: " & GUICtrlRead($cDate2) & @CRLF) EndIf EndSwitch EndFuncAny use? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
lolipop Posted March 19, 2014 Author Share Posted March 19, 2014 (edited) lolipop, This allows you to detect changes to the date control instantly: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 200, 200, 800, 200) $cDate1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) $cDate2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) $cButton = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Switch _WinAPI_LoWord($wParam) ; ControlID of the control Case $cDate1, $cDate2 Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If DllStructGetData($tStruct, "Code") = $DTN_DATETIMECHANGE Then ConsoleWrite("1: " & GUICtrlRead($cDate1) & " - 2: " & GUICtrlRead($cDate2) & @CRLF) EndIf EndSwitch EndFunc Any use? M23 Hi Melba, Sorry for the late reply. Thanks for the solution. It works perfectly. I have try intergating your solution with a sample code I find in the forum (I have a listview and I wish to use this sample code to custom draw my listview item) but I can't seem to made it work. The sample code is basically meant to do a custom draw for the listview item color. With my limited knowledge, I can't make it work. You think you can help? Sample below. expandcollapse popupFunc WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView ; Local $tBuffer $hWndListView = $Timelog_form_Listview If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($Timelog_form_Listview) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CUSTOMDRAW If Not _GUICtrlListView_GetViewDetails($hWndFrom) Then Return $GUI_RUNDEFMSG ; Not in details mode Local $tCustDraw, $iDrawStage, $iItem, $iSubitem, $hDC, $tRect, $iColor1, $iColor2, $iColor3 $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) $iDrawStage = DllStructGetData($tCustDraw, 'dwDrawStage') Switch $iDrawStage Case $CDDS_PREPAINT Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT Return $CDRF_NOTIFYSUBITEMDRAW Case $CDDS_ITEMPOSTPAINT ; Not handled Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM) $iItem = DllStructGetData($tCustDraw, 'dwItemSpec') $iSubitem = DllStructGetData($tCustDraw, 'iSubItem') If _GUICtrlListView_GetItemSelected($hWndFrom, $iItem) Then ; Item to draw is selected $hDC = _WinAPI_GetDC($hWndFrom) $tRect = DllStructCreate($tagRECT) ; We draw the background when we draw the first item. If $iSubitem = 0 Then ; We must send the message as we want to use the struct. _GUICtrlListView_GetSubItemRect returns an array. _SendMessage($hWndFrom, $LVM_GETSUBITEMRECT, $iItem, DllStructGetPtr($tRect)) DllStructSetData($tRect, "Left", 2) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), _WinAPI_GetStockObject($GRAY_BRUSH)) ; Change the bush here. You can use GDI+ to make your own. EndIf DllStructSetData($tRect, "Left", 2) DllStructSetData($tRect, "Top", $iSubitem) _SendMessage($hWndFrom, $LVM_GETSUBITEMRECT, $iItem, DllStructGetPtr($tRect)) Local $sText = _GUICtrlListView_GetItemText($hWndFrom, $iItem, $iSubitem) _WinAPI_SetBkMode($hDC, $TRANSPARENT) ; It uses the background drawn for the first item. ; Select the font we want to use _WinAPI_SelectObject($hDC, _SendMessage($hWndFrom, $WM_GETFONT)) If $iSubitem = 0 Then DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 2) Else DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 6) EndIf _WinAPI_DrawText($hDC, $sText, $tRect, BitOR($DT_VCENTER, $DT_END_ELLIPSIS, $DT_SINGLELINE)) _WinAPI_ReleaseDC($hWndFrom, $hDC) Return $CDRF_SKIPDEFAULT ; Don't do default processing EndIf Return $CDRF_NEWFONT ; Let the system do the drawing for non-selected items Case BitOR($CDDS_ITEMPOSTPAINT, $CDDS_SUBITEM) ; Not handled EndSwitch Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button Local $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) Local $iItem = DllStructGetData($tInfo, "Item") Global $vValidTimeIn = _GUICtrlListView_GetItemText($TimeListview, $iItem, 1) Global $vSelectedUsername = _GUICtrlListView_GetItemText($Time_Listview, $iItem, 0) If $vValidTimeIn == "" Then GUICtrlSetState($Time_button1, $GUI_HIDE) GUICtrlSetState($Time_button2, $GUI_SHOW) GUICtrlSetState($Time_input1,$GUI_FOCUS) Else GUICtrlSetState($Time_button1, $GUI_SHOW) GUICtrlSetState($Time_button2, $GUI_HIDE) GUICtrlSetState($Time_input1,$GUI_FOCUS) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func RGB2BGR($iColor) Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF) EndFunc Btw, thank you Firefox and mLipok for their solution too. Edited March 19, 2014 by lolipop Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 19, 2014 Moderators Share Posted March 19, 2014 lolipop,You just need to have both sets of code inside the handler: Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) ; Start by looking for the Date control Switch _WinAPI_LoWord($wParam) ; ControlID of the control Case $cDate1, $cDate2 Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If DllStructGetData($tStruct, "Code") = $DTN_DATETIMECHANGE Then ConsoleWrite("1: " & GUICtrlRead($cDate1) & " - 2: " & GUICtrlRead($cDate2) & @CRLF) EndIf EndSwitch ; And then see if the ListView needs attention Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView ; Local $tBuffer $hWndListView = $Timelog_form_Listview If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($Timelog_form_Listview) ; etc, etcM23 robertocm 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
lolipop Posted March 19, 2014 Author Share Posted March 19, 2014 I did try combine them up before but it doesn't work. Hmm... Let me try them again. Thanks. Melba Link to comment Share on other sites More sharing options...
robertocm Posted May 22, 2019 Share Posted May 22, 2019 On 3/12/2014 at 9:09 PM, mLipok said: And I was wondering how to use WM_KILLFOCUS for control Example below seems to work (just copy-paste from here) All credits for argumentum and Melba23, both referenced in the code: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 200, 200, 800, 200) $cDate1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) $cDate2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) $cButton = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) ;argumentum, Nov 2017 ;https://www.autoitscript.com/forum/topic/191058-datetime-pick-coloring/ Global $g_hDTP1 = GUICtrlGetHandle($cDate1) Global $g_hDTP2 = GUICtrlGetHandle($cDate2) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) ;Melba23, March 2014 ;https://www.autoitscript.com/forum/topic/159764-reading-gui-date-control-instantly/?do=findComment&comment=1161074 ; Start by looking for the Date control Switch _WinAPI_LoWord($wParam) ; ControlID of the control Case $cDate1, $cDate2 Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If DllStructGetData($tStruct, "Code") = $DTN_DATETIMECHANGE Then ConsoleWrite("1: " & GUICtrlRead($cDate1) & " - 2: " & GUICtrlRead($cDate2) & @CRLF) EndIf EndSwitch ;Melba23, March 2014 ;https://www.autoitscript.com/forum/topic/159764-reading-gui-date-control-instantly/?do=findComment&comment=1161074 ; And then see if the ListView needs attention ;~ Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView ;~ ; Local $tBuffer ;~ $hWndListView = $Timelog_form_Listview ;~ If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($Timelog_form_Listview) ; etc, etc ;argumentum, Nov 2017 ;https://www.autoitscript.com/forum/topic/191058-datetime-pick-coloring/ Local $hWndFrom, $iCode, $tNMHDR, $iIDFrom $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "HwndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") Switch $hWndFrom Case $g_hDTP1, $g_hDTP2 Switch $iCode Case $NM_SETFOCUS ConsoleWrite("$NM_SETFOCUS" & @CRLF & "-->hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF) Case $NM_KILLFOCUS ConsoleWrite("$NM_KILLFOCUS" & @CRLF & "-->hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF) Consolewrite("+-> GUICtrlRead:" & @TAB & GUICtrlRead($cDate1) & @CRLF) EndSwitch EndSwitch EndFunc Link to comment Share on other sites More sharing options...
Nine Posted May 23, 2019 Share Posted May 23, 2019 (edited) nvm old post Edited May 23, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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