Subscribe For Free Updates!

We'll not spam mate! We promise.

الاثنين، 7 يوليو 2014

function disable the Close button to close that exists in each window visual basic codes

Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Const MF_BYPOSITION = &H400&
Private Sub Form_Load()
Dim a As Long, b As Long
a = GetSystemMenu(Me.hwnd, False)
b = GetMenuItemCount(a)
RemoveMenu a, b - 1, MF_BYPOSITION
DrawMenuBar Me.hwnd
End Sub 

from ----

function transfer file from the path to another path visual basic codes

Private Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long
Private Sub Command1_Click()
MoveFile "c:WindowsDesktopa.txt", "c:a.txt"
End Sub 


from ---

download a page from the Internet -make marble form -download all computer lines in Combo Box visual basic code

To download all computer lines in Combo Box

Private Sub Form_Load() 
Dim i As Integer 
For i = 0 To Screen.FontCount - 1 
Combo1.AddItem Screen.Fonts(i) 
Next i 
Combo1.Text = Combo1.List(0) 
End Sub 

to make marble form


in General

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

in form Resize 
GradientFill


To download a page from the Internet

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
lngRetVal = URLDownloadToFile(0, "http://www.the site.com", "c:the site.htm", 0, 0)
End Sub 

from ---



Cancel button closure - to hide the program from the administration to task - Tkarchgal cancel your program at the same time visual basic codes

Cancel button closure - to hide the program from the administration to task - Tkarchgal cancel your program at the same time  visual basic codes


Cancel button closure

Private Sub Form_Unload(Cancel As Integer) 
Cancel = 1 
End Sub


hide the program from the administration to task 

Private Sub Form_Load() 
App.TaskVisible = False 
End Sub

Tkarchgal cancel your program at the same time

Private Sub Form_Load() 
If App.PrevInstance Then Unload Me 
End Sub

Interpreter and redeployed from vb4arb

Copy and transport functions through visual basic codes

Examples and codes to deal with Api functions


Copy and transport functions through visual basic codes

Private Declare Function CopyFile Lib "kernel32" Alias _
"CopyFileA" (ByVal lpExistingFileName As String, ByVal _
lpNewFileName As String, ByVal bFailIfExists As Long) As Long 

Private Declare Function MoveFile Lib "kernel32" Alias _
"MoveFileA" (ByVal lpExistingFileName As String, ByVal _
lpNewFileName As String) As Long 


Sub CopyMove() 
Dim strSource As String 
Dim strTarget As String 
Dim lngRetVal As Long 
strSource = "C:\yfile.txt" 
strTarget = "C:\indows\yfile.txt" 


'// Copy File 
lngRetVal = CopyFile(Trim$(strSource), Trim(strTarget), False) 
If lngRetVal Then 
MsgBox "File copied!" 
Else 
MsgBox "Error. File not moved!" 
End If 

'// Move File 
lngRetVal = MoveFile(Trim$(strSource), Trim(strTarget)) 
If lngRetVal Then 
MsgBox "File moved!" 
Else 
MsgBox "Error. File not moved!" 
End If 
End Sub

Interpreter and redeployed from vb4arb

visual basic code for Delay your program for a certain period Sleep

Examples and codes to deal with Api functions

visual basic code for Delay your program for a certain period Sleep

'in model
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'in form
Private Sub Form_Load()
Call Sleep(1000)
End Sub


Interpreter and redeployed from vb4arb

visual basic code to View desktop background on the form

Examples and codes to deal with Api functions

visual basic code to View desktop background on the form 

Private Declare Function PaintDesktop Lib "user32" _
(ByVal hdc As Long) As Long

Private Sub Command1_Click()
PaintDesktop Form1.hdc
End Sub

Interpreter and redeployed from vb4arb