Announcement

Collapse
No announcement yet.

WinSpy

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

  • WinSpy

    Am currently rewriting (3rd? 4th? 6th? 10th? time over the years) a data manager I've used for about 25 years (one of the first PBWin projects I tackled when I came from the Dark Side (DOS)). At any rate on another thread Borje's WinSpy was mentioned and I thought I'd take another look at it. I tried it on ExplorerPlus (file manager) but it didn't do much for me.

    So I thought I'd try it on the something familiar (my DB). Here'w what it looked at: http://www.SwedesDock.com/powerbasic/Original.jpg

    And here's the code to run. WinSpy supplied is between noted rems

    '
    Code:
    'PBWIN 9.00 - WinApi 05/2008 - XP Pro SP3
    #Compile Exe                                
    #Dim All 
    #Include "WIN32API.INC"
    #Include "COMDLG32.INC"
    #Include "InitCtrl.inc"
    'Had to add these Id Numbers
    %IDC_LABEL2620      = %WM_User + 100         
    %IDC_LISTBOX2601    = %WM_User + 100
    %IDC_LABEL2660      = %WM_User + 100
    %IDC_EDIT2602       = %WM_User + 100
    %IDC_EDIT2603       = %WM_User + 100
    %IDC_EDIT2604       = %WM_User + 100
    %IDC_EDIT2605       = %WM_User + 100
    %IDC_EDIT2606       = %WM_User + 100       
    %IDC_BUTTON2707     = %WM_User + 100      
    %IDC_EDIT2607       = %WM_User + 100
    %IDC_EDIT2608       = %WM_User + 100
    %IDC_BUTTON2709     = %WM_User + 100
    %IDC_EDIT2609       = %WM_User + 100
    %IDC_EDIT2610       = %WM_User + 100
    %IDC_EDIT2611       = %WM_User + 100
    %IDC_EDIT2612       = %WM_User + 100
    %IDC_EDIT2613       = %WM_User + 100
    %IDC_EDIT2614       = %WM_User + 100       
    %IDC_BUTTON900      = %WM_User + 100
    %IDC_BUTTON806      = %WM_User + 100
    %IDC_BUTTON806      = %WM_User + 100
    %IDC_BUTTON804      = %WM_User + 100
    %IDC_BUTTON803      = %WM_User + 100
    %IDC_BUTTON809      = %WM_User + 100
    %IDC_BUTTON810      = %WM_User + 100
    %IDC_BUTTON802      = %WM_User + 100
    %IDC_BUTTON807      = %WM_User + 100      
    %IDC_BUTTON801      = %WM_User + 100      
    %IDC_BUTTON2708     = %WM_User + 100               
    %IDC_BUTTON2618     = %WM_User + 100               
    %IDC_BUTTON2619     = %WM_User + 100       
    Function PBMain         
      ErrClear   
      Local Hdlg As Dword
    '<<< WinSpy code from here down
    '<<< WinSpy code from here down
    '<<< WinSpy code from here down
      Dialog New 0, "              Testing1   " + _
                  "                         GHL_Database  Version (2.01)  by Carolelle Publishing® (®2008)  ", , , 678, 431, _
                  %WS_VISIBLE Or %WS_CLIPSIBLINGS Or %WS_CAPTION Or %WS_SYSMENU Or _
                  %WS_THICKFRAME Or %WS_MINIMIZEBOX Or %WS_MAXIMIZEBOX Or _
                  %DS_ABSALIGN Or %DS_3DLOOK Or %DS_NOFAILCREATE Or %DS_SETFONT, _
                  %WS_EX_CONTROLPARENT Or %WS_EX_WINDOWEDGE To hDlg
      'Note: in PB/WIN 7.0 and later, you can also use DIALOG SET ICON hDlg, newicon$
      'For icon from resource, use something like, LoadIcon(hInst, "APP_ICON")
      Dialog Send hDlg, %WM_SETICON, %ICON_SMALL, LoadIcon(%Null, ByVal %IDI_APPLICATION)
      Dialog Send hDlg, %WM_SETICON, %ICON_BIG, LoadIcon(%Null, ByVal %IDI_APPLICATION)
      Control Add Label, hDlg, %IDC_LABEL2620, "Searching", 1, 1, 203, 12, _
                  %WS_CHILD Or %WS_VISIBLE
      Control Add ListBox, hDlg, %IDC_LISTBOX2601, , 1, 15, 203, 394, _
                  %WS_CHILD Or %WS_VISIBLE Or %WS_BORDER Or %LBS_NOTIFY Or _
                  %LBS_NOINTEGRALHEIGHT Or %LBS_EXTENDEDSEL
      Control Add Label, hDlg, %IDC_LABEL2660, " ", 1, 406, 203, 12, _
                  %WS_CHILD Or %WS_VISIBLE
      Control Add Label, hDlg,  -1, "Index ", 213, 6, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2602, "Affordable Websites", 265, 6, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Label, hDlg,  -1, "WholeName ", 213, 20, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2603, "Smith, Jane", 265, 20, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Label, hDlg,  -1, "Address1 ", 213, 34, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2604, "37 Ardmore Rd    58 Wildwood " + _
                  "Ave", 265, 34, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Label, hDlg,  -1, "Address2 ", 213, 49, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2605, "", 265, 49, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Label, hDlg,  -1, "CityName ", 213, 63, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2606, "Lavallette, NJ 08735", 265, 63, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Button, hDlg, %IDC_BUTTON2707, "&Phone ", 213, 77, 50, 11
      Control Add TextBox, hDlg, %IDC_EDIT2607, "201-652-4569:Andy", 265, 77, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Button, hDlg, %IDC_BUTTON2708, "P&hone ", 213, 91, 50, 11
      Control Add TextBox, hDlg, %IDC_EDIT2608, "973-783-7124:Susan", 265, 91, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Button, hDlg, %IDC_BUTTON2709, "Ph&one ", 213, 105, 50, 11
      Control Add TextBox, hDlg, %IDC_EDIT2609, "", 265, 105, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Button, hDlg, %IDC_BUTTON2618, "&Email ", 213, 119, 50, 11
      Control Add TextBox, hDlg, %IDC_EDIT2610, "[email protected]:Andy", 265, 119, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Button, hDlg, %IDC_BUTTON2619, "UR&L ", 213, 134, 50, 11
      Control Add TextBox, hDlg, %IDC_EDIT2611, "[email protected]", 265, 134, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Label, hDlg,  -1, "Extra ", 213, 148, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2612, "", 265, 148, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add Label, hDlg,  -1, "Extra ", 213, 162, 50, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %SS_RIGHT
      Control Add TextBox, hDlg, %IDC_EDIT2613, "", 265, 162, 358, 11, _
                  %WS_CHILD Or %WS_VISIBLE Or %ES_NOHIDESEL
      Control Add TextBox, hDlg, %IDC_EDIT2614, "This Field can hold 10,000 " + _
                  "characters." + $CrLf + "More than 5 single spaced typed pages." + $CrLf + "" + $CrLf + "In Courier Font, " + _
                  "numbers can be arranged" + $CrLf + " in columns " + _
                  "that line up like this:" + $CrLf + "    " + _
                  "   12   34   567   89   10" + $CrLf + "     " + _
                  "   2    4     7    8   15" + $CrLf + "      " + _
                  " 12   34   567   89   10" + $CrLf + "       " + _
                  " -   34    -    89   99", 213, 176, 461, 233, _
                  %WS_CHILD Or %WS_VISIBLE Or %WS_VSCROLL Or %ES_MULTILINE Or _
                  %ES_WANTRETURN Or %ES_NOHIDESEL Or %ES_AUTOVSCROLL
      Control Add Button, hDlg, %IDC_BUTTON801, "&Add", 625, 6, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON807, "Sa&ve", 625, 25, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON802, "&Delete", 625, 44, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON810, "Ne&w", 625, 63, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON809, "&Recover", 625, 82, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON803, "&Search", 625, 102, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON804, "&Next Search", 625, 121, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON806, "&Clipper", 625, 140, 50, 15
      Control Add Button, hDlg, %IDC_BUTTON900, "&Quit", 625, 159, 50, 15
     
    '<<< WinSpy code to here
    '<<< WinSpy code to here
       Dialog Show Modal hDlg   '<<<<
      ? "testing"
    End Function 'Applikation beenden
    '
    And here's what WinSpy code produced: http://www.SwedesDock.com/powerbasic/Winspy.jpg

    Pretty cool I thought.
    Last edited by Gösta H. Lovgren-2; 15 Feb 2009, 11:19 AM.
    It's a pretty day. I hope you enjoy it.

    Gösta

    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

  • #2
    Indeed - a very handy tool that deserves to be spruiked more often
    PB WinSpy++++
    The ultimate RAD (Rapid Application Development) tool for PB/DLL, PB/WIN.
    Visual designer fans - eat your hearts out, because here is a program that can make PB coding fly in circles around all other languages when it comes to rapid dialog and control design. And best of all - it's freeware..

    PURPOSE
    To provide PowerBASIC programmers with a quick way to design dialogs and controls via automatic DDT or SDK-style code generation for existing dialogs and controls, and/or via a set of provided templates.

    WHAT DO YOU WANT TO STEAL TODAY..
    Simply click in top-left yellow area, hold down mouse button, drag/move the mouse to the control or dialog you wish to copy and release the button over it. The program will look at the underlying window, grab styles and positions, etc, and generate the code needed to create a duplicate.

    WHAT DO YOU WANT TO LEARN TODAY..
    PBWinSpy can also be used as a good learning tool in that it can reveal many "secrets" behind things in dialogs or controls, and give hints on how others have done this or that. MS dialogs are always interesting to investigate, for example.

    TEMPLATES
    Template code for a main dialog, a pop-up child dialog, a DLL file, a Resource file with version info and all standard DDT controls are provided. Just select from the ComboBox in upper right corner and code to create selected object will be generated in the viewer. Then just copy and paste this code into PBEdit, or any other code editor. Code generation can be set to DDT or SDK -style in the Options dialog.

    Main dialog template is complete with WndProc procedure and a couple of buttons. Pop-up dialog template is also complete with a PopupDlgProc and a button, so put together, these two can be used for direct compile of a complete program with pop-up dialog! Just add "ShowPopupDialog hWnd" to %IDOK in WndProc and off you go..

    http://www.powerbasic.com/files/pub/pbwin/tools/WinSpy.zip
    Last edited by Dave Biggs; 16 Feb 2009, 05:12 AM.
    Rgds, Dave

    Comment


    • #3
      May I also recommend 'Inclean' to tidy up the inclusion files.

      I for one owe a great debt to Borje for his invaluable tools - just wish I could contribute something that would live on.

      Iain Johnstone
      “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

      Comment


      • #4
        Originally posted by Iain Johnstone View Post
        ... just wish I could contribute something that would live on.
        I like to think that some of my bugs are leaders in their field...

        Comment


        • #5
          Originally posted by Dave Biggs View Post
          Visual designer fans - eat your hearts out, because here is a program that can make PB coding fly in circles around all other languages when it comes to rapid dialog and control design.
          It's a great program but, to be honest, I can't think of many times in my programming career where I had a need to copy/clone an existing application - control by control. A visual designer is far easier to use than PBWinSpy for applications that require more than just a quick copy. A visual designer with pre-built templates can easily mock up a program in no time at all.

          Having said that, I miss having Borje around here. He is greatly missed.

          I have learned a lot from Borje's programs.
          Paul Squires
          FireFly Visual Designer (for PowerBASIC Windows 10+)
          Version 3 now available.
          http://www.planetsquires.com

          Comment


          • #6
            I'm sure that little dig at 'Visual designer fans' (from the program's 'info') was written with tongue planted pretty firmly in cheek

            All hail the mighty Borje!
            Rgds, Dave

            Comment


            • #7
              I just posted the same thing in Source Code Forum by mistake, but the compiler ships with a "WinMsg" program in the samples/util folder.

              For any WM_message it gives you the name of the message.

              Bonus: you'll learn how to use a DLL while you are at it, and you can (if ambitious) learn how to create and use a STRINGTABLE resource.
              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                I just posted the same thing in Source Code Forum by mistake
                Here too
                Rgds, Dave

                Comment

                Working...
                X