Quote from: Richard Kelly on April 26, 2026, 10:56:19 PMAfter 50 years as a software engineer it took me around 3-4 years to get motivated after retirement. Perhaps you will take less time.Yup, I tend to go in waves since I retired. Lots going on in real life these days so programming has taken a little back seat. I expect within the next few weeks that everything will return to regular daily life and I'll return to my programming passions.
QuoteFYI, I ported a winfbe project to tiko and AFX Nova. I was a bit rusty and it took me 3 days to get it done. The resultant EXE was 40% smaller.That's awesome! AfxNova is amazing. I built Tiko using a fair amount from the AfxNova library. DWSTRING dynamic unicode string by itself is worth its weight in gold. Just about anything you need for Windows application programming can be found within the library. José has done an amazing job designing and implementing the library.
CASE WM_NOTIFY
DIM uFromSystemDate AS SYSTEMTIME
DIM pTabPage AS CTabPage PTR ' // Tab page object reference
DIM dtp AS NMDATETIMECHANGE
CBNMTYPESET(dtp, wParam, lParam) ' // Information about a notification message
SELECT CASE dtp.nmhdr.idFrom
CASE IDC_TABCONTROL
SELECT CASE dtp.nmhdr.code
CASE TCN_SELCHANGE
' // Show the selected page
pTabPage = AfxCTabPagePtr(dtp.nmhdr.hwndFrom, -1)
IF pTabPage THEN ..ShowWindow pTabPage->hTabPage, SW_SHOW
CASE TCN_SELCHANGING
' // Hide the current page
pTabPage = AfxCTabPagePtr(dtp.nmhdr.hwndFrom, -1)
IF pTabPage THEN ..ShowWindow pTabPage->hTabPage, SW_HIDE
END SELECT
CASE IDC_DATEPICKER
SELECT CASE dtp.nmhdr.code
CASE DTN_DATETIMECHANGE
' // Date Picker sends two DTN_DATETIMECHANGE messages.
'// Check if our global SYSTIME variable is different before updating for date and time
CDtPicker.GetSystemtime(dtp.nmhdr.hwndFrom, uFromSystemDate)
IF (uSystemDate.wYear <> uFromSystemDate.wYear) OR (uSystemDate.wMonth <> uFromSystemDate.wMonth) OR (uSystemDate.wDay <> uFromSystemDate.wDay) THEN
PostMessageW hWnd, WM_USER + 99, 0, 0
END IF
END SELECT
CASE IDC_TIMEPICKER
SELECT CASE dtp.nmhdr.code
CASE DTN_DATETIMECHANGE
PostMessageW hWnd, WM_USER + 99, 0, 0
END SELECT
END SELECT
FUNCTION WndProc (BYVAL hWnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
SELECT CASE uMsg
CASE WM_USER + 99
' // Update Form for date and time
UpdateForm()
CASE WM_CREATE
RETURN 0
CASE WM_COMMAND
SELECT CASE LOWORD(wParam)
CASE IDCANCEL
' // If ESC key pressed, close the application sending an WM_CLOSE message
IF HIWORD(wParam) = BN_CLICKED THEN
SendMessageW hwnd, WM_CLOSE, 0, 0
RETURN 0
END IF
END SELECT
CASE WM_NOTIFY
DIM uFromSystemDate AS SYSTEMTIME
DIM pTabPage AS CTabPage PTR ' // Tab page object reference
DIM ptnmhdr AS NMHDR PTR ' // Information about a notification message
ptnmhdr = CAST(NMHDR PTR, lParam)
SELECT CASE ptnmhdr->idFrom
CASE IDC_TABCONTROL
SELECT CASE ptnmhdr->code
CASE TCN_SELCHANGE
' // Show the selected page
pTabPage = AfxCTabPagePtr(ptnmhdr->hwndFrom, -1)
IF pTabPage THEN ..ShowWindow pTabPage->hTabPage, SW_SHOW
CASE TCN_SELCHANGING
' // Hide the current page
pTabPage = AfxCTabPagePtr(ptnmhdr->hwndFrom, -1)
IF pTabPage THEN ..ShowWindow pTabPage->hTabPage, SW_HIDE
END SELECT
CASE IDC_DATEPICKER
SELECT CASE ptnmhdr->code
CASE DTN_DATETIMECHANGE
' // Date Picker sends two DTN_DATETIMECHANGE messages.
'// Check if our global SYSTIME variable is different before updating for date and time
CDtPicker.GetSystemtime(ptnmhdr->hwndFrom, uFromSystemDate)
IF (uSystemDate.wYear <> uFromSystemDate.wYear) OR (uSystemDate.wMonth <> uFromSystemDate.wMonth) OR (uSystemDate.wDay <> uFromSystemDate.wDay) THEN
PostMessageW hWnd, WM_USER + 99, 0, 0
END IF
END SELECT
CASE IDC_TIMEPICKER
SELECT CASE ptnmhdr->code
CASE DTN_DATETIMECHANGE
PostMessageW hWnd, WM_USER + 99, 0, 0
END SELECT
END SELECT
CASE WM_SIZE
' // Get the tab control handle
DIM hTab AS HWND = GetDlgItem(hwnd, IDC_TABCONTROL)
' // Get a pointer to the tab page
DIM pTabPage AS CTabPage PTR = AfxCTabPagePtr(hTab, -1)
' // Resize the tab pages
IF pTabPage THEN pTabPage->ResizePages
RETURN 0
CASE WM_DESTROY
' // Destroy the tab pages
DIM hTab AS HWND = GetDlgItem(hwnd, IDC_TABCONTROL)
AfxDestroyAllTabPages(hTab)
PostQuitMessage(0)
EXIT FUNCTION
END SELECT
' // Default processing of Windows messages
FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)
END FUNCTION
CASE WM_NOTIFY
' // Notification messages
DIM dtp AS NMDATETIMECHANGE
CBNMTYPESET(dtp, wParam, lParam)
IF dtp.nmhdr.idfrom = IDC_DTPICKER THEN
IF dtp.nmhdr.code = DTN_DATETIMECHANGE THEN
' // Get the selected date
DIM wszDate AS WSTRING * 260
GetDateFormatW LOCALE_USER_DEFAULT, DATE_LONGDATE, @dtp.st, NULL, wszDate, SIZEOF(wszDate)\2
SetWindowText(GetDlgItem(hwnd, IDC_LABEL), "Selected date: " & wszDate)
END IF
END IF
CASE WM_NOTIFY
' lParam points to a NMDATETIMECHANGE structure
DIM pDtp AS NMDATETIMECHANGE PTR
pDtp = CAST(NMDATETIMECHANGE PTR, lParam)
IF pDtp->nmhdr.idfrom = IDC_DTPICKER THEN
IF pDtp->nmhdr.code = DTN_DATETIMECHANGE THEN
DIM wszDate AS WSTRING * 260
GetDateFormatW( _
LOCALE_USER_DEFAULT, _
DATE_LONGDATE, _
@pDtp->st, _
NULL, _
wszDate, _
SIZEOF(wszDate)\2)
SetWindowText(GetDlgItem(hwnd, IDC_LABEL), _
"Selected date: " & wszDate)
END IF
END IF