Page 1 of 1

How would you implement this function?

Posted: Sat Dec 24, 2011 11:41 pm
by michaeled314
I would like to know how to implement this function, but not just for windows. :?: :idea:

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

My dog misses his grandfather very much since he got run over by a truck, and I feel that I will need to bring him back somehow.

Re: How would you implement this function?

Posted: Sun Dec 25, 2011 2:01 pm
by einander
but not just for windows
I think this function only works for windows.
I use it this way:

Code: Select all

EnableExplicit
Define Ev
;
Macro MMk
  Abs(GetAsyncKeyState_(#VK_LBUTTON) +GetAsyncKeyState_(#VK_RBUTTON)*2+GetAsyncKeyState_(#VK_MBUTTON)*3)/$8000   
EndMacro
;
Procedure DragW(Win) ; drag borderless window
  Protected Ancestor=GetAncestor_(WindowID(Win),#GA_ROOT)
  If ChildWindowFromPoint_(Ancestor,WindowMouseX(Win)|WindowMouseY(Win)<<32)
    SendMessage_(Ancestor, #WM_NCLBUTTONDOWN,#GA_ROOT, 0)
  EndIf
EndProcedure 
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
OpenWindow(0, 100, 100,700,500 ,"",  #PB_Window_BorderLess)
TextGadget(-1,10,10,200,50,"Drag me"+Chr(10)+"<Escape> To Quit")
Repeat
  If GetAsyncKeyState_(27)&$8000 :  End : EndIf 
  EV=WaitWindowEvent()
  If MMk
    Dragw(0)
  EndIf  
Until EV=#PB_Event_CloseWindow
End 
Cheers!

Re: How would you implement this function?

Posted: Sun Dec 25, 2011 2:11 pm
by wilbert
I suppose that doesn't bring back the run over dog he was talking about :shock: :o :D

@michaeled314, since your problem was caused by hardware, I don't think you will be able to solve it by using software :wink:

Re: How would you implement this function?

Posted: Sun Dec 25, 2011 4:28 pm
by Perkin
Depending on how long ago....

You might be able to get it back from the trashcan. :shock:

Re: How would you implement this function?

Posted: Sun Dec 25, 2011 5:09 pm
by MachineCode
Perkin wrote:Depending on how long ago....
You might be able to get it back from the trashcan. :shock:
Ohhhhhhhh, black humor! :)