Click to See Complete Forum and Search --> : open, save as, and undo - help!!
maaritkn
Mar 28th, 2001, 07:34 PM
Hi,
Does someone know how I can make open, SAVE AS and UNDO options in my paint program? (Code or examples). I want to specify the SAVE AS so that it saves the picture is saved in *.bmp format.
I know how to make the menu but the functionality is missing...
-Maarit :)
Rh0ads
Mar 28th, 2001, 08:24 PM
For the SaveAs you could probably go:
CommonDialog1.FileName="*.bmp"
CommonDialog1.ShowSave
Call SavePicture(Picture1.Picture,CommonDialog1.Filename)
For Open:
CommonDialog1.Filename="*.bmp"
CommonDialog.ShowOpen
Picture1.Picture=LoadPicture(CommonDialog.Filename)
For Undo (i'm not usre if this will work, it works with textboxes)
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const Em_Undo = &HC7
Call SendMessage(Picture1.hwnd,EM_Undo,0&,0&)
Sastraxi
Mar 28th, 2001, 09:04 PM
Nope, the last wont work, because EM messages are strictly for Edits and Textboxes (not RTBs though)
For undo use this
WM_UNDO will work
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Public Const WM_UNDO = &H304
Private Sub cmdUndo_Click()
SendMessage page.hWnd, WM_UNDO, 0, 0
End Sub
'Code improved by vBulletin Tool (http://orion.spaceports.com/~mccloud/vbtool.zip) (Save as...)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.