Advertisement
5_2007-2008 Files/ File Controls/ Input/ Output #178998

Getting User Feedback and Using Edit Boxes

There are two different programs which come in this *.zip file. One of them is about User-Feedback. The other code is about using edit boxes. This also comes with a really great e-book on: “Writing your first dialog based application using Visual C++.” I strongly recommend you read this e-book if you are just starting to program in Visual C++ (Uses MFC).

AI

Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Codice sorgente
original-source
Upload
'declarations
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Integer, ByVal bRevert As Boolean) As Integer
 Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpNewItem As String) As Integer
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&
 Const WM_SYSCOMMAND As Integer = &H112
'-----------------------------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 Dim hSysMenu As Integer
 hSysMenu = GetSystemMenu(Me.Handle.ToInt32, False)
'deletes the close menu item which is in place 6
RemoveMenu(hSysMenu, 6, MF_REMOVE)
'appends new menu items
 AppendMenu(hSysMenu, 0, 1000, "New Item1")
 AppendMenu(hSysMenu, 0, 1001, "New Item2")
 End Sub
'--------------------------------
Protected Overrides Sub WndProc(ByRef m As Message)
 MyBase.WndProc(m)
 If m.Msg = WM_SYSCOMMAND Then
 Select Case m.WParam.ToInt32
 Case 1000
  MsgBox("Hello1")
 Case 1001
  MsgBox("Hello2")
 End Select
 End If
 End Sub
Commenti originali (3)
Recuperato da Wayback Machine