Announcement

Collapse
No announcement yet.

Re: Hover button and Win32api error.

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

  • Re: Hover button and Win32api error.

    if ypu try the <u>hover button example</u>, you'll get a winapi error.
    there are errors in win32api.inc:
    Code:
    declare function childwindowfrompoint lib "user32.dll" alias "childwindowfrompoint" (byval hwndparent as dword, byval x as long, byval y as long) as dword
    declare function childwindowfrompointex lib "user32.dll" alias "childwindowfrompointex" (byval hwnd as dword, byval x as long, byval y as long, byval uflags as dword) as dword
    should be:
    Code:
    declare function childwindowfrompoint lib "user32.dll" alias "childwindowfrompoint" (byval hwndparent as dword, [b]byval pt as pointapi[/b]) as dword
    declare function childwindowfrompointex lib "user32.dll" alias "childwindowfrompointex" (byval hwnd as dword, [b]byval pt as pointapi[/b], byval uflags as dword) as dword


    ------------------
    regards,
    peter
    Regards,
    Peter

    "Simplicity is a prerequisite for reliability"

  • #2
    >there are errors in win32api.inc:

    those are not "errors" they are "differences of opinion"

    see:
    problems compiling posted code?

    fwiw, with v8 you can make a separate declare ("childwindowfromptwithpointapiparams") which uses the pointapi parameters, since the compiler now permits multiple procedures to share aliases.

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Those are not "errors" they are "differences of opinion"
      They are errors. Declares should comply to the "Windows Bible" (the Win32 helpfile... )
      But of course you can add a separate declare with x and y as Longs...

      Added: Updated example with sound play on button hover...

      ------------------
      Regards,
      Peter

      [This message has been edited by Peter Lameijn (edited March 17, 2005).]
      Regards,
      Peter

      "Simplicity is a prerequisite for reliability"

      Comment


      • #4
        Not sure what you are trying to do, but in FireFly I use the code
        below to invert an image control and produce a "hover" effect that
        only occurs onMouseOver so to speak:

        Code:
        Function REPORTER_UPARROW_CUSTOM (ControlIndex As Long, hWndForm As Dword, hWndControl As Dword, wMsg As Long, wParam As Dword, lParam As Long) As Long 
        Local  hDC        As Dword
        Local  btnRect    As Rect
        Local  trackMouse As TrackMouseEventAPI
        Static MouseIn    As Dword
        
        Select Case wMsg
            Case %WM_MOUSEMOVE
                If MouseIn= 0 Then
                    MouseIn= 1
                    trackMouse.cbSize= SizeOf(trackMouse)
                    trackMouse.dwFlags= %TME_LEAVE
                    trackMouse.hwndTrack= hWndControl
                    TrackMouseEvent(trackMouse)
                    hDC= GetDC(hWndControl)
                    GetClientRect(hWndControl, btnRect)
                    InvertRect(hDC, btnRect)
                    ReleaseDC(hWndControl, hDC)
                End If
            Case %WM_MOUSELEAVE
                hDC= GetDC(hWndControl)
                GetClientRect(hWndControl, btnRect)
                InvertRect(hDC, btnRect)
                ReleaseDC(hWndControl, hDC)
                MouseIn= 0
            End Select
        End Function
        ------------------
        If you aim at nothing...you will hit it.
        sigpic
        Mobile Solutions
        Sys Analyst and Development

        Comment


        • #5
          WM_MOUSELEAVE:
          Windows NT/2000: Requires Windows NT 4.0 or later.
          Windows 95/98: Requires Windows 98 or later.
          Header: Declared in Winuser.h; include Windows.h.

          But i like the code, inverting that is..


          ------------------
          http://www.hellobasic.com
          PwrDev - Visual Designer for pb/dll, pb/win, pb/cc
          PwrStat - Static library linker for pb/dll or pb/win.
          hellobasic

          Comment


          • #6
            Oh well, if they are still using a 10 year old OS then they don't need
            a hover button...Does M$ even host updates anymore for 95?

            ------------------
            If you aim at nothing...you will hit it.
            sigpic
            Mobile Solutions
            Sys Analyst and Development

            Comment

            Working...
            X