How to "save as" instead of "save"

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
bluebird
Posts: 161
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF
Has thanked: 47 times
Been thanked: 7 times

How to "save as" instead of "save"

Post by bluebird » Mon Mar 18, 2019 4:07 am

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
*/
"

User avatar
andyglezl
Posts: 1113
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 32 times
Been thanked: 65 times
Contact:

Post by andyglezl » Mon Mar 18, 2019 4:51 am

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
Andrés González López
Desde Guadalajara, Jalisco. México.

Post Reply