غير فعال كردن دكمه خروج فرم ها
جمعه 23 مرداد 1388 2:38 AM
این ترفند مربوط مي شود به غير فعال كردن دكمه خروج فرم ها
.
به اين منظور بايد اين قسمت از فرم را كلاً غير فعال كنيم و از حالت استاندارد در آوريد
.
از كد هاي زير استفاده نماييد
:
'Import necessary API Functions to disable Close button
Private declare function GetsystemMenu "User32"
(byval hwnd as long, byval bRevert as long) as long
private declare function delete lib "user32"
(byval hmenu as long, byval nposition as long. Byval wflags as long) as long
Privat declare function drawmenu bar lib "user32" (byval hwnd as long) as long
'Import Necessary constant to disable close button
Private const Sc_close = &HF60
Private const MF_BYCOMMAND = &H0
Public function disableclosebutton(formhwnd as long)
'have function to disable close button
Dim menuhwnd as long
Menuhwnd = getsystemmenu(formhwnd, 0&)
If menuhwnd then
Deletemenu menu hwnd, SC_close, MF_BYCOMMAND
Drawmenubar (formhwnd)
End if
End Function