How would you implement this function?

For everything that's not in any way related to PureBasic. General chat etc...
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

How would you implement this function?

Post 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.
User avatar
einander
Enthusiast
Enthusiast
Posts: 744
Joined: Thu Jun 26, 2003 2:09 am
Location: Spain (Galicia)

Re: How would you implement this function?

Post 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!
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: How would you implement this function?

Post 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:
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: How would you implement this function?

Post by Perkin »

Depending on how long ago....

You might be able to get it back from the trashcan. :shock:
%101010 = $2A = 42
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: How would you implement this function?

Post by MachineCode »

Perkin wrote:Depending on how long ago....
You might be able to get it back from the trashcan. :shock:
Ohhhhhhhh, black humor! :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Post Reply