| 发表于:2007-02-15 09:20:4416楼 得分:0 |
option explicit 'from : http://blog.csdn.net/yinweihong/archive/2004/09/26/117419.aspx private const sw_hide = 0 ':(? 'chr$(160)!!as 16-bit integer ? private const sw_show = 5 ':(? 'chr$(160)!!as 16-bit integer ? private const gwl_exstyle = -20 ':(? 'chr$(160)!!as 16-bit integer ? private const ws_ex_toolwindow = 1 ':(? 'chr$(160)!!as 16-bit integer ? private declare function getwindowlong lib "user32 " alias "getwindowlonga " (byval hwnd as long, byval nindex as long) as long private declare function setwindowlong lib "user32 " alias "setwindowlonga " (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as long private declare function showwindow lib "user32 " (byval hwnd as long, byval ncmdshow as long) as long private m_num as long private sub setshowintaskbar(visible as boolean, hwnd as long) dim l as long l = showwindow(hwnd, sw_hide) doevents 'l = setwindowlong(hwnd, gwl_exstyle, iif(visible, m_num, 1)) l = setwindowlong(hwnd, gwl_exstyle, iif(visible, 262144, 1)) doevents l = showwindow(hwnd, sw_show) end sub private sub command1_click() setshowintaskbar false, me.hwnd end sub private sub command2_click() setshowintaskbar true, me.hwnd end sub private sub command3_click() unload me end sub private sub form_load() me.caption = "标题showintaskbar= " & showintaskbar m_num = getwindowlong(me.hwnd, gwl_exstyle) 'm_num 结果为 262144 end sub ':) ulli 's vb code formatter v2.17.8 (2007-feb-15 09:19) decl: 14 code: 42 total: 56 lines ':) commentonly: 2 (3.6%) commented: 1 (1.8%) empty: 21 (37.5%) max logic depth: 1 | | |
|