Announcement

Collapse
No announcement yet.

Edit: one investigation

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

  • Edit: one investigation

    Wrote a program (under Win2000) and found interesting thing.
    Lazy to reboot ... Does it work in other OSes ?
    I mean that there is no automatic selection in first textbox as result of Tab.

    Code:
       #Compile Exe
       #Register None
       #Dim All
       #Include "WIN32API.INC"
    
       CallBack Function EditProc
          Static ClassProc As Long
          If CbHndl = 0 Then ClassProc = CbLparam Else _
          If CbMsg = %WM_GETDLGCODE Then Function = %DLGC_WANTCHARS Or %DLGC_WANTARROWS Else _
          Function = CallWindowProc(ClassProc, CbHndl, CbMsg, CbWparam, CbLparam)
       End Function
    
       CallBack Function DlgProc
         Select Case CbMsg
            Case %WM_INITDIALOG
               Control Add TextBox, CbHndl, 101, "Subclassed", 10, 10, 100, 12
               Control Add TextBox, CbHndl, 102, "Ordinary", 10, 25, 100, 12
               CallWindowProc CodePtr(EditProc), 0, 0, 0, _
                  SetWindowLong(GetDlgItem(CbHndl, 101), %GWL_WNDPROC, CodePtr(EditProc))
            End Select
        End Function
    
        Function PbMain
           Local hDlg As Long
           Dialog New 0, "Test",,, 120, 60, %WS_OVERLAPPEDWINDOW  To hDlg
           Dialog Show Modal hDlg Call DlgProc
        End Function


    ------------------
    E-MAIL: [email protected]

  • #2
    Fun. Looks like it works in both Win95, first edition and Win98 SE
    too. I like it - thanks!


    ------------------

    Comment


    • #3
      Seman,

      Your short, simple examples teach so well. Please keep them coming
      Thanks B
      OH!!!! Works in 98
      ------------------


      [This message has been edited by Brad D Byrne (edited September 20, 2001).]

      Comment


      • #4
        Very cute. I love the scheme for avoiding a GLOBAL variable for the original windproc.

        I confirm it works under Win2K and NT4/SP6 too!

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Good news, thanks.

          I noticed another strange moment with textboxes (under Win2000).
          If to type a text, mouse cusors disappears and appears again.
          Somebody struggle with this behaviour ?
          (in VB similar doesn't happend)

          ------------------
          E-MAIL: [email protected]

          Comment


          • #6
            It must be a Windows dialog engine attribute - it's not a DDT attribute.

            For example, it also occurs with dialogs in MSWORD (such as FIND, etc).

            To be honest, I've never really noticed this behavior before, and I can't say it will cause me any concerns with my own apps.

            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment


            • #7
              I think that's a new Windows "feature"... seems to me, I've seen a way
              to toggle that on/off, but I can't recall the details.

              ------------------
              Tom Hanlin
              PowerBASIC Staff

              Comment


              • #8
                Is otherwise a wellknown "feature" in RichEdit. Could it be they
                use some sort of hybrid Richedit/edit class in win 2K?


                ------------------

                Comment


                • #9
                  The mouse hiding feature is not native to Windows 2000 but when you load the Microsoft Intellimouse drivers it's available from the mouse icon in your control panel. Programs like Word 2000 have this ability but it seems that they've programmed it into specific apps.

                  Adrian

                  ------------------

                  Comment


                  • #10
                    Very doubt that this effect has relation to mouse driver.
                    I have Logitech optical mouse, Win2000 sees it as PS/2 compatible and I didn't install special driver.

                    Something in class proc ... This happends as result of WM_CHAR. If to prevent WM_CHAR and to reset a text by SetwindowText, nothing happends.
                    Strange code ... What is it ? ShowCursor false ... SetTimer ... ShowCursor true ?


                    ------------------
                    E-MAIL: [email protected]

                    Comment


                    • #11
                      Semen, I had just done this on a PC I'm rebuilding , with the 'standard' mouse driver -no option, install intellimouse and there is the new option tab - Pointer Options on the mouse icon in control panel and there is a 'Hide pointer whilst typing' option box.

                      At least this is what happens on my W2k Pro box UK setting with a Microsoft PS/2 mouse installed.

                      Adrian


                      ------------------

                      Comment


                      • #12
                        I agree with what Seman is implying, with the "class proc ..."
                        Research may un-cover more of the Windows Messaging Structure and Order!!


                        ------------------

                        Comment


                        • #13
                          Research is not easy and is getting harder. Just come back from MSDN
                          after having spend an hour on trying to find info about a bunch of things.
                          Lots of pages listed on search, but many, many links are broken. MS
                          explain they have moved or discarded "some" pages to make room for
                          more uptodate info. Guess they want to hide the API completely and
                          force everyone to start using .NJET ..

                          But, another search engine gives many good results: http://www.google.com/


                          ------------------

                          Comment


                          • #14
                            Borje,

                            Cheat, buy a copy of the Whistler edition of the PlatformSDK and
                            you have the more or less current API range of functions. Saves
                            downloading an ISO and all you have to do is find out how to shovel
                            through the junk to find the real stuff.

                            I still prefer the old win32.hlp file for most stuff as its a lot
                            faster than the newer help format but for anything newer, the SDK
                            has it all.

                            Regards,

                            [email protected]

                            ------------------
                            hutch at movsd dot com
                            The MASM Forum

                            www.masm32.com

                            Comment


                            • #15
                              I Don't know how accurate this is, but I found an interesting
                              page (to me), starting of an out-line of the GUI messaging order.
                              http://www.winehq.com/wine/documentation/gui

                              PS. found it w/ goooooogle.com the fastest engine I know of.
                              Peace Borje , B

                              ------------------


                              [This message has been edited by Brad D Byrne (edited September 22, 2001).]

                              Comment


                              • #16
                                I see this behavior (Tab) also. I am thinking since you are in total control of that box with the subclass that windows expects you to do it...
                                Otherwise if not subclassed perpaps windows (PB) does it?

                                Also, as for the mouse cursor, I saw it in MS Access many times, probably excel as well, and one no-name tracker program for cases at work....




                                ------------------
                                Scott Turchin
                                MCSE, MCP+I
                                Computer Creations Software
                                http://www.tngbbs.com/ccs
                                Scott Turchin
                                MCSE, MCP+I
                                http://www.tngbbs.com
                                ----------------------
                                True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                                Comment


                                • #17
                                  Figure that PB does just what's necessary to do what you ask. It
                                  might interact with your requested start-up flags for a window
                                  if you go through DDT statements. The compiler is extremely unlikely
                                  to interact with, here, mouse cursor action afterwards. There's no
                                  point in having the compiler go through real work to get in your way.
                                  FWIW.

                                  ------------------
                                  Tom Hanlin
                                  PowerBASIC Staff

                                  Comment

                                  Working...
                                  X