It is currently Thu Aug 06, 2020 2:29 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: OpenFileRequester() at any Size & Position [Windows]
PostPosted: Tue May 12, 2020 2:53 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3652
Hi
Tested with PB 5.72 x86 - Windows 10 2004 x64
Code:
Global Hook,hWnd,oldProc,x,y,w,h

Procedure ReqProc(hWnd, uMsg, wParam, lParam)
  Select uMsg     
    Case #WM_SIZE,#WM_MOVE,#WM_PAINT
      MoveWindow_(hWnd,x,y,w,h,1)     
     
    Case #WM_NCLBUTTONDOWN
      SetWindowLongPtr_(hWnd, #GWL_WNDPROC,0)   
     
  EndSelect
  ProcedureReturn CallWindowProc_(oldProc, hWnd, uMsg, wParam, lParam)
EndProcedure

Procedure HookCB ( uMsg , wParam , lParam)   
  Select uMsg
    Case #HCBT_ACTIVATE
      hWnd = wParam
      oldProc = SetWindowLongPtr_(hWnd, #GWL_WNDPROC, @ReqProc())
      UnhookWindowsHookEx_ (Hook)   
       
   EndSelect
   
   ProcedureReturn Result
EndProcedure

x = 100
y = 100
w = 800
h = 600
Hook = SetWindowsHookEx_ ( #WH_CBT, @ HookCB () , 0, GetCurrentThreadId_ ())

Pattern$ = "Text (*.txt)|*.txt;*.bat|PureBasic (*.pb)|*.pb|All files (*.*)|*.*"
Pattern = 0
File$ = OpenFileRequester("Please choose file to load", StandardFile$, Pattern$, Pattern)


_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenFileRequester() at any Size & Position [Windows]
PostPosted: Tue Jun 02, 2020 5:25 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4699
Location: Lyon - France
Again a great powerfull code of the great powerfull RASHAD :D
Thanks for sharing 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye