vbcodes.pdf

13
ﻣﻮﻗﻊ ﻣﻦ اﻟﻤﻠﻒ ﺗﺤﻤﻴﻞ ﺗﻢ اﻟﺘﻘﻨﻴﺔ اﻟﺒﻮﺻﻠﺔwww.boosla.com

Upload: esraa-ibrahim

Post on 13-Jan-2016

7 views

Category:

Documents


0 download

DESCRIPTION

visual basic

TRANSCRIPT

Page 1: VBCodes.pdf

تم تحميل الملف من موقع البوصلة التقنية

www.boosla.com

Page 2: VBCodes.pdf

thek

ing1

.topc

ities

.com

١

ssyypphhoonnffiilltteerrا�خا�خه�ا ا����ب ه� ��ـ�رة �ـ� أآـ�اد �ـ� �ـ�ة ��ا ـ� أه�ـ� ���ـ�ع ه�ا ا����ب ه� ��ـ�رة �ـ� أآـ�اد �ـ� �ـ�ة ��ا ـ� أه�ـ� ���ـ�ع و � ;:9 �4178 -�6/+�� 45 ه�3 و � ;:9 �4178 -�6/+�� 45 ه�3 و�� � ا�خ 10/� �0/.و�� � ا�خ 10/� �0/.-� � -�ا-, ا�+*ب -� � -�ا-, ا�+*ب

..ا��;��, ��+A ا��7@�ة دون ا��1س -:=�ق أ�0 ا��;��, ��+A ا��7@�ة دون ا��1س -:=�ق أ�0 TThheeKKiinnGG

ccoomm..ttooppcciittiieess..11iinnggtthheekk::////hhttttpp ccoomm..YYaahhoooo@@iisshheerree22000044tthheekkiinngg

�5رغ�5رغ SSttrriinngg إذا آ�ن إذا آ�ن���Tر���Tراا ..١١

Dim txt As String

Dim blank As String

blank = ""

:

If Len(txt) = 0 Then ...

If txt = vbNullString Then ...

If txt = "" Then ...

If txt = blank Then …

٢٢.. ,/YZ ,[\ ,@]6^,/YZ ,[\ ,@]6^

Dim str As String

Dim x() As String

str = " �����##ا����##ا���##������ت "

x() = Split(str, "##")

For Each y In x()

MsgBox y

Next

�+*5, -�ث ا��`�8وز�+*5, -�ث ا��`�8وز ..٣٣

Dim winPath As String

winPath = Environ$("windir")

FFoorr mmoorree PPrrooggrraammss,, CCrraacckk,, SSeerriiaallss aanndd SSuubbttiittlleess GGoo TToo ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp

Page 3: VBCodes.pdf

thek

ing1

.topc

ities

.com

٢

^i/\j ^78/� ا���د ��7*ة �+/i/\j^,8 ^78/� ا���د ��7*ة �+/8, ..٤٤

Public Sub Delay(HowLong As Date)

TempTime = DateAdd("s", HowLong, Now)

While TempTime > Now

DoEvents

Wend

End Sub

Private Sub Command1_Click()

Delay 5

MsgBox "test"

End Sub

