Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Howard Hendler
  Where is Howard Hendler?
 New City
 New York - United States
 Howard Hendler
 To: dencio cabacis
  Where is dencio cabacis?
 mandaluyong
 Philippines
 dencio cabacis
 Tags
Subject: RE: Autocomplete file/directory chooser?
Thread ID: 112271 Message ID: 112961 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Tuesday, November 14, 2006 1:53:36 PM         
   


Dencio,

Everything is working perfectly, but I have one more issue, albeit quite minor. Do you know of a way to set the 'SelectedBackColor'? Currently it defaults to black but I would prefer to control it.

This VFP property is not available to me for the OLEcontrol, nor is there anything similar available as far as I can see.

Thanks a lot,
Howard

> > Dencio,
> >
> > I love this, its just what I was looking for. However, since this is
> > based on a richtext control, if I want to extract the actual control
> > value, I need to do some string parsing to get the value from
> > among all the rtf coding. I can do this, but its not pretty. Do you
> > know of a different way or a different OLEcontrol to use besides RichText?
> >
> > Thanks,
> > Howard
> >
> > > > Hello,
> > > >
> > > > I would like to provide a combobox control that makes typing in a directory path or file name easier. Prior-visited paths would be nice, but I care more about helping the user along as they type a path name by hand, displaying matching directory or file names in the drop-down for easy selection. The IE File/Open dialog is what I'm after, or, even better, the Windows Explorer address bar, which, when dropped-down via mouse click, shows "Desktop", "My Document", "My Computer", etc.
> > > >
> > > > Any advice much appreciated.
> > > >
> > > > Thanks,
> > > > Howard

> > >
> > >
> > >
> > > Hello! Try this sample code. It uses SHAutoComplete API, I have tried this API before in VB, but looking for a VFP equivalent and found this. Sorry, I don't remember the site and the author of this code. I hope this gives you another alternative.
> > >
> > > #DEFINE SHACF_AUTOAPPEND_FORCE_OFF  0x80000000
> > > #DEFINE SHACF_AUTOAPPEND_FORCE_ON  0x40000000
> > > #DEFINE SHACF_AUTOSUGGEST_FORCE_OFF  0x20000000
> > > #DEFINE SHACF_AUTOSUGGEST_FORCE_ON  0x10000000
> > > #DEFINE SHACF_DEFAULT  0x0
> > > #DEFINE SHACF_FILESYSTEM  0x1
> > > #DEFINE SHACF_URLHISTORY  0x2
> > > #DEFINE SHACF_URLMRU  0x4
> > > #DEFINE SHACF_URLALL  SHACF_URLHISTORY +SHACF_URLMRU
> > > DECLARE SHAutoComplete IN "shlwapi.dll" LONG hwndEdit, LONG dwFlags
> > > 
> > > PUBLIC oFrm
> > > oFrm=NEWOBJECT("autocompletar_api")
> > > oFrm.SHOW
> > > RETURN
> > > 
> > > DEFINE CLASS autocompletar_api AS FORM
> > >   HEIGHT = 105
> > >   WIDTH = 470
> > >   SHOWWINDOW = 2
> > >   SHOWINTASKBAR = .F.
> > >   DOCREATE = .T.
> > >   AUTOCENTER = .T.
> > >   CAPTION = "AutoCompletar desde VFP"
> > >   NAME = "AutoCompletar_Api"
> > >   ADD OBJECT text1 AS OLECONTROL WITH ;
> > >     BASECLASS="Olecontrol",;
> > >     CLASS = "Olecontrol",;
> > >     OLECLASS = "RICHTEXT.Richtextctrl.1",;
> > >     TOP = 12, ;
> > >     LEFT = 24, ;
> > >     HEIGHT = 24, ;
> > >     WIDTH = 435, ;
> > >     TABINDEX = 1, ;
> > >     NAME = "text1",;
> > >     TEXT = ' '
> > >   ADD OBJECT Paginas AS COMMANDBUTTON WITH ;
> > >     TOP = 48, ;
> > >     LEFT = 313, ;
> > >     HEIGHT = 27, ;
> > >     WIDTH = 144, ;
> > >     CAPTION = "Paginas Web", ;
> > >     TABINDEX = 3, ;
> > >     NAME = "Paginas"
> > >   ADD OBJECT Archivos AS COMMANDBUTTON WITH ;
> > >     TOP = 48, ;
> > >     LEFT = 24, ;
> > >     HEIGHT = 27, ;
> > >     WIDTH = 144, ;
> > >     CAPTION = "Sistema de Archivos", ;
> > >     TABINDEX = 2, ;
> > >     NAME = "Archivos"
> > > 
> > >   PROCEDURE Paginas.CLICK
> > >     SHAutoComplete(THISFORM.text1.HWND , SHACF_AUTOSUGGEST_FORCE_ON +SHACF_URLALL)
> > >   ENDPROC
> > > 
> > >   PROCEDURE Archivos.CLICK
> > >     SHAutoComplete(THISFORM.text1.HWND , SHACF_AUTOSUGGEST_FORCE_ON +SHACF_FILESYSTEM)
> > >   ENDPROC
> > > ENDDEFINE
> > > 

>
>
>
>
> Sorry for the very late reply!
>
> To get the actual value from the RTF control excluding the RTF tags, use the "Thisform.RTF.Text". SHAutoComplete API needs a hWnd, in VB I use the native textbox Control and it works. In VFP its textbox dont have any hWnd, if you could add a hWnd to the textbox I think you could achieve the same thing. I tried a different control such as "Forms.TextBox.1", but it not working or maybe I did something wrong.


ENTIRE THREAD

Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/7/2006 12:26:57 AM
RE: Autocomplete file/directory chooser? Posted by Mike Gagnon @ 11/7/2006 1:00:00 AM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/7/2006 1:10:47 AM
RE: Autocomplete file/directory chooser? Posted by Ken Murphy @ 11/7/2006 1:16:49 AM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/7/2006 1:39:27 AM
RE: Autocomplete file/directory chooser? Posted by Ken Murphy @ 11/7/2006 1:58:51 AM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/7/2006 3:20:14 AM
RE: Autocomplete file/directory chooser? Posted by Mike Gagnon @ 11/7/2006 4:08:36 AM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/7/2006 8:45:48 PM
RE: Autocomplete file/directory chooser? Posted by dencio @ 11/7/2006 8:58:59 AM
RE: Autocomplete file/directory chooser? Posted by Mike Gagnon @ 11/7/2006 11:28:14 AM
RE: Autocomplete file/directory chooser? Posted by tushar @ 11/7/2006 3:57:05 PM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/7/2006 10:35:54 PM
RE: Autocomplete file/directory chooser? Posted by Ken Murphy @ 11/8/2006 2:16:48 AM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/8/2006 5:27:58 AM
RE: Autocomplete file/directory chooser? Posted by tushar @ 11/8/2006 4:36:26 PM
RE: Autocomplete file/directory chooser? Posted by dencio @ 11/9/2006 9:40:55 AM
RE: Autocomplete file/directory chooser? Posted by Howard Hendler @ 11/14/2006 1:53:36 PM