Announcement

Collapse
No announcement yet.

a in the works program to list directory and select file to open or print

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

  • a in the works program to list directory and select file to open or print

    I had made a post in the cafe section on a program to list files from a directory to allow a person, that is not so computer savy, to make easy selections to open a file or print a file.

    The ultimate goal is to list a directory, or a directory with all subdirectory files or files that are selected such as *.doc for maybe word. So by selecting a file with a file extension that is associate with a program is what i am looking at doing here.

    The program is designed to run from a batch file or shelled from some other program while using the command tail to choose a directory and files inside the directory.

    I am going to need some help where i cannot find solutions to problems where i have searched on the forum so i going to use this thread to post my code and have each problem stated in a different post. That maybe easier.

    The program will evolve, first from something simple to an end program, that way somebody might want to use the program in a less that polished code. Meaning the code would be reduced but effective for a lot of routines.

    One of the biggest change will be where a directory of the files will be retrieved first using the DlgDirList method and the second using DIR$.

    In listing of files, the user will not be able to change directories while inside the program. The files will be selected upon program startup and placed into a listbox for selection. The only change in display i want a user to make is in filtering the listing. I personally do not want a user to be wandering all over the drive directories. I want to make it safe as possible.

    In the final program, i would like to make several options available on the command line.
    1 option to exclude executable programs from the listing by extension.
    2 only list files where the file extensions have known file types.
    using this option 2 would reinforce people to save files with known file types
    3 exclude out or include only any files that have a specfic file extension
    4 option to have the program read a ini file for the program to use rather than a command line with an additional option to delete the ini file after program startup.

    thanks for reading my post and any help in advance.
    paul
    p purvis

  • #2
    ok
    after pounding the keyboard, i have come up with a reasonable piece of code that will do the fundamental thing i wanted to do in the beginning in a very basic way.
    i still do not want a user of the this program to be hopping around on the drive to different directories and this program does not list subdirectories which would still be alright for a lot of purposes. i guess i will need two programs. this one and another to handle directories with subdirectories because i want all files to be listed in one single listbox.

    the print option will send the file to the default printer but it would nice to either preselect a printer or have it go to a print dialog where a printer is chosen.

    i would like to get some feed back also on the screen layout, can it be better? remember the program is made for the not so computer savy people.

    i have the newest program at
    http://pdptemp.dyndns.org/zipcode

    it is called EXTRUNFL.EXE
    In running the program, a directory/folder placed on the command tail required.


    paul

    Code:
    #COMPILE EXE    'pbwin 8.04
    #DIM ALL
    #INCLUDE "WIN32API.INC"
    %IDD_DIALOG1      =  101
    %IDC_TEXTBOX1     = 1001
    %IDC_LISTBOX1     = 1002
    %IDC_BUTTON1      = 1003
    %IDC_BUTTON2      = 1004
    %IDC_BUTTON3      = 1005
    %IDC_LABEL1       = 1009
    %IDC_OPTION1      = 1011
    %IDC_OPTION2      = 1012
    %IDC_BUTTON4      = 1013
    %IDC_BUTTON5      = 1014
    %IDC_LABEL2       = 1015
    %IDC_LABEL3       = 1016
    %IDC_LABEL4       = 1017
    %IDC_LABEL5       = 1018
    %IDC_OPTION3      = 1019
    
    
    DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
    DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
    GLOBAL gamainarray() AS STRING
    GLOBAL gdialogbox1 AS DWORD
    GLOBAL gselectedfile AS STRING
    GLOBAL gsdirectoryget AS STRING
    GLOBAL glmainarrayitems AS LONG
    GLOBAL Glsortdirection AS LONG
    GLOBAL gaworkarray() AS STRING
    GLOBAL glworkarrayitems AS LONG
    GLOBAL Gaundoarray() AS STRING
    GLOBAL glundoarrayitems AS LONG
    GLOBAL glfilterleave AS LONG
    GLOBAL glfilterremove AS LONG
    GLOBAL glfilterundo AS LONG
    GLOBAL gsfiltertext AS STRING
    
    
    
    
    FUNCTION usethefile(sfiletoopen AS STRING) AS STRING
      LOCAL zsText AS ASCIIZ * 256
      zstext=sfiletoopen
      ShellExecute(%NULL , "open",zstext,BYVAL %NULL, CURDIR$, %SW_SHOWNORMAL)
    END FUNCTION
    
    
    FUNCTION printthefile(sfiletoopen AS STRING) AS STRING
      LOCAL zsText AS ASCIIZ * 256
      zstext=sfiletoopen
      ShellExecute(%NULL , "print",zstext,BYVAL %NULL, CURDIR$, %SW_SHOWNORMAL)
    END FUNCTION
    
    
    FUNCTION getfilefromlist() AS STRING
        LOCAL Result1&, Result2&
        LOCAL TXT$
        CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCURSEL, 0, 0 TO Result1&
        gselectedfile=""
        TXT$=""
        IF Result1& >= 0 THEN
          LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, Result1&+1&
          LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO TXT$
         END IF
    FUNCTION=TXT$
    END FUNCTION
    
    
    FUNCTION restorefilelist() AS STRING
         LOCAL Result1&, Result2&
         LOCAL I  AS LONG
         LOCAL TXT$
         CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCURSEL, 0, 0 TO Result1&
         TXT$=""
                 IF Result1& >= 0 THEN
                    LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, Result1&+1&
                    LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO TXT$
                  END IF
    
        REDIM gaworkarray(0 TO glmainarrayitems-1&)
        FOR I=0& TO glmainarrayitems-1&
            gaworkarray(I)=gamainarray(I)
            NEXT I
       glsortdirection=1&
       glworkarrayitems=glmainarrayitems
       LISTBOX RESET gdialogbox1, %IDC_LISTBOX1
       FOR I=0 TO glworkarrayitems-1&
        LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, gaworkarray(I)
       NEXT I
       IF LEN(TXT$)>0& THEN
        FOR I=0 TO glworkarrayitems-1&
        IF gaworkarray(I)=TXT$ THEN LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, I&+1&:EXIT
        NEXT I
       END IF
       CONTROL SET FOCUS gdialogbox1, %IDC_LISTBOX1
    
    
    END FUNCTION
    
    FUNCTION seedmainarray() AS STRING
        LOCAL Result1&, Result2&
        LOCAL I AS LONG
        LOCAL TXT$
            CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCURSEL, 0, 0 TO Result1&
            TXT$=""
            IF Result2& >= 0 THEN
               CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCOUNT, 0, 0 TO Result2&
               REDIM gamainarray (0& TO Result2&-1&)
               FOR I=0 TO result2&-1&
               LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, I+1&
               LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO gamainarray(I)
               NEXT I
               glsortdirection=1&
               ARRAY SORT gamainarray(), COLLATE UCASE, ASCEND
               END IF
    END FUNCTION
    
    
    FUNCTION applyfilter() AS STRING
        IF glworkarrayitems<1& THEN EXIT FUNCTION
         LOCAL Result1&, Result2&
         LOCAL I, J AS LONG
         LOCAL TXT$
         CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCURSEL, 0, 0 TO Result1&
         TXT$=""
                 IF Result1& >= 0 THEN
                    LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, Result1&+1&
                    LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO TXT$
                  END IF
    
    
           LISTBOX RESET gdialogbox1, %IDC_LISTBOX1
           FOR I=1& TO 10&
           LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, " "
           NEXT I
           LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, "  please wait while filter is being applied"
    
                IF glfilterundo THEN
                   glworkarrayitems=glundoarrayitems
                   REDIM gaworkarray(0& TO glworkarrayitems-1&)
                   FOR I=0 TO glworkarrayitems-1&
                       gaworkarray(I)=gaundoarray(I)
                   NEXT I
    
                   GOTO RELISTUNDOARRAY
              END IF
    
              IF glfilterleave+glfilterremove THEN
                   glundoarrayitems=glworkarrayitems
                   REDIM gaundoarray(0& TO glundoarrayitems-1&)
                   FOR I=0 TO glworkarrayitems-1&
                       gaundoarray(I)=gaworkarray(I)
                   NEXT I
              END IF
    
               J=-1
               FOR I=0 TO glworkarrayitems-1&
                  IF glfilterleave THEN
                      IF INSTR(UCASE$(gaworkarray(I)),UCASE$(gsfiltertext))>0& THEN INCR J:gaworkarray(J)=gaworkarray(I)
                   ELSE
                   IF glfilterremove THEN
                       IF INSTR(UCASE$(gaworkarray(I)),UCASE$(gsfiltertext))=0& THEN INCR J:gaworkarray(J)=gaworkarray(I)
                   END IF
                  END IF
    
               NEXT I
               glworkarrayitems=J+1&
               REDIM PRESERVE gaworkarray(0& TO glworkarrayitems-1&)
    
         RELISTUNDOARRAY:
    
               LISTBOX RESET gdialogbox1, %IDC_LISTBOX1
               REM redisplay in listbox
               FOR I=0 TO glworkarrayitems-1&
               LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, gaworkarray(I)
               NEXT I
               IF LEN(TXT$)>0& THEN
                 FOR I=0 TO glworkarrayitems-1&
                   IF gaworkarray(I)=TXT$ THEN LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, I&+1&:EXIT IF
                 NEXT I
               LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, 1&
               END IF
        CONTROL SET FOCUS gdialogbox1, %IDC_LISTBOX1
    END FUNCTION
    
    
    
    
    
    FUNCTION sortfilelist() AS STRING
        LOCAL Result1&, Result2&
        LOCAL I AS LONG
        LOCAL TXT$
            CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCURSEL, 0, 0 TO Result1&
            TXT$=""
                  IF Result1& >= 0 THEN
                    LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, Result1&+1&
                    LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO TXT$
                  END IF
    
              CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCOUNT, 0, 0 TO Result2&
               IF Result2& >= 0 THEN
    
               REDIM gaworkarray (0& TO Result2&-1&)
               FOR I=0 TO result2&-1&
               LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, I+1&
               LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO gaworkarray(I)
               NEXT I
    
               LISTBOX RESET gdialogbox1, %IDC_LISTBOX1
               FOR I=1& TO 10&
               LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, " "
               NEXT I
               LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, "        please wait while list is being sorted"
               IF glsortdirection=0& THEN
                  glsortdirection=1&
                  ARRAY SORT gaworkarray(), COLLATE UCASE, DESCEND
                     ELSE
                  glsortdirection=0&
                  ARRAY SORT gaworkarray(), COLLATE UCASE, ASCEND
               END IF
    
               LISTBOX RESET gdialogbox1, %IDC_LISTBOX1
               FOR I=0 TO result2&-1&
               LISTBOX ADD gdialogbox1, %IDC_LISTBOX1, gaworkarray(I)
               NEXT I
               IF LEN(TXT$)>0& THEN
                 FOR I=0 TO result2&-1&
                   IF gaworkarray(I)=TXT$ THEN LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, I&+1&:EXIT
                 NEXT I
               END IF
            END IF
              CONTROL SET FOCUS gdialogbox1, %IDC_LISTBOX1
    END FUNCTION
    
    
    
    FUNCTION PBMAIN()
        LOCAL COMMANDLINE AS STRING
    
        ' setup some initial values for program
        commandline=TRIM$(COMMAND$)
        gsdirectoryget=commandline
        IF LEN(gsdirectoryget)=0 THEN
            MSGBOX "a command tail is needed with this program"
            EXIT FUNCTION
         END IF
        glsortdirection=1&
        glfilterleave=0&
        glfilterremove=0&
    
        ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION
    
    CALLBACK FUNCTION buttoncallbackleave() AS LONG
    glfilterleave=1&
    glfilterremove=0&
    glfilterundo=0&
    END FUNCTION
    
    CALLBACK FUNCTION buttoncallbackremove() AS LONG
    glfilterleave=0&
    glfilterremove=1&
    glfilterundo=0&
    END FUNCTION
    
    CALLBACK FUNCTION buttoncallbackundo() AS LONG
    glfilterleave=0&
    glfilterremove=0&
    glfilterundo=1&
    END FUNCTION
    
    
    
    CALLBACK FUNCTION ShowDIALOG1Proc()
    
        SELECT CASE AS LONG CBMSG
            CASE %WM_INITDIALOG
                     seedmainarray
                     restorefilelist
                     LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, 1&
                     sortfilelist
            CASE %WM_NCACTIVATE
                STATIC hWndSaveFocus AS DWORD
                IF ISFALSE CBWPARAM THEN
                    hWndSaveFocus = GetFocus()
                ELSEIF hWndSaveFocus THEN
                    SetFocus(hWndSaveFocus)
                    hWndSaveFocus = 0
                END IF
    
            CASE %WM_COMMAND
                SELECT CASE AS LONG CBCTL
                    CASE %IDC_TEXTBOX1
    
                    CASE %IDC_LISTBOX1
    
                    CASE %IDC_BUTTON1
                        IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                        gselectedfile=getfilefromlist()
                           IF LEN(gselectedfile)>0 THEN
                              usethefile(gselectedfile)
                           END IF
                        END IF
    
                    CASE %IDC_BUTTON2
                        IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                          gselectedfile=getfilefromlist()
                           IF LEN(gselectedfile)>0 THEN
                              printthefile(gselectedfile)
                           END IF
                        END IF
    
                    CASE %IDC_BUTTON3
                        IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                           CONTROL GET TEXT  gdialogbox1, %IDC_TEXTBOX1 TO gsfiltertext
                           gsfiltertext=TRIM$(gsfiltertext)
                           IF LEN(gsfiltertext)>0 THEN
                            IF (glfilterleave+glfilterremove+glfilterundo)>0& THEN
                              applyfilter
                             END IF
                          END IF
    
                        END IF
    
                    CASE %IDC_BUTTON4
                        IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                            restorefilelist
                            sortfilelist
                        END IF
    
                      CASE %IDC_BUTTON5
                             IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                              sortfilelist
                              END IF
    
                      CASE %IDC_LABEL1
    
                END SELECT
        END SELECT
    END FUNCTION
    
    
    
    
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        LOCAL lRslt AS LONG
        LOCAL hDlg  AS DWORD
        LOCAL dwCount AS DWORD
        LOCAL szDir AS ASCIIZ*128
    
        DIALOG FONT "Courier New",8
    
        DIALOG NEW hParent, "EXTRUNFL", 79, 70, 430, 360, %DS_MODALFRAME OR _
        %WS_MINIMIZEBOX OR %WS_MAXIMIZEBOX OR %WS_CAPTION OR %WS_SYSMENU, 0 TO hDlg
    
        CONTROL ADD LISTBOX, hDlg, %IDC_LISTBOX1, , 0, 11, 1835, 325, %WS_CHILD _
            OR %WS_VISIBLE OR %WS_HSCROLL OR %WS_VSCROLL OR _ _
            %LBS_NOTIFY  , %WS_EX_CLIENTEDGE OR %WS_EX_LEFT 'OR %WS_EX_LTRREADING _
                          'OR %WS_EX_RIGHTSCROLLBAR
    
        CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "", 0, 1, 145, 10
        CONTROL ADD OPTION,  hDlg, %IDC_OPTION1, "Keep", 144, 0, 28, 10,, CALL buttoncallbackleave()
        CONTROL ADD OPTION,  hDlg, %IDC_OPTION2, "Remove", 174, 0, 35, 10,, CALL buttoncallbackremove()
        CONTROL ADD OPTION,  hDlg, %IDC_OPTION3, "Un", 210, 0, 20, 10,, CALL buttoncallbackundo()
         CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON3, "Filter it", 232, 0, 38, 10
        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON4, "Reset", 272, 0, 24, 10
        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON5, "Sort", 306, 0, 20, 10
    
        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON1, "Use file", 334, 0, 46, 10
        CONTROL ADD BUTTON,  hDlg, %IDC_BUTTON2, "Print file", 382, 0, 46, 10
        CONTROL ADD LABEL,   hDlg, %IDC_LABEL1, "Error reading directory/folder "+gsdirectoryget, 0, 332, 425, 10
    
        'CONTROL ADD LABEL,   hDlg, %IDC_LABEL2, "Name of file not used at this time", 0, 341, 425, 10
        'CONTROL ADD LABEL,   hDlg, %IDC_LABEL3, "Date of file not used at this time", 0, 350, 288, 10
        'CONTROL ADD TEXTBOX,   hDlg, %IDC_LABEL4, "This box is not used at this time", 290, 350, 135, 10
    
        szdir=gsdirectoryget
        CALL DlgDirList(hDlg,szdir,%IDC_LISTBOX1,%IDC_LABEL1, %DDL_READONLY OR %DDL_READWRITE OR %DDL_ARCHIVE)
        REDIM gamainarray (0& TO 0&)
    
        CONTROL SEND hdlg, %IDC_LISTBOX1, %LB_GETCOUNT, 0, 0 TO dwcount
        'rem global variable
        gdialogbox1=hdlg
        glmainarrayitems=dwcount
        glworkarrayitems=glmainarrayitems
    
        DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
        FUNCTION = lRslt
    END FUNCTION
    p purvis

    Comment


    • #3
      I want to load a large string array into a listbox.
      Is there a limit on the number of items or memory size other than what is in the computer?

      My program shows some very strange action when it comes to reloading an large number array items into a listbox?
      i have put 7000 files into a directory to test the programs speed.
      The initial load of files into the listbox runs fast, so does the sort routine to sort 7000 files and reload back into the listbox.
      But on a refresh, where i reload the directory back into the listbox, the reload of the listbox slows way down.

      the bottle neck is inside the function regetdirlisting where i am reloading the directory, it is slow, but the funny thing is my sort program runs fast enough and it reloads the listbox.

      I have seen in poffs about listview being slow to reload and i guess the same thing affects the listbox control as well.

      When the routine run prior to DIALOG SHOW, the routine is also fast. It must have something to do with while a dialog or control listbox is active.

      Maybe somebody has solved the problem or a work around.

      My final program will need to load all the files on a hard drive, so i am concerned about the number of files being just 7000.

      my latest files EXTRUNFL.BAS AND EXTRUNFL.EXE
      are at http://pdptemp.dyndns.org/zipcode

      thanks for any help.
      paul
      Last edited by Paul Purvis; 25 Feb 2008, 03:57 AM.
      p purvis

      Comment


      • #4
        I found the problem above and found a solution.

        The problem to my program being slow was that i was reading the listbox into an array using the LISTBOX SELECT and LISTBOX GET TEXT to acquire each line in the listbox.

        The number of lines in the LISTBOX CONTROL where large in number, above 7000 lines

        I wan to mention there was no problem in speed with using the LISTBOX ADD.

        The solution to my problem was to change the size of the listbox control to a width of 0 and a height of 0 before using the LISTBOX SELECT AND LISTBOX GET TEXT commands.
        Then after you have run those commands along with your code to retreive and possibly update the listbox, then set the size of the listbox back to the original size.


        A better solution to a lot of the uses of the listbox control where a large number of lines could possibly be in the listbox in my option would be to prior before any working with a listbox where sorting or retreiveing information from the listbox would be to use the command LISTBOX DISABLE then CONTROL SIZE then process your work then CONTROL SIZE then LISTBOX ENABLE.

        If there is a better way to do this using DDT, i am all ears with some hearing loss, so shout it out.

        an example of what i did is below
        Code:
        'rem my dialog id variable is gdialogbox1 which is usually hdlg
        '%IDC_LABEL1 is a control label where the directory name will be send 
        'so i guess if you use this code
        'use CONTROL ADD LABEL to create a label name with the id %IDC_LABEL1
        
        
         LOCAL szDir AS ASCIIZ*255
        
        LISTBOX ENABLE gdialogbox1, %IDC_LISTBOX1
        'REM the original size of the list box is 428, 325
        CCONTROL SET SIZE  gdialogbox11, %IDC_LISTBOX1,0, 0
            szdir=gsdirectoryget
            LISTBOX RESET gdialogbox1, %IDC_LISTBOX1
            CALL DlgDirList(gdialogbox1,szdir,%IDC_LISTBOX1,%IDC_LABEL1, _
                  %DDL_READONLY OR %DDL_READWRITE OR %DDL_ARCHIVE)
            REDIM gamainarray (0& TO 0&)
          
            CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETCOUNT, 0, 0 TO dwcount
        
            glmainarrayitems=dwcount
          
            REDIM gamainarray(0& TO glmainarrayitems-1&)
                    FOR I=0 TO glmainarrayitems-1&
                     LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, I+1&
                     LISTBOX GET TEXT gdialogbox1, %IDC_LISTBOX1 TO gamainarray(I)
          
                    NEXT I
                   ARRAY SORT gamainarray(), COLLATE UCASE, ASCEND
        
         CONTROL SET SIZE  gdialogbox1, %IDC_LISTBOX1,428, 325
        LISTBOX ENABLE gdialogbox1, %IDC_LISTBOX1
        
                   LISTBOX SELECT gdialogbox1, %IDC_LISTBOX1, 1&
                  CONTROL SET FOCUS gdialogbox1, %IDC_LISTBOX1
        bold font working nicely, i need to use it more
        Last edited by Paul Purvis; 25 Feb 2008, 05:42 PM.
        p purvis

        Comment


        • #5
          a poor man's menu for windows programs

          well i had sort of new idea.

          use the EXTRUNFL program i wrote in the source code section to be used as a poor man's program menu.


          because this program will
          not let you or users do things to files like the explorer does let you do in windows
          keep you from having so many icons on desktop
          keep from having so many shortcuts on the taskbar that keep you from seeing more important information on the taskbar
          keep users from hurting themselves by easily removing shortcuts from the desktop or items in the programs menu thereby not being able to run programs

          make it easier to distribute a way for programs to start on user's computers connected to a network.
          make it easier to produce a menu for programs
          remove batch files from directories in the environmental path and still make it easier for the user to get too.
          make it easier for a msdos program to be started under windows for new window users.
          make the desktop less cluttered
          give long descriptive names to programs
          make it less possible for user to click on a program more that once and that starts a second or more instances of the same program

          just use this program
          how
          create a new directory where these batch, exe, com files will be located that is not in the path.

          place your files in there, you can make your batch files have long names that are more descriptive.
          even start your batch file names by something that will be sorted in a way that the users will recognize and be more meaningful, such as A_Microsoftword.bat, A_Fifefox.bat, Z_Defrag.bat,X_Ccleaner.bat. Now the user will be organized and make less mistakes.

          maybe place some of your lnk files in another directory and have your batch files run them.

          This may make it much easier on you if you are having to keep recreating shortcuts because somebody keeps deleting them.
          You can also place these files on shared directory to make it easier update and keep every computer to some kind of a standard.

          In doing this you can create only a few shortcuts on your desktops that would point to different directories or better yet have a batch file in directory that is also in the path and make a shortcut to that batch file and have inside that batch file the command lines to run the EXTRUNFL with a command line indicating the directory to load.
          that way, when the user deletes the shortcut on accident, you can just have them type the batch file from the run command and they are back in business until you help them create a new shortcut.

          i hope i communicated that well enough and it helps give you a better quality of life.

          that is my idea i am going to implement

          you may want to alter the EXTRUNFL program to have a few different programs by basically removing some items, such as the print button.

          i still have some things features i want to add to that program and i am still thinking up startup options for that program.

          paul
          p purvis

          Comment


          • #6
            In earlier versions of windows, I believe the item count may have been limited to 32,767.

            Rather than resetting the size for speed purposes (which is effectively disabling the real speed bottleneck, repainting), you might consider using WM_SETREDRAW to disable repaint, and simply re-enable after you are finished, and redraw 1 time.

            For retrieving item text, I would suggest you use an alternative to the DDT statements as you are using them for speed.

            You can use the LB_GETTEXT message to retrieve text of a specific item, without having to select each one.

            Example:

            Code:
            LOCAL szBuf AS ASCIIZ * %MAX_PATH ' (%MAX_PATH is good size for filenames, ensures enough size)
            FOR I=0 TO glmainarrayitems-1&
                CONTROL SEND gdialogbox1, %IDC_LISTBOX1, %LB_GETTEXT, I, VARPTR(szBuf)
                gamainarray(I) = szBuf
            NEXT I
            Adam Drake
            Drake Software

            Comment

            Working...
            X