|
-
June 22nd, 2001, 07:52 AM
#1
EM_GetModify Problem!
I invoked SendMessage with EM_GetModify to check if the content of the current doc. has been changed or not. But when I run the app for the first time and press File|Newthe function return TRUE, telling that the doc has been modified. What's happening? I haven't typed anything on it.
-
June 22nd, 2001, 08:34 PM
#2
Re: EM_GetModify Problem!
You just need to reset the Textbox's Modified status, i.e.private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, lParam as Any) as Long
private Const EM_GETMODIFY = &HB8
private Const EM_SETMODIFY = &HB9
private Sub Form_Resize()
Text1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
If SendMessage(Text1.hwnd, EM_GETMODIFY, 0, byval 0) then
Cancel = (MsgBox("Cancel all changes and exit?", vbYesNoCancel + vbDefaultButton3, "Cancel Edits") <> vbYes)
End If
End Sub
private Sub mnuNew_Click()
Text1 = ""
SendMessage Text1.hwnd, EM_SETMODIFY, 0, byval 0
End Sub
Aaron Young
Senior Programmer Analyst
[email protected]
Certified AllExperts Expert: http://www.allexperts.com/displayExp...p?Expert=11884
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|