موقع نواحي الدروس فيجوال بيسك فوائد متنوعة لكافة المبرمجين (1) |
| Public Declare Function SetWindowPos Lib 'user32' (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long |
| Dim vWindowPos As Long vWindowPos = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0, 1 Or 2) |
| Dim vX, vY Dim vM As Boolean |
| vX = X vY = Y vM = True |
| Dim frmX, frmY frmX = Form1.Left + (X - vX) frmY = Form1.Top + (Y - vY) If vM = True Then Form1.Move frmX, frmY End If |
| Vm = False |
| Option Explicit Private Const WM_SYSCOMMAND = &H112 Private Const SC_SCREENSAVE = &HF140& Private Declare Function SendMessage Lib 'user32' Alias 'SendMessageA' (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Sub Command1_Click() LaunchScreenSaver Me.hwnd End Sub Sub LaunchScreenSaver(pl_OwnerFormHwnd As Long) Call SendMessage(pl_OwnerFormHwnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0&) End Sub |
| Declare Function GetVolumeInformation Lib 'kernel32.dll' Alias _ 'GetVolumeInformationA' (ByVal lpRootPathName As String, _ ByVal lpVolumeNameBuffer As String, _ ByVal nVolumeNameSize As Integer, _ lpVolumeSerialNumber As Long, _ lpMaximumComponentLength As Long, _ lpFileSystemFlags As Long, _ ByVal lpFileSystemNameBuffer As String, _ ByVal nFileSystemNameSize As Long) As Long Function GetDiskProperties(strDrive As String, DiskName As String, DiskSystemFiles As String, DiskSerialNumber As Long) As Long Dim Res As Long DiskName = String$(255, Chr$(0)) DiskSystemFiles = String$(255, Chr$(0)) Res = GetVolumeInformation(strDrive, DiskName, _ Len(DiskName), DiskSerialNumber, 0, 0, DiskSystemFiles, Len(DiskSystemFiles)) GetDiskProperties = Res End Function |
| Dim NamDisk As String, SysFile As String, SerNum As Long Dim Drive As String Private Sub Form_Load() Combo1.AddItem 'A:' Combo1.AddItem 'B:' Combo1.AddItem 'C:' Combo1.AddItem 'D:' Combo1.AddItem 'E:' Combo1.AddItem 'F:' Combo1.ListIndex = 0 End Sub Private Sub Command1_Click() Drive = Combo1.Text Re = GetDiskProperties(Drive, NamDisk, SysFile, SerNum) Text1.Text = NamDisk Text2.Text = SysFile Text3.Text = SerNum End Sub |
| Option Explicit Private Declare Function FlashWindow Lib 'user32' (ByVal hwnd As Long, ByVal bInvert As Long) As Long Private mb_Flashing As Boolean Private Sub Command1_Click() mb_Flashing = Not mb_Flashing Timer1.Enabled = mb_Flashing If mb_Flashing = False Then Call FlashWindow(Me.hwnd, 0) End If End Sub Private Sub Timer1_Timer() Call FlashWindow(Me.hwnd, 1) End Sub |
| Option Explicit ' by kaled alzeeby alnamer soft Public Const URL = 'http://www.kaled1.jeeran.com' Public Const email = 'nemer_11@hotmail.com' Public 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 Public Const SW_SHOWNORMAL = 1 Public Sub gotoweb() Dim Success As Long Success = ShellExecute(0&, vbNullString, URL, vbNullString, 'C:', SW_SHOWNORMAL) End Sub Public Sub sendemail() Dim Success As Long Success = ShellExecute(0&, vbNullString, 'mailto:' & email, vbNullString, 'C:', SW_SHOWNORMAL) End Sub |
تاريخ الإضافة : |
20/3/2008 |
زيارات الصفحة : |
61 |
رابط ذو صلة : |
http://www.nwahy.com |
كاتب الموضوع : |
موقع نواحي |