时间: 2021-07-31 作者:daque
const swp_hidewindow = &h80const swp_showwindow = &h40const gw_child = 5const gw_hwndnext = 2private 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 longprivate declare function findwindow lib "user32" alias "findwindowa" (byval lpclassname as string, byval lpwindowname as string) as longprivate declare function getwindow lib "user32" (byval hwnd as long, byval wcmd as long) as longprivate declare function getclassname lib "user32" alias "getclassnamea" (byval hwnd as long, byval lpclassname as string, byval nmaxcount as long) as longdim twnd as long, bwnd as long, ssave as string * 250private sub form_load()'搜索句柄 twnd = findwindow("shell_traywnd", vbnullstring) '搜索child bwnd = getwindow(twnd, gw_child) do '获得child的class getclassname bwnd, ssave, 250 '即使class是按钮button if lcase(left$(ssave, 6)) = "button" then exit do '查问下一个 bwnd = getwindow(bwnd, gw_hwndnext) loop'运用api,湮没按钮 setwindowpos bwnd, 0, 0, 0, 0, 0, swp_hidewindowend subprivate sub form_unload(cancel as integer)'回复按钮 setwindowpos bwnd, 0, 0, 0, 0, 0, swp_showwindowend sub