VB 獲得視窗控制代碼,VB獲取視窗控制代碼的詳細教程

2025-04-27 06:30:06 字數 1035 閱讀 6099

1樓:網海1書生

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 setwindowpos lib "user32" (byval hwnd as long, byval hwndinsertafter as long, byval x as long, byval y as long, byval cx as long, byval cy as long, byval wflags as long) as long

private sub command1_click()

dim i as long

i = findwindowex(0, 0, vbnullstring, "testwindow")

do until i = 0

setwindowpos i, ,0, 0, 640, 480, 0

i = findwindowex(0, i, vbnullstring, "testwindow")

loopend sub

以上**是搜尋所有寬茄標題為「testwindow」的視窗,並把它們移到桌面左上角,大小設定為640*480,是精鏈滲簡得不能再簡的**了,只用了兩個api函式。你在此基礎上修改一下就行了。慎喚察。

vb獲取視窗控制代碼的詳細教程

2樓:太平洋電腦網

1、首先在電腦中開啟vb軟體,然後點選視窗。

2、然後找到窗體佈局視窗,就可以在這裡,直接拖曳滑鼠,設定窗體的位置。

3、如果沒有預設開啟,回到操作頁面中,找到並點選如下圖的按鈕。

4、也可以找到stateupposition這個屬性。

5、然後在開啟點頁面中,就可以根據自己的需要,設定預設的型別了。

vb獲取視窗上多個控制元件的控制代碼,如何知道哪個是自己想要的

這個可能是你想要的東東吧!vb 遍歷視窗所有子窗體控制代碼 private const gw child 5 private const gw hwndfirst 0 private const gw hwndnext 2 private declare function getwindowtext...

c 怎麼獲取視窗控制代碼,c 如何得到視窗控制代碼??????????

在字串前面加個l或者把函式改成findwindowa 求助,如何用獲取當前滑鼠所在視窗的控制代碼及視窗標題,c或c c 如何得到視窗控制代碼?顯示視窗控制代碼?cstring的format啊,控制代碼本身是個地址,所以用 d以數字或者 x以十六進位制顯示出來。給編輯框定義一個cstring型別的變數...

C中如何獲取當前視窗控制代碼

1 啟動vs,新建c winform專案。2 在form1中新增4個label控制元件,並佈局如下。3 在form1中新增 如下。4 完成之後,除錯執行,結果如下。注意事項 c 不僅擁有計算機高效執行的實用性特徵,同時還致力於提高大規模程式的程式設計質量與程式設計語言的問題描述能力。1.如果你不是在...