Announcement

Collapse
No announcement yet.

HTMLHelp Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTMLHelp Question

    HTMLHelp Question

    Hello,

    The code below works fine, except it also activates (displays) my default browser (Edge). I have tried different variations of the code below, I still see the browser popping up as well.
    What can I do to stop the browser from popping up?

    Code:
    #Include "HTMLHelp.inc"
    
    HtmlHelp(hDlg, "Help.CHM", %HH_HELP_CONTEXT, 2)
    Fredrick Ughimi
    www.meganetsoft.com

  • #2
    Where in your code is the HtmlHelp
    (hDlg, "Help.CHM", %HH_HELP_CONTEXT, 2)
    placed?
    Is the call made as a response to a button click? More code would help. It doesn't respond here with FF default browser.
    Rod
    "To every unsung hero in the universe
    To those who roam the skies and those who roam the earth
    To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

    Comment


    • #3
      Hello Rodney,

      Thank you for your response.

      >>Where in your code is the HtmlHelp placed?
      HtmlHelp(hDlg, "Help.CHM", %HH_HELP_CONTEXT, 2)

      >>Is the call made as a response to a button click?

      Yes.

      Regards.
      Fredrick Ughimi
      www.meganetsoft.com

      Comment


      • #4
        "Help.CHM" + $NUL (STRINGZ or ASCIIZ)

        returncode
        hDlg <> 0


        https://forum.powerbasic.com/forum/u...p-file-from-pb

        https://support.microsoft.com/en-us/...g-help-windows
        https://duckduckgo.com instead of google

        Comment


        • #5
          Hello Mike,

          >>"Help.CHM" + $NUL (STRINGZ or ASCIIZ)

          I tried this initially and I got a parameter mismatch error. So I substituted the variable with the actual file.

          Code:
          #Include "HTMLHelp.inc"
          Local wsHelpFile As WSTRINGZ * %MAX_PATH
          wsHelpFile =  Exe.Path$ & "Help.CHM"  
          If IsTrue(Len(Dir$(wsHelpFile))) Then HtmlHelp(hDlg, wsHelpFile, %HH_HELP_CONTEXT, 2)
          >>hDlg <> 0

          That is true. Its 329548.

          Thanks for the links.
          Fredrick Ughimi
          www.meganetsoft.com

          Comment


          • #6
            Processing a button click is in the callback.

            DIALOG NEW is in some other function.

            But you are not using CB.HNDL in the call to HTMLHELP.

            How does the value of hDlg in the other function get to the hDlg variable in the callback function??
            Dale

            Comment


            • #7
              Hello Dale,

              >>But you are not using CB.HNDL in the call to HTMLHELP.

              I did try an equivalent in PrwDev IDE (nCBHNDL) and I got same result.
              Fredrick Ughimi
              www.meganetsoft.com

              Comment


              • #8
                If you could post some minimal code that you think should work and doesn't we would likely be able to address the problem.
                For what it's worth, the only 'help.chm' file on my machine is "C:\Program Files (x86)\HLP to RTF Converter\help.chm".
                On second thought.....
                The following code is an adapted copy of the file "FileFind.bas" in the DDT subdirectory of the PBWin\Samples directory. (I've added "*.CHM" to the extension list.
                If compiled and ran as a search for *.CHM files, it will list your file eventually if it exists and you can double-click that selection in the listview and it will launch the file for you. Thus, if it works, the code you need to do this in your own program is within this file.
                Code:
                '==============================================================================
                '
                '  FILEFIND.BAS for PowerBASIC Compiler for Windows
                '  Copyright (c) 2002-2011 PowerBASIC, Inc.
                '  All Rights Reserved.
                '
                '  PowerBASIC FileFind - fast recursive file searching.
                '
                '  This program shows how to do fast recursive file searching, plus how
                '  to list name, path, size and date in a virtual ListView control, from
                '  where a file can be opened with associated program via double-click.
                '
                '==============================================================================
                
                
                '------------------------------------------------------------------------------
                ' Metastatements
                '------------------------------------------------------------------------------
                #COMPILER PBWIN 10
                #COMPILE EXE
                #REGISTER NONE
                #DIM ALL
                '#RESOURCE MANIFEST, 1, "XPTheme.xml"
                
                
                '------------------------------------------------------------------------------
                ' Include files
                '------------------------------------------------------------------------------
                '#INCLUDE ONCE "Win32API.inc"
                #INCLUDE ONCE "InitCtrl.inc"
                #INCLUDE ONCE "WinNT.inc"
                #INCLUDE ONCE "WinNLS.inc"
                #INCLUDE ONCE "WinBase.inc"
                #INCLUDE ONCE "CommCtrl.inc"
                #INCLUDE ONCE "ShellAPI.inc"
                '------------------------------------------------------------------------------
                ' Equates
                '------------------------------------------------------------------------------
                %IDC_LABEL1    = %WM_USER + 2110 ' control ids
                %IDC_LABEL2    = %WM_USER + 2111
                %IDC_LABEL3    = %WM_USER + 2112
                %IDC_LABEL4    = %WM_USER + 2113
                %IDC_BTNPATH   = %WM_USER + 2120
                %IDC_BTNFIND   = %WM_USER + 2121
                %IDC_BTNHELP   = %WM_USER + 2122
                %IDC_LISTVIEW  = %WM_USER + 2130
                %IDC_COMBO1    = %WM_USER + 2140
                %IDC_TXT1      = %WM_USER + 2150
                %IDC_CHECK1    = %WM_USER + 2160
                
                '------------------------------------------------------------------------------
                ' Global variables
                '------------------------------------------------------------------------------
                GLOBAL gFileCount  AS LONG     ' counter for found files
                GLOBAL gSubDirs    AS LONG     ' flag for Include sub-dirs" checkbox
                GLOBAL gAbort      AS LONG     ' to enable cancel operation
                GLOBAL ghListView  AS LONG     ' ListView's handle
                GLOBAL glvSort     AS LONG     ' sort direction flag
                GLOBAL ghDlg       AS DWORD    ' main dialog's handle
                GLOBAL gtSize      AS QUAD     ' for calculating found files total size
                GLOBAL gfType      AS WSTRING  ' type of file to search for
                GLOBAL gStartPath  AS WSTRING  ' path to start search from
                GLOBAL gFiles()    AS WSTRING  ' array for found files
                GLOBAL gBusy       AS LONG     ' signal that the search is running
                
                
                '------------------------------------------------------------------------------
                ' Sort Files array and update ListView
                ' Note: ListView also provides a way to sort columns via a callback
                ' procedure, but we prefer speed, so we use PowerBASIC's ARRAY SORT instead.
                '------------------------------------------------------------------------------
                SUB SortColumn (BYVAL clmn AS LONG)
                
                    LOCAL i AS LONG
                    LOCAL dummy() AS WSTRING
                
                    glvSort = (glvSort = 0)                    ' Toggle direction flag
                    REDIM dummy(UBOUND(gfiles(1))) AS WSTRING   ' Use temporary array for sorting
                
                    FOR i = 0 TO UBOUND(gFiles(1))             ' Parse out proper "column" to temp. array
                        dummy(i) = PARSE$(gFiles(i), $TAB, clmn)
                    NEXT
                
                    IF glvSort THEN
                        ARRAY SORT dummy(), COLLATE UCASE, TAGARRAY gFiles(), DESCEND 'sort temp arr, tag original
                    ELSE
                        ARRAY SORT dummy(), COLLATE UCASE, TAGARRAY gFiles(), ASCEND
                    END IF
                
                    ' Redraw listview
                    CONTROL REDRAW ghDlg, %IDC_LISTVIEW
                
                END SUB
                
                
                '------------------------------------------------------------------------------
                ' Return properly formatted file date + time as string
                '------------------------------------------------------------------------------
                FUNCTION GetFileDateTime(dt AS FILETIME) AS WSTRING
                
                    LOCAL lpsystime AS SYSTEMTIME
                    LOCAL wszDate   AS WSTRINGZ * 64 ' date buffer, %LDT_SIZE = 64 bytes
                    LOCAL wszTime   AS WSTRINGZ * 64 ' time buffer, %LDT_SIZE = 64 bytes
                
                    ' convert given date to correct format
                    FileTimeToLocalFileTime dt, dt
                    FileTimeToSystemTime dt, lpsystime
                
                    GetDateFormatW %LOCALE_USER_DEFAULT, %DATE_SHORTDATE, _
                        BYVAL VARPTR(lpsystime), BYVAL %NULL, wszDate, SIZEOF(wszDate)
                
                    GetTimeFormatW %LOCALE_USER_DEFAULT, _
                        %TIME_FORCE24HOURFORMAT OR %TIME_NOSECONDS, BYVAL VARPTR(lpsystime), _
                        BYVAL %NULL, wszTime, SIZEOF(wszTime)
                
                    FUNCTION = wszDate + "  " + wszTime
                
                END FUNCTION
                
                
                '------------------------------------------------------------------------------
                ' Recursive file search procedure
                '------------------------------------------------------------------------------
                SUB ReadDirs (BYVAL PATH AS WSTRING)
                
                    LOCAL hSearch AS DWORD                 ' Search handle
                    LOCAL tmpSize AS QUAD                  ' QUAD, in case of huge files...
                    LOCAL WFD     AS WIN32_FIND_DATAW      ' FindFirstFile structure
                    LOCAL curpath AS WSTRINGZ * %MAX_PATH  ' What to search for
                
                    IF TALLY(PATH, "\") < 4  THEN        ' For added performance, update only if path is short
                        CONTROL SET TEXT ghDlg, %IDC_LABEL1, "Searching: " + PATH + "..."
                    END IF
                
                    curpath = PATH + gfType                     ' This is what we want to find
                    hSearch = FindFirstFileW(curpath, WFD)       ' Get search handle, if success
                    IF hSearch <> %INVALID_HANDLE_VALUE THEN    ' Loop through directory for files
                        DO
                            IF (WFD.dwFileAttributes AND %FILE_ATTRIBUTE_DIRECTORY) _  ' If not directory bit is set
                                <> %FILE_ATTRIBUTE_DIRECTORY THEN ' (files only here...)
                                DIALOG DOEVENTS                   ' let the system "breathe" ..
                                IF gAbort THEN EXIT DO            ' Has user cancelled?
                
                                '------------------------------------------------------------------
                                ' Store the info in tab-delimited array, for list view control.
                                ' This is where we can use these data for filtering (IF/THEN)
                                ' and/or add code for searching the found file for a string, etc.
                                '------------------------------------------------------------------
                                tmpSize = WFD.nFileSizeHigh * (%MAXDWORD + 1) + WFD.nFileSizeLow
                                gtSize = gtSize + tmpSize
                
                                IF gFileCount MOD 200 = 0 THEN
                                    REDIM PRESERVE gFiles(gFileCount + 200) AS GLOBAL WSTRING
                                END IF
                
                                gFiles(gFileCount) = WFD.cFileName + $TAB + PATH + $TAB + _
                                    FORMAT$(tmpSize, "* #######,") + $TAB + _
                                    GetFileDateTime(WFD.ftLastWriteTime)
                
                                INCR gFileCount
                
                                IF gFileCount < 20 THEN
                                    ' While less than 20 found, update every time
                                    ListView_SetItemCountEx(ghListView, gFileCount, %LVSICF_NOINVALIDATEALL)
                                    CONTROL SET TEXT ghDlg, %IDC_LABEL2, FORMAT$(gFileCount)
                                ELSE
                                    'if extensive search, update every 10th for better speed
                                    IF gFileCount MOD 10 = 0 THEN
                                        ListView_SetItemCountEx(ghListView, gFileCount, %LVSICF_NOINVALIDATEALL)
                                        CONTROL SET TEXT ghDlg, %IDC_LABEL2, FORMAT$(gFileCount)
                                    END IF
                                END IF
                            END IF
                        LOOP WHILE FindNextFileW(hSearch, WFD)
                
                        FindClose hSearch
                
                    END IF
                
                    IF gSubDirs THEN  'if to search in subdirectories.
                        curpath = PATH + "*"
                        hSearch = FindFirstFileW(curpath, WFD)
                
                        IF hSearch <> %INVALID_HANDLE_VALUE THEN
                            DO
                                IF (WFD.dwFileAttributes AND %FILE_ATTRIBUTE_DIRECTORY) = %FILE_ATTRIBUTE_DIRECTORY _
                                    AND (WFD.dwFileAttributes AND %FILE_ATTRIBUTE_HIDDEN) = 0 THEN  ' If dirs, but not hidden..
                
                                    IF WFD.cFileName <> "." AND WFD.cFileName <> ".." THEN          ' Not these..
                                        DIALOG DOEVENTS
                                        IF gAbort THEN EXIT DO
                
                                        '------------------------------------------------------------------
                                        ' Now we have a subdir, call function again to find eventual files
                                        ' (Each recursive call gets its own place on the stack)
                                        '------------------------------------------------------------------
                                        ReadDirs PATH + RTRIM$(WFD.cFileName, $NUL) + "\"
                                    END IF
                                END IF
                            LOOP WHILE FindNextFileW(hSearch, WFD)
                
                            FindClose hSearch
                
                        END IF
                    END IF
                
                END SUB
                
                
                '------------------------------------------------------------------------------
                ' Start and end point of a file search action
                '------------------------------------------------------------------------------
                SUB StartAction ()
                
                    LOCAL TXT AS WSTRING, t AS SINGLE
                
                    DIALOG DOEVENTS
                    CONTROL GET TEXT ghDlg, %IDC_BTNFIND TO TXT
                
                    IF TXT = "&Cancel" THEN
                        ' User has cancelled action
                        IF MessageBox(ghDlg, "Abort the search?", "PB FindFile", _
                            %MB_YESNO OR %MB_ICONQUESTION) = %IDYES THEN
                            gAbort = 1
                            gBusy  = %FALSE
                        END IF
                        DIALOG DOEVENTS
                    ELSE
                        ' Go...
                        t          = TIMER
                        gBusy      = %TRUE
                        gAbort     = 0
                        gFileCount = 0
                        REDIM gFiles(0) AS GLOBAL WSTRING                   ' Clear array
                        ListView_SetItemCountEx(ghListView, gFileCount, 0)  ' Clear virtual ListView
                
                        CONTROL SET TEXT  ghDlg, %IDC_LABEL2, "0"           ' Zero files found...
                        CONTROL GET TEXT  ghDlg, %IDC_COMBO1 TO gfType      ' Get type of file to search for
                        CONTROL GET TEXT  ghDlg, %IDC_TXT1   TO gStartPath  ' Get path to start from
                        CONTROL GET CHECK ghDlg, %IDC_CHECK1 TO gSubDirs    ' If to include sub-dirs in search
                
                        ' Disable system menu's close item
                        MENU SET STATE GetSystemMenu(ghDlg, 0), %SC_CLOSE, %MF_GRAYED
                
                        ' Change Search button into a Cancel-button
                        CONTROL SET TEXT ghDlg, %IDC_BTNFIND, "&Cancel"
                
                        ' Disable other controls
                        CONTROL DISABLE  ghDlg, %IDCANCEL
                        CONTROL DISABLE  ghDlg, %IDC_BTNHELP
                        CONTROL DISABLE  ghDlg, %IDC_BTNPATH
                        CONTROL DISABLE  ghDlg, %IDC_COMBO1
                        CONTROL DISABLE  ghDlg, %IDC_CHECK1
                        CONTROL DISABLE  ghDlg, %IDC_TXT1
                        DIALOG DOEVENTS
                
                        ' Reset total file size counter
                        gtSize = 0
                
                        ' Terminate with backslash
                        gStartPath = RTRIM$(gStartPath, ANY "\/") + "\"
                
                        '------------------------------------------------------------
                        ' Call the recursive search procedure
                        ReadDirs gStartPath
                
                        '------------------------------------------------------------
                        ' Resize array
                        REDIM PRESERVE gFiles(gFileCount - 1) AS GLOBAL WSTRING
                        ListView_SetItemCountEx(ghListView, gFileCount, %LVSICF_NOINVALIDATEALL)
                
                        ' Show proper result
                        CONTROL SET TEXT ghDlg, %IDC_LABEL2, FORMAT$(gFileCount)
                
                        ' Time taken
                        t = TIMER - t
                        TXT = STR$(gFileCount) + " " + gfType  + "  with a total size of " + _
                            FORMAT$(gtSize, "#,###") + " bytes." + _
                            " (in " + FORMAT$(t, "0.000") + " sec.)"
                        CONTROL SET TEXT ghDlg, %IDC_LABEL1, "Found: " + TXT
                
                        ' Make it search-button again
                        CONTROL SET TEXT ghDlg, %IDC_BTNFIND, "&Search"
                
                        ' Reenable controls
                        CONTROL ENABLE ghDlg, %IDCANCEL
                        CONTROL ENABLE ghDlg, %IDC_BTNHELP
                        CONTROL ENABLE ghDlg, %IDC_BTNPATH
                        CONTROL ENABLE ghDlg, %IDC_COMBO1
                        CONTROL ENABLE ghDlg, %IDC_CHECK1
                        CONTROL ENABLE ghDlg, %IDC_TXT1
                
                        ' Reenable system menu's close item
                        MENU SET STATE GetSystemMenu(ghDlg, 0), %SC_CLOSE, %MF_ENABLED
                
                        ' Allow the GUI to work fully again.
                        gBusy = %FALSE
                
                        DIALOG DOEVENTS
                    END IF
                
                END SUB
                
                
                '------------------------------------------------------------------------------
                ' Main callback
                '------------------------------------------------------------------------------
                CALLBACK FUNCTION DlgProc () AS LONG
                
                    LOCAL pNMLV    AS NM_LISTVIEW 'PTR
                    LOCAL pLVDI    AS LV_DISPINFOW PTR
                    LOCAL wszPath  AS WSTRINGZ * %MAX_PATH
                    STATIC wszName AS WSTRINGZ * %MAX_PATH
                    LOCAL c        AS LONG
                
                    SELECT CASE CB.MSG
                    CASE %WM_COMMAND
                        IF CB.CTLMSG <> %BN_CLICKED THEN EXIT SELECT
                
                        SELECT CASE CB.CTL
                
                        CASE %IDC_BTNFIND
                            StartAction         'Start a file search procedure
                
                        CASE %IDCANCEL
                            DIALOG END CB.HNDL   'Exit
                
                        CASE %IDC_BTNPATH
                            DISPLAY BROWSE CB.HNDL, , , "", "", %BIF_RETURNONLYFSDIRS OR %BIF_DONTGOBELOWDOMAIN OR %BIF_NONEWFOLDERBUTTON TO gStartPath
                            IF LEN(gStartPath) THEN
                                CONTROL SET TEXT CB.HNDL, %IDC_TXT1, gStartPath
                            END IF
                
                        CASE %IDC_BTNHELP
                            wszName = "Double-click on a search result to view the file." + $CRLF _
                                    + "Sort columns by clicking on the ListView headers."
                
                            MessageBoxW CB.HNDL, wszName, "Quick help...", %MB_ICONASTERISK
                
                        END SELECT
                
                    CASE %WM_DESTROY
                        ' Ensure eventual recursive action is broken on exit
                        gAbort = 1
                
                    CASE %WM_NCACTIVATE ' On return from other programs
                        IF CB.WPARAM THEN
                            LISTVIEW GET COUNT CB.HNDL, %IDC_LISTVIEW TO c
                            IF c THEN ' If listview has items
                                CONTROL SET FOCUS CB.HNDL, %IDC_LISTVIEW   ' Set focus to listview
                            ELSE
                                CONTROL SET FOCUS CB.HNDL, %IDC_BTNFIND    ' Else set focus to Search button
                            END IF
                        END IF
                
                    CASE %WM_NOTIFY
                        ' Handle ListView notifications only
                        IF LOWRD(CB.WPARAM) <> %IDC_LISTVIEW THEN EXIT SELECT
                
                        ' Obtain the NM_LISTVIEW UDT
                        TYPE SET pNMLV = CB.NMHDR$(SIZEOF(pNMLV))
                
                        SELECT CASE pNMLV.hdr.code
                
                            CASE %LVN_GetDispInfoW    ' virtual ListView asks for Item text
                                pLVDI = CB.LPARAM
                
                                IF (@pLVDI.item.mask AND %LVIF_TEXT) THEN
                                    wszName = PARSE$(gFiles(@pLVDI.item.iItem), $TAB, @pLVDI.item.iSubItem + 1)
                                    @pLVDI.item.pszText = VARPTR(wszName)
                                END IF
                
                            CASE %LVN_COLUMNCLICK   ' Click on column header
                                IF gBusy THEN
                                    ' Disable while adding items
                                    BEEP
                                    EXIT FUNCTION
                                END IF
                                IF pNMLV.iSubItem <> -1 THEN
                                    SortColumn pNMLV.iSubItem + 1  ' Sort clicked column
                                END IF
                
                            CASE %NM_DBLCLK         ' If double-click in ListView
                                IF gBusy THEN
                                    ' Disable while adding items
                                    BEEP
                                    EXIT FUNCTION
                                END IF
                                IF pNMLV.iItem > -1 THEN           ' then use ShellExecute to show file.
                                    LISTVIEW GET TEXT CB.HNDL, %IDC_LISTVIEW, pNMLV.iItem+1, 2 TO wszPath
                                    LISTVIEW GET TEXT CB.HNDL, %IDC_LISTVIEW, pNMLV.iItem+1, 1 TO wszName
                
                                    ShellExecute 0, "open", wszPath + wszName, "", "", %SW_SHOW
                                END IF
                
                        END SELECT
                
                    END SELECT
                
                END FUNCTION
                
                
                '------------------------------------------------------------------------------
                ' Main entry point for the application
                '------------------------------------------------------------------------------
                FUNCTION PBMAIN () AS LONG
                
                    LOCAL x       AS LONG
                    LOCAL y       AS LONG
                    LOCAL w       AS LONG
                    LOCAL xx      AS LONG
                    LOCAL yy      AS LONG
                    LOCAL dwStyle AS DWORD
                    LOCAL aStr    AS WSTRING
                    LOCAL bStr    AS WSTRING
                    LOCAL LVC     AS LV_COLUMNW
                    LOCAL szText  AS ASCIIZ * %MAX_PATH
                
                    ' Initialize the common control library with standard Windows 95 classes
                    InitComCtl32
                
                    '----------------------------------------------------------------
                    DIALOG NEW %HWND_DESKTOP, "PowerBASIC FileFind",,, 398, 117, _
                        %WS_CAPTION OR %WS_MINIMIZEBOX OR %WS_SYSMENU, 0 TO ghDlg
                
                    gStartPath = LEFT$(CURDIR$, 3) ' Grab root dir for start path
                    DIALOG GET SIZE ghDlg TO x, y
                
                    '----------------------------------------------------------------
                    ' We'll use the x-value to set some control's position - otherwise they may
                    ' end up outside the dialog if large fonts or other settings are used.
                
                    CONTROL ADD LABEL, ghDlg, %IDC_LABEL1, "",                5,   2, 325, 10
                    CONTROL ADD LABEL, ghDlg, %IDC_LABEL2, "0",            x-68,   2,  25, 10, %SS_RIGHT
                    CONTROL ADD LABEL, ghDlg, -1,          " files found", x-42,   2,  40, 10
                    CONTROL ADD LABEL, ghDlg, -1,          "File Type:",      8,  86,  40, 12
                    CONTROL ADD LABEL, ghDlg, -1,          "Start from:",     8, 102,  60, 12
                    CONTROL ADD TEXTBOX, ghDlg, %IDC_TXT1, gStartPath,       45, 100, 150, 12
                
                    aStr = "PowerBASIC FileFind" + $CR
                    bStr = "Fast recursive file" + $CR + "search in Windows"
                    w = x - 307
                    CONTROL ADD LABEL, ghDlg, -1, "",            298,  86, w, 27, %SS_GRAYRECT ' Acts as shadow...
                    CONTROL ADD LABEL, ghDlg, %IDC_LABEL3, aStr, 296,  84, w + 1, 28, %WS_BORDER OR %SS_CENTER
                    CONTROL ADD LABEL, ghDlg, %IDC_LABEL4, bStr, 298,  93, w - 3, 18, %SS_CENTER
                    CONTROL SET COLOR ghDlg, %IDC_LABEL3, &HC0, RGB(255, 255, 223) ' Red text, yellow background
                    CONTROL SET COLOR ghDlg, %IDC_LABEL4, &H0,  RGB(255, 255, 223) ' Black text, yellow background
                
                    DIM lst(8) AS WSTRING ' For file type combo
                    lst(0) = "*.*"
                    lst(1) = "*.BAS"
                    lst(2) = "*.BAT"
                    lst(3) = "*.INC"
                    lst(4) = "*.PBR"
                    lst(5) = "*.RC"
                    lst(6) = "*.RES"
                    lst(7) = "*.TXT"
                    lst(8) = "*.CHM"
                    CONTROL ADD COMBOBOX, ghDlg, %IDC_COMBO1, lst(),                    45, 84, 60, 120
                    CONTROL ADD CHECKBOX, ghDlg, %IDC_CHECK1, "Incl&ude sub-folders ", 115, 85, 80,  12
                    CONTROL SET CHECK ghDlg, %IDC_CHECK1, 1
                
                    CONTROL ADD BUTTON, ghDlg, %IDC_BTNFIND, "&Search",     204, 84, 42, 14, %WS_TABSTOP OR %BS_DEFAULT
                    CONTROL ADD BUTTON, ghDlg, %IDC_BTNPATH, " &Browse...", 204, 99, 42, 14
                    CONTROL ADD BUTTON, ghDlg, %IDC_BTNHELP, "&Help",       248, 84, 42, 14
                    CONTROL ADD BUTTON, ghDlg, %IDCANCEL,    "E&xit",       248, 99, 42, 14
                
                    COMBOBOX SELECT ghDlg, %IDC_COMBO1, 8
                    COMBOBOX GET TEXT ghDlg, %IDC_COMBO1 TO gfType
                
                    '----------------------------------------------------------------
                    dwStyle = %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %LVS_REPORT OR _
                        %LVS_SINGLESEL OR %LVS_OWNERDATA OR %LVS_SHOWSELALWAYS
                
                    CONTROL ADD LISTVIEW, ghDlg, %IDC_LISTVIEW, "", 4, 12, x - 12, 55, dwStyle, %WS_EX_CLIENTEDGE
                
                    CONTROL HANDLE ghDlg,%IDC_LISTVIEW TO ghListView
                
                    LISTVIEW GET STYLEXX ghDlg, %IDC_LISTVIEW TO dwStyle
                    dwStyle = dwStyle OR %LVS_EX_FULLROWSELECT OR %LVS_EX_INFOTIP
                    LISTVIEW SET STYLEXX ghDlg, %IDC_LISTVIEW, dwStyle
                
                    '----------------------------------------------------------------
                    ' Set up 4 ListView columns
                    CONTROL GET SIZE ghDlg, %IDC_LISTVIEW TO xx, y
                    x = GetSystemMetrics(%SM_CXVSCROLL)
                    DIALOG PIXELS ghDlg, x, y TO UNITS x, y
                    xx = xx - 4 - x' Adjust for vertical scrollbar
                
                    LISTVIEW INSERT COLUMN ghDlg, %IDC_LISTVIEW, 1, "Name", xx * 0.25, 0
                    LISTVIEW INSERT COLUMN ghDlg, %IDC_LISTVIEW, 2, "In folder", xx * 0.40, 0
                    LISTVIEW INSERT COLUMN ghDlg, %IDC_LISTVIEW, 3, "Size", xx * 0.15, 1
                    LISTVIEW INSERT COLUMN ghDlg, %IDC_LISTVIEW, 4, "Modified", xx * 0.20, 2
                
                    '----------------------------------------------------------------
                    DIALOG SHOW MODAL ghDlg CALL DlgProc
                
                END FUNCTION
                Rod
                "To every unsung hero in the universe
                To those who roam the skies and those who roam the earth
                To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                Comment


                • #9
                  Hello,

                  Sorry the fault is all mine. I had something in my CallBack Function I was trying out a while ago that was also firing each time I clicked the help button. I have removed the codes. Everything works fine now when I click on my help button. I now have to work on the F1 to bring up the help file which it actually does, except also bringing up Windows tips along with it.

                  Hello Rodney,

                  >>Thus, if it works, the code you need to do this in your own program is within this file.

                  It worked. Nice piece of adaptation there.

                  Thank you Rodney, Mike and Dale for your time.
                  Fredrick Ughimi
                  www.meganetsoft.com

                  Comment


                  • #10
                    Withdrawn - glad to hear you found the fault.

                    Comment


                    • #11
                      %WM_HELP
                      https://forum.powerbasic.com/forum/u...p-notification

                      FUNCTION = %TRUE

                      Sounds like you have child windows or PwrDev is subclassing.
                      Glad you got it almost working.

                      Sorry the fault is all mine. I had something in my CallBack Function I was trying out a while ago that was also firing each time I clicked the help button. I have removed the codes. Everything works fine now when I click on my help button. I now have to work on the F1 to bring up the help file which it actually does, except also bringing up Windows tips along with it.
                      https://duckduckgo.com instead of google

                      Comment


                      • #12
                        I'm glad you solved it yourself, it's always a joy to figure one's own way out of a problem.
                        Rod
                        "To every unsung hero in the universe
                        To those who roam the skies and those who roam the earth
                        To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                        Comment

                        Working...
                        X