Announcement

Collapse
No announcement yet.

Search Windows API functions

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

  • Search Windows API functions

    Gary posted a list of windows api functions that I found useful. This inspired me to write an application that would allow me to quickly filter through the list when searching for an api function.

    I posted a zip file here.

    It displays category, function, and description.

    In the text box you type in one or more groups of characters separated by spaces. The list will contain all the api calls that contain all of the sets of characters.

    For example "rect inter" will return 7 API functions that contain both rect and inter.
    LarryC
    Website
    Sometimes life's a dream, sometimes it's a scream

  • #2
    Updated to include some configuration. You can now select which API categories to include in the search as well as choosing which fields are searched.
    LarryC
    Website
    Sometimes life's a dream, sometimes it's a scream

    Comment


    • #3
      Updated to add icon, version information. Added Control+F as hot key for config.

      Added Enter and Escape on config screen. Support is badly hacked in. Would appreciate insight on how others support Default / Cancel actions on SDK windows in general.
      LarryC
      Website
      Sometimes life's a dream, sometimes it's a scream

      Comment


      • #4
        When canceling, changes stayed in GUI but didn't take effect. Updated to reset configuration to active selections on each visit to the configuration screen.
        LarryC
        Website
        Sometimes life's a dream, sometimes it's a scream

        Comment


        • #5
          Enabled the listview to be focused. Changed selection to always default to the first list item when changing the filter. Added a detail pane to make it easier to read long descriptions. If you click on the detail pane it launches google searching for your function.
          LarryC
          Website
          Sometimes life's a dream, sometimes it's a scream

          Comment


          • #6
            Larry,
            Thanks for the code posting ... playing with it now.

            Wouldn't you know the first time I pulled it up I typed in SendMessage and didn't find anything! Then I noticed that not all categories are selected. Can I select all categories with one command?

            Any chance you'll be adding syntax to the description field on the right?

            I never did a web search to see if there were any other apps like yours - that provides a strictly-API search and that also provides syntax info. After all these years, you'd thing there would be several utilities along those lines.

            Comment


            • #7
              Not presently, working on Select All, Clear All, Toggle.

              Syntax of the command seems useful, sigh, I'll have to rebuild the list Be a few on that, but I'm thinking I would like it too.

              Along those lines also been thinking about Events/Notifications/Commands for various controls.

              Thanks for the ideas.
              LarryC
              Website
              Sometimes life's a dream, sometimes it's a scream

              Comment


              • #8
                Larry,
                I've created a listing of notifications/messages for all of the common controls as well as other windows. I'll see if I can find where I posted it ... perhaps it was part of my web site PowerBASCI tutorial ... yep, here.)

                Looks like this (image below). The n and c terminology refers to whether the notification is received via %WM_Command or %WM_Notify.

                I'm pretty sure I have all of the information in an Excel sheet as well. I'll find that and post it.

                I'll also see what I can find that I've done in the way of a search routine. Surely I've done more than just let it sit in the original Excel file?

                All of this information is also in my gbSnippets PowerBASIC code library. In the library, I include a number of "reference" pages, which are more than just a single snippet.

                Two particular gbSnippets are:
                .Reference Materials --> Notifications, Messages, Styles (by Common Control)
                .Reference Materials --> Notifications, Messages, Styles (by Sys Object)

                But the whole gbSnippets PowerBASIC library ".Reference Materials" section has API listings, WM_Message listing, and other topics.

                Image from web site PowerBASIC tutorial:
                Last edited by Gary Beene; 27 Jun 2011, 12:15 PM.

                Comment


                • #9
                  And now that you're making me think about it, my latest copy of gbSnippets has Intellisense features, which includes the syntax for a large number of API. I've also posted the Intellisense code, and the corresponding API syntax files in the source code forum.

                  Here's how an API looks in gbSnippets, with Intellisense showing the arguments of the API while the user is typing.



                  In addition to what I posted in the Source Code forums, the raw API syntax data is also in the "words1.txt, words2.txt, and words3.txt" support files that ship with gbSnippets. Feel free to extract/use whatever you want from those files.

                  Comment


                  • #10
                    Misc bug fixes, put icons in buttons. Added select all, none, toggle. You can now select searching from MSDN, Google, or Bing. Also added double clicking list entry or pressing the space bar in the list will start search.

                    Function definitions are probabbly next.
                    LarryC
                    Website
                    Sometimes life's a dream, sometimes it's a scream

                    Comment


                    • #11
                      Larry
                      Maybe PB would put it in the file downloads if you ask
                      A dozen what.

                      Comment


                      • #12
                        NM, went to the page, nice link there
                        LarryC
                        Website
                        Sometimes life's a dream, sometimes it's a scream

                        Comment


                        • #13
                          Mostly added some new fields, so now the fields are category, type, function, link, description, and syntax.

                          Included the syntax on the detail pane. If you press Control+C in the list view it will copy the syntax to the clipboard.

                          Added a direct search option. Will take you directly to the MSDN page, at least until they re-org and then if you don't want to update the file you can always choose a search engine.

                          Also included a lot more of the windows API. There's some style, messages, notification codes, structures, etc.

                          Plan on allowing chosing selection of types to search (similar to categories). As well as adding syntax searching.

                          Also there's a couple of pages that make a grown man weep (they don't fit on the screen...), guess I'm going to have to put a window in a window for the detail so it can scroll at some point.

                          The file is still a tab delimited text file. In the description, ~ are formatted as paragraph breaks. if you choose to type a few in.

                          Also if you add any new lines, since there's no sorting currently, you'd probabbly want to use the DOS Sort command to get everything back in order (or what ever tool you prefer).
                          LarryC
                          Website
                          Sometimes life's a dream, sometimes it's a scream

                          Comment


                          • #14
                            Larry,

                            Just did a quick check out of the new app. Looking very nice! I especially like the jump to MSDN.

                            I'll use it some more tonight and will likely have a few questions and suggestions for you.

                            For example, I'd like it to open on the API where it closed. I'd like to be able to put an API on the command line and open to that API. I'd like to keep the window size/location between sessions.

                            Since you've given source code, I could do those things myself (I've published the code for those features), but I'm happy enough to make suggestions until you tell me "No more, please!"

                            Thanks again for the tool!

                            Did my gbSnippets files help out? If not, what source did you use for the syntax info? Did you have to strip it from MSDN one at a time or was there a repository somewhere with the info?
                            Last edited by Gary Beene; 2 Jul 2011, 10:31 PM.

                            Comment


                            • #15
                              Larry,
                              Another thought ...

                              Folks like me, who have written source code editors, might want to use your app as an external tool which they could call from within their editor.

                              We could start with your source code to import features that we want, but you might have some ideas on how to make your app and/or its features available to editor writers in a better way?

                              I don't have any specific suggestion at the moment - just wanted to pass the thought on to you.

                              Comment


                              • #16
                                Originally posted by Gary Beene View Post
                                ...API. I'd like to keep the window size/location between sessions.
                                ....
                                Did my gbSnippets files help out? If not, what source did you use for the syntax info? Did you have to strip it from MSDN one at a time or was there a repository somewhere with the info?
                                ...
                                might want to use your app as an external tool ....
                                The size should be in there, guess I could do position also, was using default window positions, but I can see merit in a sticky window

                                It was the MSDN route. Although another route that has merit would be the PB .inc files to get actual PB syntax instead of C syntax. I dabble a bit in C++ also so this worked better for me.

                                Since I supply code they could actually use it "internally". Just tweek SearchAPI (say using a child window instead of a top level window), Make PBMain a Function returning a handle, skip my Run command and I'm guessing it would drop in most apps. I suppose it could be DLL ized too. interesting thought.

                                From the external perspective, wouldn't adding the command line api along with say a single instance option do the trick?

                                Thanks for the suggestions, keep em comming Since this I think qualifies as my first actual PB app, seeing some of those features in use I'm finding particularly useful.
                                LarryC
                                Website
                                Sometimes life's a dream, sometimes it's a scream

                                Comment


                                • #17
                                  This is a pretty good app you have here, very useful!!
                                  I did the following with my own version of the 'Facilities Collection'.
                                  In the 'Stringers' program under one of the Reserved buttons I placed the following:
                                  Code:
                                  CASE %IDC_RSRV6
                                            LOCAL pidrsrv6 AS DWORD
                                            CHDIR "C:\PBWin10\Programs\gripers\SearchAPISource"
                                            pidrsrv6=SHELL("SearchAPI.exe",1)
                                            CHDIR "..\Facilities"
                                  And it works like a charm with no extra effort on your part.
                                  It would have been a tad less typing for me if I had installed it in my 'Facilities' directory.
                                  Would have been :
                                  Code:
                                  CHDIR "..\SearchAPISource"
                                  pidrsrv6=SHELL("SearchAPI.exe",1)
                                  CHDIR "..\Facilities"
                                  Big time thanks!!!
                                  Last edited by Rodney Hicks; 3 Jul 2011, 05:59 AM.
                                  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


                                  • #18
                                    Awesome, enjoy.
                                    LarryC
                                    Website
                                    Sometimes life's a dream, sometimes it's a scream

                                    Comment


                                    • #19
                                      Added command line options:

                                      Code:
                                      SearchAPI.exe [/?] [/H] [/1] [/X] [/L] [/s] [/F] [searchString]
                                      /?, /H - Display this help
                                      /1 - Only allow a single instance to run
                                      /X - Exit after command
                                      /L - Return list of matching functions
                                      /S - Return syntax for first matching command
                                      /F - Return tab delimited information for first matching command.
                                       
                                      Fields in /F are: category, type, function name, msdn link, description, C calling syntax.
                                        In the description field the ~ character represents a paragraph break.
                                      Use /X in conjunction with /L, /S, and /F to use SearchAPI as an engine. Results are returned to standard out.

                                      Also added two messages to top level window:
                                      Code:
                                      %AM_FIND = &H0401: ' lParam pointer to zero terminated string to find, for apps where SearchAPI is internal.
                                      %AM_CHAR = &H0402: ' wParam is a character, 0 is the terminator, send each character and then a 0. For apps external to SearchAPI.
                                      If you use SearchAPI as part of your app, AM_FIND (and all the functions really) can be used.

                                      If SearchAPI is external, you can send characters to the search window using AM_CHAR.

                                      Added selection of filtering for types of entries (it's on the config window).

                                      Made the window "sticky", pops back up in it's last position and size.

                                      The last search is remembered. This can be overriden at the command line.

                                      The application now supports several types of interfacing. 1) Sending windows messages to "drive" searching. 2) Via the command line and Standard Out with single instancing. 3) Via the command line, Standard Out and /X to use as an engine.

                                      Edit: If you want to see the output in the command window, use SearchAPI options | more
                                      Last edited by Larry Charlton; 3 Jul 2011, 09:44 AM.
                                      LarryC
                                      Website
                                      Sometimes life's a dream, sometimes it's a scream

                                      Comment


                                      • #20
                                        Larry,

                                        How about an exe for those of us who don't have the new compiler yet?

                                        Just asking. :wave:

                                        Comment

                                        Working...
                                        X