1樓:匿名使用者
public wm_definemessage as long wm_definemessage = registerwindowmessage("msg123") '引號裡是自定義訊息名字 postmessage hwnd_broadcast, wm_definemessage, 0&, 0& '後面兩個引數你可以自己指定資料,對應下面函式的wparam和lparam function notifyiconwindowproc(byval hwnd as long, byval msg as long, byval wparam as long, byval lparam as long) as long
'程式**end function
2樓:匿名使用者
用標籤啊,然後內容指向一個自己的**內容,到時只要更新那個**內容就可以更新那個訊息內容
3樓:匿名使用者
不知道broadcastsystemmessage是否符合你的要求。這裡有個參考 http://blog.
前面那位腦子可能有點問題。。。。
vb 怎麼向窗體傳送自定義訊息
4樓:tf日出
兩個程序都是你自己編寫的嗎?如果是,那就比較簡單,直接用dde連線就可以了。
如果那個窗體不是你自己編的程序,那就只能用api函式了,比如用sendmessage,這需要學習windows程式設計,以便學習那個程序的控制元件可以接受哪些訊息,還要受到那個程序是否用採windows標準控制元件的限制。
5樓:匿名使用者
vb.net 比較麻煩,需要兩個視窗都宣告定義一下frm。
vb很簡單,語法是form2.text1.text依次類推。
6樓:
這個沒有辦法呀,做不成。delphi語言應該可以。
如何在vb中實現自定義訊息的響應函式
7樓:匿名使用者
大神給你來個例子 子類化視窗**
窗體模組 **開始
option explicit
private sub command1_click()
sendmessage frm1.hwnd, wm_user + 1, 123, 45
end sub
private sub form_load()
settimer me.hwnd, 0, 1000, 0
poldproc = getwindowlong(me.hwnd, gwl_wndproc)
setwindowlong me.hwnd, gwl_wndproc, addressof myproc
end sub
private sub form_unload(cancel as integer)
killtimer me.hwnd, 0
end sub
窗體模組** 結束
標準模組 x.bas檔案開始
option explicit
public declare function getwindowlong lib "user32.dll" alias "getwindowlonga" (byval hwnd as long, byval nindex as long) as long
public declare function setwindowlong lib "user32.dll" alias "setwindowlonga" (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as long
public declare function callwindowproc lib "user32.dll" alias "callwindowproca" (byval lpprevwndfunc as long, byval hwnd as long, byval msg as long, byval wparam as long, byval lparam as long) as long
public declare function settimer lib "user32.dll" (byval hwnd as long, byval nidevent as long, byval uelapse as long, byval lptimerfunc as long) as long
public declare function killtimer lib "user32.dll" (byval hwnd as long, byval nidevent as long) as long
public const gwl_wndproc as long = -4
public poldproc as long
public declare function sendmessage lib "user32.dll" alias "sendmessagea" (byval hwnd as long, byval wmsg as long, byval wparam as long, byval lparam as long) as long
function myproc(byval hwnd as long, byval wmsg as long, byval wparam as long, byval lparam as long) as long
select case wmsg
case wm_user + 1
frm1.print "訊息 wm_user+1, wmsg:" & wmsg & ", wparam:" & wparam & ", lparam:" & lparam
case wm_syscommand
if wparam = sc_contexthelp then
shell "notepad c:\windows\system32\eula.txt", vbnormalfocus
end if
case wm_timer
'frm1.cls
'frm1.print now
frm1.caption = now
end select
myproc = callwindowproc(poldproc, hwnd, wmsg, wparam, lparam)
end function
標準模組x.bas檔案結束
vb中如何獲得所有的視窗語柄, VB 如何獲取一個視窗中所有文字框的控制代碼
private declare function findwindowex lib user32 alias findwindowexa byval hwnd1 as long,byval hwnd2 as long,byval lpsz1 as string,byval lpsz2 as stri...
VB控制其他視窗的按鍵,在VB中怎樣控制其它的程式的文字框和按鈕
command1 click 是模組過程,要在form1中呼叫要用全域性過程 在工程視窗上新增一個模組module1,在模組裡把窗體2的command1 click過程寫上去,再在窗體1的command1 click事件中呼叫 例 設form2的command1 click事件為 print a 則...
如何設定視窗模式,如何設定視窗模式
一 dnf遊戲視窗化設定步驟一 dnf遊戲玩家首先開啟dnf客戶端程式。開啟以後登入個人遊戲賬號。二 dnf遊戲視窗化設定步驟二 登陸個人遊戲賬號以後,等待遊戲的載入。載入完成以後,選擇角色進入遊戲介面。三 dnf遊戲視窗化設定步驟三 進入遊戲介面以後,dnf玩家按esc鍵快速開啟dnf遊戲選單。四...