HMG Tutorials & Tips

Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
  1. Maybe this...

    GetFolder()
    Opens The 'Browse For Folder' System Dialog And Returns Selected Folder Path

    Syntax:

    GetFolder ( [<cTitle>] , [<cInitPath>], [<cInvalidDataMsg>], [<lNewFolderButton>] , [<lIncludeFiles>] , [<nCSIDL_FolderType>] , [<nBIF_Flags>] )--> cSelectedFolderName

    Statistics: Posted by andyglezl — Mon Mar 18, 2019 4:51 am


  2. Dear forum

    I would like help on converting the code below which currently prints a part of my screen (form_2) but
    saves the image file in the HMG tree directory. Would like to save it to the windows 10 picture
    file or some other place of my choice.


    The PrintForm_2() code below is from an old HMG forum entry. I think it would work for my PrintForm_2() Function n'est pas?
    Please advise with my sincere thanks to all who read this forum entry.


    "
    *------------------------------------------------------------*
    FUNCTION SaveDisplay()
    * Called From BUTTON PrintScreen
    *------------------------------------------------------------*
    LOCAL cImageFileName:=" Form_2 Display.jpg"
    LOCAL lPrint:=.f.,lSave:=.f.

    lSave :=msgYesNo("Do you want to Save "+cImageFileName)

    If lSave
    hBitmap:=BT_BitmapCaptureWindow("form_2",0,0,1040,920)
    BT_BitmapSaveFile(hBitmap, cImageFileName )
    BT_BitmapRelease( hBitmap )
    Endif
    lPrint:=msgYesNo("Do you want to Print the screen?")
    if lPrint
    PrintForm_2() // function PrintForm_2 not yet implemented but code below should work
    endif
    RETURN NIL


    /* PrintForm_2()
    select printer default preview
    start printdoc
    start printpage
    hDC := OpenPrinterGetPageDC()
    BT_DrawBitmap ( hDC, 100, 100, 500, 500, BT_STRETCH, hBitmap )
    end printpage
    end printdoc
    */
    "

    Statistics: Posted by bluebird — Mon Mar 18, 2019 4:07 am


  3. There is an example for getfile() available but I did not see one for GetFolder()
    Please look at :

    ...\SAMPLES\Basics\MAIN_DEMO
    GetFolderDemo.jpg
    This this is simplest way to call function.

    Full syntax is :

    CODE:

    GetFolder ( [<cTitle>] , [<cInitPath>], [<cInvalidDataMsg>], [<lNewFolderButton>] , [<lIncludeFiles>] , [<nCSIDL_FolderType>] , [<nBIF_Flags>] )--> cSelectedFolderName
    As you can see all parameters are self-explanatory and possible values and meanings listed in the HMG_DOC. Further explanation and sample not required ( IMO ).

    Happy HMG'ing

    Statistics: Posted by esgici — Sun Jan 27, 2019 8:33 pm


  4. You can call it in this way:

    CODE:

    cFolder:= GetFolder(cFromWhereToStart)if !empty(cFolder)  MsgInfo("You've selected folder: "+ cFolder)endif

    Statistics: Posted by mol — Sun Jan 27, 2019 8:15 pm


  5. Hello All


    Is there an example/demo on using the Getfolder() function available?

    There is an example for getfile() available but I did not see one for GetFolder()

    Thanks for reading this request

    Statistics: Posted by bluebird — Sun Jan 27, 2019 7:53 pm