kZا�l mT �+- ,��;*ض ص�8وق ا�*� A�` ف�;kZا�l mT �+- ,��;*ض ص�8وق ا�*� A�` ف�;kZا�l mT �+- ,��;*ض ص�8وق ا�*� A�` ف�;

+` EEnntteerrr�- i �� ���7ح`+r�- i �� ���7ح TTaabb ا\+i ���7حا\+i ���7ح ..٥٥

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

SendKeys "{TAB}"

KeyAscii = 0

End If

End Sub

٦٦.. t-إt-ل �7+�ل زر�ل �7+�ل زرإ� xx زاو`, ا��7رم k5 � ا��ا � k5 زاو`, ا��7رما��ا

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

Cancel = True

End Sub

٧٧.. �/+� �[6� iT]�7ت دا/� ا�6]� �+/��:�ف \� iT]�7ت دا/� ا�ف \�:�

Kill "c:\windows\desktop\vb\*.*"

٨٨.. �+���+��yy,, CCoommbbooBBooxx �/+� {[� :��`�تت �]} �+/�-�`��:-

Private Sub Command1_Click()

Dim sline As String

nfile = FreeFile

Combo1.Clear

Open "c:\windows\desktop\books.txt" For Input As #nfile

While Not EOF(1)

Line Input #nfile, sline

Combo1.AddItem sline

Wend

End Sub

Page 4: VBCodes.pdf

thek

ing1

.topc

ities

.com

٣

�8وز -t*`=, ا~ي -k {ي�8وز -t*`=, ا~ي -k {ي�]:�Yل �]4 د�/i ا��`�]:�Yل �]4 د�/i ا��` ..٩٩

Public Declare Function GetWindowsDirectory _

Lib "kernel32" Alias "GetWindowsDirectoryA" _

(ByVal lpBuffer As String, ByVal nSize As Long) As Long

Public Function WindowsDirectory() As String

Dim St As String

Dim A As Long

A = 50

St = String(A, " ")

GetWindowsDirectory St, A

St = Trim(St)

St = Left(St, Len(St) - 1)

If Right(St, 1) <> "\" Then WindowsDirectory = St + "\" Else

WindowsDirectory = St

End Function

*`� ��5�0 *`� ��5�0 ��8ك \], YZ/, و^:��ي �]4 -+� ا�*��ز و^��8ك \], YZ/, و^:��ي �]4 -+� ا�*��ز و^ ..١٠١٠

Public Function Clean(sString As String) As String

Dim nLength As Integer

Dim nStart As Integer

Dim sOne As String

Dim sNoWay As String '

sNoWay = " ',-.()!_$*<>/\?;:=+" ' ����� ادوف ا�� ا If Not IsNull(sString) Then

nLength = Len(sString)

nStart = 1

Do While nStart <= nLength

sOne = Mid(sString, nStart, 1)

If InStr(1, sNoWay, sOne, vbTextCompare) = 0 Then

Clean = Clean & sOne

End If

nStart = nStart + 1

Loop

End If

End Function

Private Sub Command1_Click()

MsgBox Clean(" �����=ا����'ا���-������ت ")

End Sub

:^CCoommbbooBBooxx\ i/�tT �/ط ا���/�^* ف^:/\ i�tT �/ط ا���/�^* ف ..١١١١

Private Sub Form_Load()

Dim i As Integer

For i = 0 To Screen.FontCount - 1

Combo1.AddItem Screen.Fonts

Next i

Combo1.Text = Combo1.List(0)

End Sub

Page 5: VBCodes.pdf

thek

ing1

.topc

ities

.com

٤

�+*5, ا�7*ق -/� و �/� �:�د`��+*5, ا�7*ق -/� و �/� �:�د`� ..١٢١٢

diff = Format(TimeValue(Time1) - TimeValue(Time2), "HH:MM:SS") �/0�/0 TTiimmee11 ول ه� ه�r9 ا ه� ا�� 9 ا���kZه� ا�� 9 ا���TTiimmee22 kZ وو ا�� 9 اrولا��

١٣١٣.. k5 وو�+ه kYZ {[� ��7� آ�دk5 وو�+ه kYZ {[� ��7� آ�د TTeexxttBBooxx

'set multiLine property for the TextBox = True

Open "c:\windows\desktop\books.txt" For Input As #1

Text1.Text = Input(LOF(1), 1)

Close #1

�]�jآ� �� و\�د �]}�]�jآ� �� و\�د �]} ..١٤١٤

Private Declare Function SHFileExists Lib "shell32" Alias "#45"

(ByVal szPath As String) As Long

Private Sub Form_Load()

MsgBox Str$(SHFileExists("c:\autoexec.bat"))

End Sub

A ر;��, ر;��, أ�� إذا �A `�� ��\�دًا ���5* �� أ�� إذا �A `�� ��\�دًا ���5* ��١١إذا آ�ن ��\�دًا ^��* ر;��, ����ب 5/�� ا�* A إذا آ�ن ��\�دًا ^��* ر;��, ����ب 5/�� ا�* A ����٠٠ب 5/�� ا�* A ����ب 5/�� ا�*

ا�*��ديا�*��دي آ�د ��:�`i أ��ان ا��Yر إ�4آ�د ��:�`i أ��ان ا��Yر إ�4 ..١٥١٥

Picture1.ScaleMode = vbPixels

x = Picture1.ScaleWidth

y = Picture1.ScaleHeight

For i = 0 To y - 1

For j = 0 To x - 1

pixel = Picture1.Point(j, i)

red = pixel Mod 256

green = ((pixel And &HFF00) / 256) Mod 256

blue = (pixel And &HFF0000) / 65536

g = ((red * 30) + (green * 60) + (blue * 20)) / 100

Picture1.PSet (j, i), RGB(g, g, g)

Next

Next

Picture1.ScaleMode = vbTwips

ا��1-� ا�k5�-�1 ا������Z ا���دk5 ا������Z ا���د أ�} زر آ����Z و�*-� ص�رة واآ�.أ�} زر آ����Z و�*-� ص�رة واآ�.

`:�ل ا�:*وف ا�6Z]/[`, �0*ف آ�/*ة`:�ل ا�:*وف ا�6Z]/[`, �0*ف آ�/*ة ..١٦١٦

Private Sub Text1_KeyPress(KeyAscii As Integer)

KeyAscii = Asc(UCase(Chr$(KeyAscii)))

End Sub

FFoorr mmoorree PPrrooggrraammss,, CCrraacckk,, SSeerriiaallss aanndd SSuubbttiittlleess GGoo TToo ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp

Page 6: VBCodes.pdf

thek

ing1

.topc

ities

.com

٥

١٧١٧.. mا���91 -�آ k5 �`إدارج ا���رmا���91 -�آ k5 �`إدارج ا���ر

Text1.text = Date

١٨١٨.. m9 �]��91 -�آ ���5, ا�� 9 �]��91 -�آ5���m, ا��

Text1.text = Time

ه�ا ا���د ����ر ر;��, �]���1مه�ا ا���د ����ر ر;��, �]���1م ..١٩١٩

MsgBox "String", vbInformation, "Title" �/0�/0 SSttrriinngg 5 ��^5 ��^ت�Z�/- ع�Z �� ,��;*ا� A1\ ��/ت�Z�/- ع�Z �� ,��;*ا� A1\ ��/ SSttrriinngg وو vvbbIInnffoorrmmaattiioonn ,��;*ع ا��Z,��;*ع ا��Z

أي ر;��, jtT أو �+]���ت �8�5 و�+i�� 9 ر;��, �+]���ت ^t�1/� ^��`]�� ����نأي ر;��, jtT أو �+]���ت �8�5 و�+i�� 9 ر;��, �+]���ت ^t�1/� ^��`]�� ����نvvbbyyeessnnoo أ أ r أو A+Z ي زرr أو A+Z ي زر

ه� ا�+�8انه� ا�+�8ان TTiittllee ــــو ا�و ا�

�=]. ا��Yرة -��i ��دي�=]. ا��Yرة -��i ��دي ..٢٠٢٠

Picture2.PaintPicture Picture1.Picture, 0, 0, _

Picture1.Width, Picture1.Height, 0, Picture1.Height, _

Picture1.Width, -Picture1.Height, vbSrcCopy

٢١٢١.. mا���91 -�آ k5 \�د�ا�8ص ا� ,���t�mا���91 -�آ k5 \�د�ا�8ص ا� ,���t�

Printer.Print Text1.Text

٢٢٢٢.. �/^�7� i� ل�t-��/^�7� i� ل�t-� CCttrrll++DDeell++SShhiifftt

Private Declare Function SystemParametersInfo Lib _

"user32" Alias "SystemParametersInfoA" (ByVal uAction _

As Long, ByVal uParam As Long, ByVal lpvParam As Any, _

ByVal fuWinIni As Long) As Long

Sub DisableCtrlAltDelete(bDisabled As Boolean)

Dim X As Long

X = SystemParametersInfo(97, bDisabled, CStr(1), 0)

End Sub

A1 ا��Y*`:�ت k5 ت�� ه�ا�:`*Yا�� A1 k5 ه�ا �� GGeenneerraall

�-�tل �i ا��t-��/^�7ل �i ا��7^/�

Call DisableCtrlAltDelete(True)

�ر\�����ر\����

Call DisableCtrlAltDelete(False)

FFoorr mmoorree PPrrooggrraammss,, CCrraacckk,, SSeerriiaallss aanndd SSuubbttiittlleess GGoo TToo ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp

Page 7: VBCodes.pdf

thek

ing1

.topc

ities

.com

٦

FFoorrmm22 ��¡�ء ^:/i �5رم �� و�/����¡�ء ^:/i �5رم �� و�/�� ..٢٣٢٣

Unload Form2

و�/�� ���ر ر;��,و�/�� ���ر ر;��, EEnntteerr ���7ح���7ح ���¡/i �0ث �+/� ��8 ا��¡ط �]i/¡���4 �0ث �+/� ��8 ا��¡ط �]4 ..٢٤٢٤

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

MsgBox " Syphonfilter "

End If

End Sub

i+6� */¡�` r*/¡�` r ا��7رم A60 k5 واi+6��0 ا��7رم A60 k5 وا�0 ..٢٥٢٥

Private Sub Form_Resize()

Width = 3000

Height = 3000

End Sub

TTeexxttBBooxx ـ ـ �:�ف ا�8ص ا�:�د k5 ا��:�ف ا�8ص ا�:�د k5 ا� ..٢٦٢٦

Text1.Seltext = Clear

٢٧٢٧.. �6��Z*�� ي*; A �+i ر A ;*ي ��*+��6��Zi ر

a = InputBox(" ا�%$ ا�#ي"، "د'& ا�%$ ا�#يا ")

If a = "*+#��" Then ' MsgBox "�,-,. "آ�/� ا�#Else

MsgBox "�12�' "آ�/� ا�#End If

هt1[5 k/�هt1[5 k/�آ], ا�1* آ], ا�1*

٢٨٢٨.. �`� ����ر ر;��, �]���1م ��8 ا��¡ط -[ر ا�j7رة ا�`�����ر ر;��, �]���1م ��8 ا��¡ط -[ر ا�j7رة ا

IF Button = 2 then

MsgBox "3458رة ا�ع ا�>;: �9ر ا�>�?" End if

MMoouusseeMMoovvee �� ا���د k5 �0ث �� ا���د k5 �0ث

٢٩٢٩.. �`� ����ر ر;��, �]���1م ��8 ا��¡ط -[ر ا�j7رة ا�`�����ر ر;��, �]���1م ��8 ا��¡ط -[ر ا�j7رة ا

IF Button = 1 then

MsgBox " 8رة ا#�5?�<ع ا�>;: �9ر ا�� "

End if

MMoouusseeMMoovvee �� ا���د k5 �0ث �� ا���د k5 �0ث

FFoorr mmoorree PPrrooggrraammss,, CCrraacckk,, SSeerriiaallss aanndd SSuubbttiittlleess GGoo TToo ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp

Page 8: VBCodes.pdf

thek

ing1

.topc

ities

.com

٧

٣٠٣٠.. ,/ �+i ;��, ر /,�+i ;��, ر

Label1.Caption = Time .. إ�4 ا��7رمإ�4 ا��7رم TTiimmeerr أ�}أ�}--١١

-�ون -�ونا\+]ها\+]هأي أي �T CCaappttiioonnص/,�Tص/, �1 ا����-, ا��\�دة �1k5 ا����-, ا��\�دة k5إ�4 ا��7رم وا�إ�4 ا��7رم وا� LLaabbeell أ�}أ�}--٢٢A;أA;أ ..

.. �١٠٠١٠٠]��`* -=/, �]��`* -=/, EEnntteerrvvaall إ\+�T iص/,إ\+�T iص/,--٣٣ .. **أ�} ا���د ا��1-� �]��`أ�} ا���د ا��1-� �]��`--٤٤

٣١٣١.. ���¦ mا���91 -�آ k5 ا��ط i+6����¦ mا���91 -�آ k5 ا��ط i+6�

Text1.FontBold = True

٣٢٣٢.. mا���91 -�آ k5 ا��ط i+6� mا���91 -�آ k5 ا��ط i+6�i@��i@��

Text1.FontItalic = True

ا���91 -�آm ا���91 -�آmا��]�تا��]�ت^:T i+6� 9:^ 9ط �T i+6ط ..٣٣٣٣

Text1.FontUnderline = True

ا��ط k5 ا���91 -�آm ا��ط k5 ا���91 -�آ�m¡//* ��ن�¡//* ��ن�� ..٣٤٣٤

Text1.ForeColor = Color

إ�4 �7*ة ا�]�ن ا��ي ^*`�إ�4 �7*ة ا�]�ن ا��ي ^*`� CCoolloorr �� ^¡//* آ],�� ^¡//* آ],

ا��ط k5 ا���91 -�آmا��ط k5 ا���91 -�آ�Zmع �Zع �¡//* �¡//* �� ..٣٥٣٥

Text1.FontName = Andalus

*//¡^ �� *//¡^ �� AAnnddaalluuss�`*^ ا��ط ا��ي A;ا��ط ا��ي ^*`�إ�4 إ A;إ�4 إ

PPiiccttuurree BBooxx ـ ـ ��:/i ص�رة إ�4 ا���:/i ص�رة إ�4 ا� ..٣٦٣٦

Picture1 = LoadPicture("C:\Picture.bmp")

و�:7¨ ص�رةو�:7¨ ص�رة

savepicture picture1.picture, "C:\Picture.bmp"

FFoorr mmoorree PPrrooggrraammss,, CCrraacckk,, SSeerriiaallss aanndd SSuubbttiittlleess GGoo TToo ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp

Page 9: VBCodes.pdf

thek

ing1

.topc

ities

.com

٨

٣٧٣٧.. k��T�5رم ر i+�k��T�5رم ر i+�

Private Sub GradientFill()

Dim i As Long

Dim c As Integer

Dim r As Double

r = ScaleHeight / 3.142

For i = 0 To ScaleHeight

c = Abs(220 * Sin(i / r))

Me.Line (0, i)-(ScaleWidth, i), RGB(c, c, c + 30) 'Notice the bias To

blue. You can be more subtle by reducing this number (try 10). Try

other colours too.

Next

End Sub

A1 ا��Y*`:�تا���د ا��1-�ا���د ا��1-��� �� k5 ت�:`*Yا�� A1 k5 GGeenneerraall

GradientFill

�]�7رم�]�7رم RReessiizzee وه�ا ا���د k5 �0ثوه�ا ا���د k5 �0ث

EEsscc �]�*وج �� ا��*��Z» -�ا;t, ا��¡ط �]4 ���7ح�]�*وج �� ا��*��Z» -�ا;t, ا��¡ط �]4 ���7ح ..٣٨٣٨

Form1.KeyPreview = True

�]�7رمk5 Load �0ث ا��:/i ا���د ا��1-�

If KeyAscii = 27 Then

End

End If

�]�7رم�]�7رم KKeeyyPPrreessss وه�ا 45 �0ثوه�ا 45 �0ث

TTeexxttBBooxx ـ ـ �]���-, k5 ا��]���-, k5 ا� ..٣٩٣٩

Text1.Text = "��� س�A�ا"

���دة ^�¡/i ا���6ز���دة ^�¡/i ا���6ز ..٤٠٤٠

Private Declare Function SetupPromptReboot Lib "setupapi.dll" (ByRef

FileQueue As Long, ByVal Owner As Long, ByVal ScanOnly As Long) As Long

A1 ا��Y*`:�تا���د ا��1-�ا���د ا��1-��� �� k5 ت�:`*Yا�� A1 k5 GGeenneerraall

SetupPromptReboot ByVal 0&, Me.hWnd, 0 CCoommmmaanndd ه�ا ا���د k5 �0ث ا��¡ط �]4 زره�ا ا���د k5 �0ث ا��¡ط �]4 زر

TTeexxttBBooxx ��:�`� آ]k �]8ص ا��\�د k5 �*-� ا�8ص��:�`� آ]k �]8ص ا��\�د k5 �*-� ا�8ص ..٤١٤١

With Text1

Text1.SelStart = 0

Text1.SelLength = Len(Text1)

Text1.SetFocus

End With

FFoorr mmoorree PPrrooggrraammss,, CCrraacckk,, SSeerriiaallss aanndd SSuubbttiittlleess GGoo TToo ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp

Page 10: VBCodes.pdf

thek

ing1

.topc

ities

.com

٩

��8 �*ور ا��وس �5 ه ��8 �*ور ا��وس �5 هBBoolldd إ�4 إ�T *//¡��CCoommmmaanndd BBoottttoonn 4ط ا�ـ ��¡//* Tط ا�ـ ..٤٢٤٢

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X

As Single, Y As Single)

Command1.FontBold = True

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As

Single, Y As Single)

Command1.FontBold = False

End Sub

٤٣٤٣.. � �+i وص], ��0 ا��ا ��+i وص], ��0 ا��ا إ�4 ا��7رم إ�4 ا��7رمLLaabbeell 11 أ�} أ�} --١١ إ�4 ا��7رم إ�4 ا��7رمLLaabbeell 22 أ�} أ�} --٢٢

: :�د ا�����4د ا����4 �� ا�� �� ا��--٣٣Option Explicit

Private Declare Function FindExecutable Lib "shell32.dll" Alias

"FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As

String, ByVal lpResult As String) As Long Private Declare Function ShellExecute Lib "shell32.dll" Alias

"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String,

ByVal lpFile As String, ByVal lpParameters As String, ByVal

lpDirectory As String, ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL = 1

Dim sPath$, sFilename$

Private Sub label2_Click()

On Error GoTo errorhandler ' in case of drive error Dim sProgramName As String * 255 Dim retFind&, retShell&, iFileNum%, sRandFileName$

sRandFileName = "x27z42j.html" ' pick a name that is unlikely to

be on disk iFileNum = FreeFile ' write the temp file to disk Open App.Path & "\" & sRandFileName For Binary As iFileNum Put iFileNum, , vbNullString Close iFileNum

retFind = FindExecutable(sRandFileName, App.Path, sProgramName(

Kill App.Path & "\" & sRandFileName ' get rid of it now that we are

done testing... Select Case retFind

Case 0 MsgBox "Sorry out of memory, please close some programs and try

again". Exit Sub

Case 1 To 30

' error (you could have some generic error message here as well(. MsgBox "Error Number: " & retFind

Exit Sub

Page 11: VBCodes.pdf

thek

ing1

.topc

ities

.com

١٠

Case 31

MsgBox "Unable to find Web Browser". Exit Sub

Case Is > 31

Label1.Caption = "Launching " & ParseChar("\", sProgramName(

DoEvents ' without this the label may be white or blank retShell = ShellExecute(Form1.hwnd, "Open",

"http://members.aol.com/wpsjr3/vb/index.html", "", "", SW_SHOWNORMAL(

If retShell > 31 Then ' call succeded

Else Label1.Caption = "Error"

MsgBox "Unable to launch Web Browser". End If

End Select Exit Sub

errorhandler:

If Dir(App.Path & sRandFileName) <> "" Then Kill App.Path & "\" &

sRandFileName MsgBox "An error has occured, please report this to you lowly

programmer" & vbCrLf & "Error Number: " & Err.Number & vbCrLf &

"Error description: " & Err.Description End Sub

Private Sub Form_Load() ' make the label look like a link Label2.ForeColor = &HFF0000 Label2.FontUnderline = True End Sub

Private Sub Label2_MouseDown(Button As Integer, Shift As Integer, X

As Single, Y As Single( Label2.ForeColor = &HFFFF&

End Sub Private Sub Label2_MouseUp(Button As Integer, Shift As Integer, X As

Single, Y As Single( Label2.ForeColor = &HFF&

End Sub Private Function ParseChar(char As String, cString As String) As

String Dim where% where = InStr(cString, char(

If where = 0 Then Exit Function Do

where = InStr(cString, char( If where = 0 Then Exit Do

cString = Mid$(cString, where + 1, Len(cString(( Loop

ParseChar = cString End Function

Page 12: VBCodes.pdf

thek

ing1

.topc

ities

.com

١١

�*;�tT Aط داiT ا��7رم�*;�tT Aط داiT ا��7رم ..٤٤٤٤

Public xPos, yPos

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As

Single, Y As Single)

If Button = 1 Then Me.Line (X, Y)-(xPos, yPos), RGB(0, 255, 255)

End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As

Single, Y As Single)

xPos = X

yPos = Y

End Sub

��7Tء �¬�* ا��7رة وإ���ر�7T�3ء �¬�* ا��7رة وإ���ر3 ..٤٥٤٥

Private Declare Function ShowCursor Lib "user32" _

(ByVal bShow As Long) As Long

A1 ا��Y*`:�تا���د ا��1-�ا���د ا��1-��� �� k5 ت�:`*Yا�� A1 k5 GGeenneerraall

��7Tء ا�¬�*��7Tء ا�¬�*

x = ShowCursor(False)

و�� -ه ا���د ا��1-� و�� -ه ا���د ا�CCoommmmaanndd�-�1أ�} زر أ�} زر

����ر ا�¬�*����ر ا�¬�*

x = ShowCursor(True)

{T* و�� -ه ا���د ا��1-� {T* و�� -ه ا���د ا�CCoommmmaanndd�-�1أ�} زر أ�} زر

٤٦٤٦.. *T} �1ر إ�4 ��1ر� �� {[� i=8�*T} �1ر إ�4 ��1ر� �� {[� i=8�

Private Declare Function MoveFile Lib "kernel32" Alias "MoveFileA"

(ByVal lpExistingFileName As String, ByVal lpNewFileName As String)

As Long

Private Sub Command1_Click()

MoveFile "c:\Windows\Desktop\a.txt", "c:\a.txt"

End Sub

Al GGeenneerraall �� ا���د ا��1-� 45 Al A1 �� ا���د ا��1-� 45 CCoommmmaanndd11 A1أ�} زر أ�} زر إ�4 ��1ر ا�]} ا�*اد Z=]ه إ�4 ��1ر ا�]} ا�*اد Z=]هcc::\\WWiinnddoowwss\\DDeesskkttoopp\\aa..ttxxttو¦/* و¦/*

إ�4 ا��1ر ا�*اد i=Z ا�]} إ�/ه إ�4 ا��1ر ا�*اد i=Z ا�]} إ�/هcc::\\aa..ttxxttو¦/* و¦/*

��6ز��6ز���دة ^�¡/i ا����دة ^�¡/i ا� ..٤٧٤٧

Private Declare Function SetupPromptReboot Lib "setupapi.dll" (ByRef

FileQueue As Long, ByVal Owner As Long, ByVal ScanOnly As Long) As

Long A1 ا��Y*`:�تا���د ا��1-�ا���د ا��1-��� �� k5 ت�:`*Yا�� A1 k5 GGeenneerraall

SetupPromptReboot ByVal 0&, Me.hWnd, 0

CCoommmmaanndd �[ر �[ر k5 CClliicckk �0ثk5 �0ث�� ا���د ا��1-� 45 �� ا���د ا��1-� 45

Page 13: VBCodes.pdf

thek

ing1

.topc

ities

.com

١٢

�+*5, ���ن �6]� ا�]�7ت ا�¬ �ه�+*5, ���ن �6]� ا�]�7ت ا�¬ �ه ..٤٨٤٨

Private Sub Command1_Click()

strTempDir = Environ$("temp")

MsgBox strTempDir

End Sub

+*5, د , ا����,+*5, د , ا����,�� ..٤٩٤٩

Private Sub Command1_Click() Dim intWidth As Integer Dim intHeight As Integer intWidth = Screen.Width \ Screen.TwipsPerPixelX intHeight = Screen.Height \ Screen.TwipsPerPixelY MsgBox "Screen Resolution:" + Str$(intWidth) + " x" + Str$(intHeight(

End Sub

eexxee ��7 أي �]}� ..٥٠٥٠

Private Sub Command1_Click() Shell "" End Sub

Y/صY/ص�� ��1ر ا�]} -/� �°��4 ا���8� ��1ر ا�]} -/� �°��4 ا��8

FFoorrmm22 ا;ها;ه����ر �5رم �� و�/�� ����ر �5رم �� و�/�� ..٥١٥١

Form2.Show

FFoorrmm22 ا;ها;ه �5رم �� و�/�� �5رم �� و�/�� �7Tء�7Tء�� ..٥٢٥٢

Form2.Hide

�8� إ;���ام ا�k5 ,5�1 ص�8وق ا�8ص�8� إ;���ام ا�k5 ,5�1 ص�8وق ا�8ص ..٥٣٥٣

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 32 Then

KeyAscii = 0

End If

End Sub

��7� �8� �/t�1^��7� �8� �/t�1^ ,/=�7^/� وذ�� -�¡//* ا�0, ا��� �� *T} , ح�7^/� وذ�� -�¡//* ا�=/0, ا��� �� *T} ��7ح٣٢٣٢حا� ,/ ا��ي ا��ي إ�4 /, ا���7ح إ�4 ^*`� �8+ه^*`� �8+ه

��0 ا��¡//* أو ا����`i و`�� TThheekkiinnGG\/� ا�:=�ق �:��7, �ــ\/� ا�:=�ق �:��7, �ــ �:` rو ��و` i`�0 ا��¡//* أو ا����� �:` rو ���س �� ا���رة �]�Yر� ���س �� ا���رة �]�Yرا� ا

TThheekkiinnGG ccoomm..ttooppcciittiieess..11tthheekkiinngg::////hhttttpp ccoomm..YYaahhoooo@@iisshheerree22000044tthheekkiinngg