当前位置:编程学习 > VB >>

vb窗口如何在Microstation中成为子窗口--高手请进

vb窗口如何在Microstation中成为子窗口--高手请进 --------------------编程问答-------------------- call SetParent(子窗口句柄,父窗口句柄)  --------------------编程问答-------------------- 楼上的,先谢谢你,我再问一下,父窗口句柄,就是MicroStation的是吧,但是我在VB里不会求啊,在VBA里可以得到,VB里怎么得?麻烦你 --------------------编程问答-------------------- 二楼能写的具体点吗?这个我刚学,不太会 --------------------编程问答-------------------- Microstation是什么软件??
--------------------编程问答-------------------- 老大你不知道MicroStation,但是你的方法真的好使啊,只是没有取到MS的句柄,MS是一个类似CAD的画图软件 --------------------编程问答-------------------- 画图软件的标题是:MicroStation,那就根据这个标题再取得软件窗口句柄。 --------------------编程问答-------------------- 参考下面:http://topic.csdn.net/u/20090316/18/29aa77dd-c789-4f89-a7db-b4e274e0fcab.html --------------------编程问答-------------------- FindWindow(vbNullString, "MicroStation")
这样取是吧?不过没有取到,我刚才弄了一下把那个窗口设到QQ聊天窗口上了晕了 --------------------编程问答-------------------- 我试试先谢谢拉,成了给你分
--------------------编程问答-------------------- 看不懂 --------------------编程问答-------------------- 窗体模块:
Option Explicit

Private Sub Command1_Click()
        EnumWindows AddressOf EnumWindowsProc, ByVal 0&
End Sub


标准模块:
Option Explicit

Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
       Dim windowCaption As String, LengthCaption As Long
       LengthCaption = GetWindowTextLength(hwnd)
       windowCaption = Space(LengthCaption)
       Call GetWindowText(hwnd, windowCaption, LengthCaption + 1)
       '找窗口标题为Microstation的窗口句柄
       If InStr(1, windowCaption, "Microstation") > 0 Then Debug.Print "找到的窗口句柄为:" & hwnd
       EnumWindowsProc = True
End Function
--------------------编程问答-------------------- 真的麻烦你了,我去试试 --------------------编程问答-------------------- 我先给你分吧,挺辛苦的 --------------------编程问答-------------------- Private Sub Command1_Click()
        EnumWindows AddressOf EnumWindowsProc, ByVal 0&
End Sub

可以吗 --------------------编程问答-------------------- 飘过。
补充:VB ,  API
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,