| 发表于:2007-09-14 19:46:131楼 得分:20 |
试试这段代码(稍微修改下就可以) const ws_child = &h40000000 const wm_lbuttondown = &h201 const wm_lbuttonup = &h202 const sw_hide = 0 const sw_normal = 1 private type rect left as long top as long right as long bottom as long end type 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 findwindow lib "user32 " alias "findwindowa " (byval lpclassname as string, byval lpwindowname as string) as long private declare function showwindow lib "user32 " (byval hwnd as long, byval ncmdshow as long) as long private declare function getwindowrect lib "user32 " (byval hwnd as long, lprect as rect) as long private declare function createwindowex lib "user32 " alias "createwindowexa " (byval dwexstyle as long, byval lpclassname as string, byval lpwindowname as string, byval dwstyle as long, byval x as long, byval y as long, byval nwidth as long, byval nheight as long, byval hwndparent as long, byval hmenu as long, byval hinstance as long, lpparam as any) as long private declare function destroywindow lib "user32 " (byval hwnd as long) as long dim twnd as long, bwnd as long, ncwnd as long private sub form_load() dim r as rect twnd = findwindow( "shell_traywnd ", vbnullstring) bwnd = findwindowex(twnd, byval 0&, "button ", vbnullstring) getwindowrect bwnd, r ncwnd = createwindowex(byval 0&, "button ", "start ", ws_child, 0, 0, r.right - r.left, r.bottom - r.top, twnd, byval 0&, app.hinstance, byval 0&) showwindow ncwnd, sw_normal showwindow bwnd, sw_hide end sub private sub form_unload(cancel as integer) showwindow bwnd, sw_normal destroywindow ncwnd end sub | | |
|