restricted directions for windowmoving ?

Windows specific forum
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

restricted directions for windowmoving ?

Post by Hroudtwolf »

Hello everybody,

I'm using this API to move my windows with an lbuttondown event:

Code: Select all

ReleaseCapture_()
SendMessage_(WindowID(), #WM_SYSCOMMAND, #SC_MOVE + #HTCAPTION, 0)
With it , my window moves the mouse afterwards in all directions.
But I want ,that my windows moves only in one direction (Up/Down).

Is anybody knowing a way to do it ?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Try this one...

Code: Select all

Procedure myWindowCallback(hwnd, msg, wparam, lparam)
  result = #PB_ProcessPureBasicEvents
  Select msg
    Case #WM_WINDOWPOSCHANGING 
      If hwnd = WindowID(0)
        *wPos.WINDOWPOS = lparam 
        ;--> We'll keep the left side of the window locked to 100
        *wPos\x = 100
      EndIf
  EndSelect
  ProcedureReturn result
EndProcedure
If OpenWindow(0, 100, 200, 200, 200, #PB_Window_SystemMenu, "Lock left side of Window") And CreateGadgetList(WindowID(0))
  SetWindowCallback(@myWindowCallback())
  Repeat
    event = WaitWindowEvent()
  Until event = #PB_Event_CloseWindow
EndIf
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

YES... :D .......YES.YES.YES... ->IAMDANCINGAROUNDMYPC<-

Thank you....
Post Reply