获取下拉菜单的id和名称
<php
$_sql = "SELECT id,list_name FROM (XXXX);
$_result = $mysqli->query($_sql);
$_html = array();
while (!!$_objects = $_result->fetch_object()) {
$_html[] = $_objects;
}
>
下拉菜单
<php foreach ($_html as $key=>$value) { >
<option value="<php echo $value->id>"><php echo $value->list_name></option>
<php } >
之后form提交表单,PHP获取表单数据,验证,写入数据库就不用我说了吧
exe菜单要用菜单子项ID; 1获取一个应用的菜单子项ID,获取菜单子项ID需要借助工具SPY++,通过SPY++监听该应用对应的消息,人工点击菜单后看点击菜单时,观察监听得到的ID值。
需要api的支持,有人已经写出来了:
'获取任务栏窗体名称
Option Explicit
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Const GW_OWNER = 4
Function lpfunc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Dim pstr As String, Ret As Long
If IsWindowVisible(hwnd) = False Then GoTo continu
If GetWindow(hwnd, GW_OWNER) <> 0 Then GoTo continu
Ret = GetWindowTextLength(hwnd)
pstr = Space(Ret)
If GetWindowText(hwnd, pstr, Ret + 1) = 0 Then GoTo continu
If pstr <> "" And pstr <> "Program Manager" Then Form1List1AddItem pstr
continu:
lpfunc = True
End Function
Private Sub Command1_Click()
List1Clear
EnumWindows AddressOf lpfunc, ByVal 0&
End Sub
'根据窗体标题获取窗体句柄
Private Sub Command2_Click()
Dim i As Integer
Dim hwndNext As Long
Dim hwnd() As Long
i = 0
hwndNext = FindWindowEx(0, 0, vbNullString, "窗体标题")
Do While hwndNext <> 0
ReDim Preserve hwnd(i) As Long
hwnd(i) = hwndNext
i = i + 1
hwndNext = FindWindowEx(0, hwnd(i - 1), vbNullString, "窗体标题")
Loop
If i <> 0 Then
For i = 0 To UBound(hwnd)
List1AddItem hwnd(i)
Next
Else
MsgBox "未找到相应标题名的窗口"
End If
End Sub
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwprocessid As Long) As Long
Dim HwndVal&, ChildHwnd&
Private Sub Command1_Click()
HwndVal = FindWindow(vbNullString, "窗体标题")
'Print "窗口句柄是:" & CStr(HwndVal) & Space(3) & "进程号是:" & CStr(ProcIDFromWnd(HwndVal))
ChildHwnd = FindWindowEx(HwndVal, 0, "Static", vbNullString)
'Text1 = "子句柄是:" & ChildHwnd
List1AddItem CStr(HwndVal) & vbTab & CStr(ProcIDFromWnd(HwndVal)) & vbTab & ChildHwnd
End Sub
1打开CAD软件,在菜单栏中点击“工具”,然后选择“选项”。
2在d出的对话框中,点击“菜单栏”选项卡。
3在右侧的列表中,勾选要显示的项目名称和内容,然后点击“应用”按钮保存设置。
以上就是关于php 获取 下拉菜单 的值全部的内容,包括:php 获取 下拉菜单 的值、获取exe菜单调用、求助 请教VB高手,如何找出开始菜单任务栏中的所有窗体标题名等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)