您现在的位置:学赛首页 > 计算机等级考试 > 复习资料 > 正文
计算机等级考试二级VB:如何去掉窗体的关闭按钮
http://www.educity.cn 作者:不详 来源:考试大 2007年5月31日 发表评论 进入社区
以下是引用片段:
private declare function getsystemmenu lib 'user32' (byval hwnd as long, byval brevert as long) as long 
private declare function removemenu lib 'user32' (byval hmenu as long, byval nposition as long, byval wflags
 as long) as long 
private declare function drawmenubar lib 'user32' (byval hwnd as long) as long 
private declare function getmenuitemcount lib 'user32' (byval hmenu as long) as long 
private const mf_byposition = &h400& 
private const mf_disabled = &h2& 
private sub form_load() 
call disablex(me) 
end sub 
private sub disablex(frm as form) 
dim hmenu as long, ncount as long 
hmenu = getsystemmenu(frm.hwnd, 0) 
ncount = getmenuitemcount(hmenu) 
call removemenu(hmenu, ncount - 1, mf_disabled or mf_byposition) 
drawmenubar frm.hwnd 
end sub