Ver 4.51 - Problem with WindowFromPoint_()

Windows specific forum
Randy Walker
Addict
Addict
Posts: 1134
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Ver 4.51 - Problem with WindowFromPoint_()

Post by Randy Walker »

I can debug valid CursorPosition\x and y values so I know the POINT structure populated Ok, so where am I going wrong with WindowFromPoint? It always gives me a zero value...

Code: Select all

Global CursorPosition.POINT
If OpenWindow(0, 0, 0, 600, 400, "Want to find WindowFromPoint",#PB_Window_SystemMenu)
  ButtonGadget(1, 10, 10, 580, 380, "Really BIG Button")
  Repeat
    Event = WaitWindowEvent()
    Select Event
      Case #WM_RBUTTONDOWN
        Debug "something"
        Debug GetCursorPos_(@CursorPosition.POINT)  ; value 1 means successful
        Debug CursorPosition\x
        Debug CursorPosition\y
        a1.l = WindowFromPoint_(CursorPosition.POINT)
        Debug a1   ; value 0 means NOT successful
    EndSelect
  Until Event = #PB_Event_CloseWindow
EndIf
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: Ver 4.51 - Problem with WindowFromPoint_()

Post by RASHAD »

Hi

Code: Select all

a1.l = WindowFromPoint_(CursorPosition\y<< 32 + CursorPosition\x)
Egypt my love
Randy Walker
Addict
Addict
Posts: 1134
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Ver 4.51 - Problem with WindowFromPoint_()

Post by Randy Walker »

That seems to work. :| Thanks Rashad!! :)

I guess Microsoft failed to update that syntax change when I upgraded to PB 4.51 :D
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Post Reply