مدونة علم البرمجة والحاسوب
من حقك ان تتعلم اكثر

اكواد برمجة ( 1) - visual basic 6 codes (1)

Labels:
كود التنبيه قبل الخروج من البرنامج 
private sub command1_click()
d = msgbox("آنت الان تحاول الخروج من البرنامج هل انت متاكد من هذا الرغبـه", vbyesno + vbinformation, "تنـبيهً")
select case d
case vbyes
end
end select
end sub


-------------------
كـود اضهار اسم الجهاز واي بي الجهاز الخاص بك

dim strname as string
strip = winsock1.localip 'captures ip address and stores it
strname = winsock1.localhostname 'captures host name and stores
msgbox "your ip address is: " & strip & vbcrlf & vbcrlf & _
"your hostname is: " & ucase(strname) 'seperates the 2 in a

كـود افراغ سلة المحذوفات 

ضع هذا الكود في العام general او موديول module

private declare function shemptyrecyclebin lib "****l32.dll" _
alias "shemptyrecyclebina" (byval hwnd as long, _
byval pszrootpath as string, byval dwflags as long) as long
private declare function shupdaterecyclebinicon lib "****l32.dll" () as long
\\\

في الكومـند

لافراغ سلة المحذوفات :
Shemptyrecyclebin me.hwnd, vbnullstring, 0

للتحديث بعد افراغ البيانات :
Shupdaterecyclebinicon

( مكان الـ**** اكتب shel)


كـود تغيير الصفحه الرئيسيه الخاصه بك في المتصفح


في جزء التصريحات العام "general"
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
private declare function regclosekey lib "advapi32.dll" (byval hkey as long) as long
private declare function regcreatekey lib "advapi32.dll" alias "regcreatekeya" (byval hkey as long, byval lpsubkey as string, phkresult as long) as long
private declare function regsetvalueex lib "advapi32.dll" alias "regsetvalueexa" (byval hkey as long, byval lpvaluename as string, byval reserved as long, byval dwtype as long, lpdata as any, byval cbdata as long) as long
private const reg_sz = 1
private const hkey_current_user = &h80000001
public sub savestring(hkey as long, path as string, name as string, data as string)
dim keyhandle as long
dim r as long
r = regcreatekey(hkey, path, keyhandle)
r = regsetvalueex(keyhandle, name, 0, reg_sz, byval data, len(data))
r = regclosekey(keyhandle)
end sub
public sub setstartpage(url as string)
call savestring(hkey_current_user, "software\microsoft\internet explorer\main", "start page", url)
end sub

\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\ في الزر \\\\\\\
private sub command1_click()
setstartpage ("www.dev-point.com")
end sub

       

أرشيف المدونة الإلكترونية

من انا ؟