Results 1 to 4 of 4

Thread: open, save as, and undo - help!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    4

    Unhappy

    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

  2. #2
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210

    CommonDialog

    For the SaveAs you could probably go:
    Code:
    CommonDialog1.FileName="*.bmp"
    CommonDialog1.ShowSave
    Call SavePicture(Picture1.Picture,CommonDialog1.Filename)
    For Open:
    Code:
    CommonDialog1.Filename="*.bmp"
    CommonDialog.ShowOpen
    Picture1.Picture=LoadPicture(CommonDialog.Filename)
    For Undo (i'm not usre if this will work, it works with textboxes)
    Code:
    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&)
    < o >

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Nope, the last wont work, because EM messages are strictly for Edits and Textboxes (not RTBs though)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Guest
    For undo use this
    WM_UNDO will work
    Code:
    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 (Save as...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width