1樓:匿名使用者
public declare function getforegroundwindow lib "user32" alias "getforegroundwindow" () as long
獲得當前操作的視窗控制代碼
public declare function enumwindows lib "user32" (byval lpenumfunc as long, byval lparam as long) as long
列出所有視窗控制代碼
public declare function findwindow lib "user32" alias "findwindowa" (byval lpclassname as string, byval lpwindowname as string) as long
通過視窗的類或文字內容獲取控制代碼
控制代碼得到就可以用
private declare function getforegroundwindow lib "user32" () as long
private declare function setwindowtext lib "user32" alias "setwindowtexta" (byval hwnd as long, byval lpstring as string) as long
private sub command1_click()
dim hdlwnd as long
hdlwnd = getforegroundwindow
'把**放到時間控制元件裡 就可以獲取其他視窗控制代碼
setwindowtext hwnd, "文字內容"
end sub
2樓:
可以用findwindow就可以查詢視窗
返回的就是視窗控制代碼
就可以用setwindowtexta了
vb60程式設計作業,VB6 0程式設計作業
第一題 dim i as integer do i i 1 if i mod 2 1 and i mod 3 2 and i mod 4 3 and i mod 5 4 and i mod 6 5 and i mod 7 0 then exit do loop msgbox 共有 i 階 vb6.0...
VB6 0初級問題,新手請教
private sub command1 click dim a,b as long a val text1.text b val text2.text text3.text str a b end sub 雙擊command1 private sub command1 click text3.te...
vb6 0製作科學計算器
這是我很久以前編的了 你看下吧 先宣告 完全白痴的程式設計 private sub command1 click if label5 and label5 text1 then text1 label1 label2 label3 label4 label5 end if 上面作用是為了在運算完一個...