Main Menu

Recent posts

#91
José Roca Software / CXpButton
Last post by Richard Kelly - April 28, 2026, 10:17:34 PM
Are there any examples available for using CXpButton?
#92
PlanetSquires Software / Re: Tiko Editor v1.3.0 release
Last post by Richard Kelly - April 27, 2026, 11:16:18 PM
I did spent most of the last 6 months in 2025 learning Python for giggles and I ported my calendrical calculations. On GitHub at:

https://github.com/Crooit/Calendrical_Calculations-Python
#93
PlanetSquires Software / Re: Tiko Editor v1.3.0 release
Last post by Paul Squires - April 27, 2026, 09:45:37 AM
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.
#94
PlanetSquires Software / Re: Tiko Editor v1.3.0 release
Last post by Richard Kelly - April 26, 2026, 10:56:19 PM
After 50 years as a software engineer it took me around 3-4 years to get motivated after retirement. Perhaps you will take less time.

 ::)

FYI, 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.
#95
PlanetSquires Software / Re: Tiko Editor v1.3.0 release
Last post by Paul Squires - April 26, 2026, 10:32:25 PM
Thanks Richard, appreciate it! I need to start working on the next update. Trying to motivate myself  ;D
#96
PlanetSquires Software / Re: Tiko Editor v1.3.0 release
Last post by Richard Kelly - April 26, 2026, 09:47:01 PM
I downloaded Tiko and built a project with no issues. Found it quite straightforward to use.

Congratulations!

 8)
#97
José Roca Software / Re: Tab Control Question
Last post by Richard Kelly - April 26, 2026, 03:57:01 PM
I updated my notify code to use your macro as shown below and it works perfectly. Thank you for the tip.

      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
#98
José Roca Software / Re: Tab Control Question
Last post by Richard Kelly - April 26, 2026, 03:27:01 PM
I didn't know that Jose. I do want to use AFXNova as much as possible and I'll switch over my code. I did notice that the datepicker with the drop down calendar sends two DTN_DATETIMECHANGE notifications which I verified via Mr Google. I have a global SYSTIME defined that gets updated when I do my form update on date or time changes and found that if I check the DATEPICKER value and if it's different than my global, then do my form update I can avoid the form update on the second notification as shown below.

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
#99
José Roca Software / Re: Tab Control Question
Last post by José Roca - April 26, 2026, 02:16:06 PM
The wrappers are all optional. AfxNova is 100% SDK‑compatible, so you can use the wrappers for convenience or stick to straight SDK code if you prefer.

This macro, #define CBNMTYPESET(tp, wp, lp) memcpy @tp, CAST(ANY PTR, lp), SIZEOF(tp), allows to process WM_NOTIFY messages as if Windows were sending you an NM_ structure directly instead of a pointer to it. This avoids the need to use of pointers and casting.

But again, it is optional. Therefore, instead of:

      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

you can use plain SDK code.

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

In short, AfxNova simplifies SDK usage, but it never forces you to use the wrappers.

#100
José Roca Software / Re: Tab Control Question
Last post by hajubu - April 26, 2026, 08:50:41 AM
HI,
getting the hint from Jose for "the correct Listview  filling in /of the page"

I also adapted the snippet of listview_01b.bas now as a fourth Tabpage inside the TabCtrl01b.bas as my exercise using CListview.inc

Thanks ,  have fun !
Hans (hajubu)