Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application
Message
 
 
To
22/10/2002 16:31:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00714089
Message ID:
00715146
Views:
12
Hi Morys,

I asked your question in VFP Russian Club. Here is the answer, I got, which may help you:
Some years old solution for control standard Open/Save dialog from W9x/NT:
(Use FindWindow,ShowWindow, SendMessage & PostMessage from WinAPI)
This like second method by po2...
******************** 
* Fill Filename Dialog box method 
para lsItFileToPlay,lsopen 
This.PlayerWindow = FindWindow(This.FindWindProg,0) 
if This.PlayerWindow=0 
   this.playeropen && Start player if not started... 
endif 
if lsopen 
lstitle=iif(This.Playername='NAD','Open a MP3 Or Playlist...','Open file(s)') && NAD/WinAMP defination 
else 
lstitle='Save a WaveForm Audio File...' 
endif 
This.PlayerOpenWindow = 0 
This.PlayerOpenWindow2 = 0 

do while This.PlayerOpenWindow = 0 
This.PlayerOpenWindow = FindWindowEx(0,0,'#32770',lstitle) 
enddo 

do while This.PlayerOpenWindow2 = 0 
z=ShowWindow(This.PlayerOpenWindow,0) 
This.PlayerOpenWindow2 = FindWindowEx(This.PlayerOpenWindow,0,'Edit',0) 
enddo 
* sample : send filename to dialog window and "press Enter" 
do while This.PlayerOpenWindow > 0 
x = sendMessage(This.PlayerOpenWindow2,This.WM_SETTEXT, 0, @lsItFileToPlay) 
x = PostMessage(This.PlayerOpenWindow2,This.WM_KEYDOWN,This.WM_keydown_nVirtKey,This.WM_keydown_lKeyData) 
This.PlayerOpenWindow = FindWindowEx(0,0,'#32770',lstitle) 
enddo 
* end sample 
This.PlayerOpenWindow2 = 0 


********************************************************************************* 
* Some comments: 
* 
* This.WM_KEYDOWN=256 
* This.WM_keydown_lKeyData=152829953 
* This.WM_keydown_nVirtKey=13 
* This.WM_SETTEXT=12 
* 
* This.PlayerOpenWindow - Native Open/Save Dialog Window, called from players 
* This.PlayerOpenWindow2 - "Edit box" from This.PlayerOpenWindow 
********************************************************************************** 
It's real code from my old application (only one method from class for control WinAMP & NAD players). Because GetFile() don't have a private HWND, You can use like method with timer use and COMDLG32 call...

P.S. Sorry, I know, my english is so bad... :-)


>I have a form.
>I have a command button with GETFILE() command in the click event.
>
>Question:
>How do I close programatically the Open Dialog from the form?
>
>Thank you in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform