2007-06-27

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 ?

4 comments:

  1. Christophe ChenavierJune 27, 2007 at 5:49 AM

    Hi Cesar,

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

    ReplyDelete
  2. Brilliant. In it is the simplicity.

    Thanks.

    Koen

    ReplyDelete
  3. 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

    ReplyDelete
  4. Versión en Español de este artículo en / Spanish version at http://www.portalfox.com/article.php?sid=2471

    GETPICT() con miniaturas

    ReplyDelete