Foxite.COM Community Weblog

Foxite.COM Community Weblog - free weblog service for the Visual FoxPro Community.
Welcome to Foxite.COM Community Weblog Sign in | Join | Help
in
Home Blogs Forum Photos Forum Archives

VFP IMAGING



GETPICT() with thumbnails

This one goes to Koen Piller

I've seen in many forums people asking about the possibility to open the GETPICT() dialog showing thumbnails instead of picture file names.

Just for fun, I did some tests simulating some keystrokes, and it works ! Save the 3 lines below in a PRG and run under WinXP:

   oShell = CREATEOBJECT("Wscript.Shell")
   oShell.SendKeys("{TAB}{TAB}{TAB}{TAB}{TAB}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}")
   GETPICT()

As you can see, I used the SendKeys function from WSH. At this link you can find all key codes, if you want to use this technique for any other purpose: http://msdn2.microsoft.com/en-us/library/system.windows.forms.sendkeys(vs.71).aspx

This was tested only in my working machine, under WINXP Professional. It probably does not work this way in other OS's so be careful, and if you want to use this code, check this first.

I'm almost sure that there must exist another way, probably safer to do that. Do you know ?

Published Wednesday, June 27, 2007 5:49 AM by cesarchalom
Filed Under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Christophe Chenavier said:

Hi Cesar,

Here is not another way, just a smaller path :
oShell.SendKeys("+{TAB}+{F10}{DOWN}{ENTER}{ENTER}")

Thanks Christophe !

June 27, 2007 8:49 AM
 

Koen said:

Brilliant. In it is the simplicity.
Thanks.
Koen
June 27, 2007 4:23 PM
 

Cesar Chalom said:

Even Microsoft seems to recommend this kind of workaround to change some dialogs behavior, see this KB:

The Insert Picture dialog box in Office XP programs always opens in Thumbnails view
http://support.microsoft.com/kb/301459
July 7, 2007 2:24 PM
 

Ana María Bisbé said:

Versión en Español de este artículo en / Spanish version at http://www.portalfox.com/article.php?sid=2471
GETPICT() con miniaturas
July 24, 2007 7:40 PM

What do you think?

(required) 
(optional)
(required)