How do I implement menu functions such as Cut, Copy, Find, Replace, Paste, Undo or Redo?
You can invoke any of the following commands: Delete, Copy, Cut, Find, FindNext, FindPrev, Paste, Select All, Undo and Redo. Each command has an unique identifier like follows: #define ID_EDIT_REPLACE 0xE129 #define ID_EDIT_DELETE 0xE120 #define ID_EDIT_COPY 0xE122 #define ID_EDIT_CUT 0xE123 #define ID_EDIT_FIND 0xE124 #define ID_EDIT_PASTE 0xE125 #define ID_EDIT_SELECT_ALL 0xE12A #define ID_EDIT_UNDO 0xE12B #define ID_EDIT_REDO 0xE12C #define ID_EDIT_FINDNEXT 0xE12D #define ID_EDIT_FINDPREV 0xE12E The sample requires the definition for SendMessage API function. For instance, the following VB sample shows how to call Undo command when user clicks a button. 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 WM_COMMAND = &H111 Private Sub Command1_Click() SendMessage Edit1.hwnd, WM_COMMAND, &HE12B * 65536, 0 End Sub The wParam parameter of SendMessage API function needs
Related Questions
- Using the Cut and Paste functions in the Edit menu is not very convenient. Is there an easier way to cut, copy or move a portion of an image?
- The software does not appear to support Windows cut and paste. Can you provide and Edit menu with cut and paste functions?
- How do I implement menu functions such as Cut, Copy, Find, Replace, Paste, Undo or Redo?