|
|
|
|
|
|
|
|
GetFileOwner - Get the owner of an NTFS file
|
Total Hit (5280) |
«Code LangId=1»Private Declare Function GetFileSecurity Lib "advapi32.dll" Alias _
"GetFileSecurityA" (ByVal lpFileName As String, ByVal RequestedInformation _
As Long, pSecurityDescriptor As Byte, ByVal nLength As Long, _
lpnLengthNeeded As Long) As Long
Private Declare Function Ge
....Read More |
Rating
|
|
|
WriteToStdOutput - Write to standard output stream
|
Total Hit (2534) |
«Code LangId=1»
Option Explicit
Private Declare Function GetStdHandle Lib "kernel32" (ByVal nStdHandle As Long) _
As Long
Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, _
lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, _
lpNumberOfBytesWritten As L
....Read More |
Rating
|
|
|
|
|
ShiftLeft - Shift a Long to the left
|
Total Hit (1614) |
«Code LangId=1»' Shift to the left of the specified number of times
'
' NOTE: requires Power2()
Function ShiftLeft(ByVal value As Long, ByVal times As Long) As Long
' we need to create a mask of 1's corresponding to the
' times in VALUE that will be retained in the result
Dim mas
....Read More |
Rating
|
|
|
Determine memory usage
|
Total Hit (4119) |
The GlobalMemoryStatus API function returns detailed information about the current load on the physical and virtual memory. You can use the following code to display the current amount of free memory:
«Code LangId=1»
Dim ms As MEMORYSTATUS
Dim msg As String
' query for memory
....Read More |
Rating
|
|
|
Export DAO databases to any ISAM format
|
Total Hit (3121) |
Everyone tells you how to import, but even MS-VB techs start coughing when you ask how to export with DAO! In fact, their own documentation clearly states that it can not be done (see the note on page 314 of Jet Database Engine Programmer's Guide's "Creating an External Table").
To that statemen
....Read More |
Rating
|
|
|
Determine whether the IDE is in design, break, or run mode
|
Total Hit (2283) |
The VBIDE object model doesn't offer any native property or method to determine whether the IDE is in design-time mode, run-time mode, or debug (break) mode. However, it's easy to deduct this information by looking at the Enabled property of the menu commands in the Run top-level menu:
«Code Lang
....Read More |
Rating
|
|
|
Never mix SingleUse and MultiUse classes
|
Total Hit (2874) |
ActiveX components written in VB can contain both SingleUse and MultiUse classes at the same time. It usually isn't a good idea to use both types of classes in the same project, however.
When a client creates an instance of a SingleUse class, COM always runs a new instance of the EXE file that ex
....Read More |
Rating
|
|
|
Friend Procedures are faster than Public ones
|
Total Hit (3073) |
It might surprise you to learn that Friend procedures are sensibly faster than Public ones. You can prove this yourself by creating an ActiveX EXE project with one Private class and one Public class (Instancing = MultiUse), and then add the following code in both class modules:
«Code LangId=1»
P
....Read More |
Rating
|
|
|
Read and modify a TextBox control's formatting rectangle
|
Total Hit (3491) |
By sending appropriate messages to a multi-line TextBox control you can read and modify its formatting rectangle - that is, the inner portion of the control where the user can type. Modifying the size and position of this area can be useful, for example, to leave a left margin where you can add line
....Read More |
Rating
|
|
|
Enable and Disable all or part of a scrollbar
|
Total Hit (3581) |
The new FlatScrollbar controls expose the ability to selectively disable their arrows. This is useful, for example, when the thumb indicator is at its minimum or maximum:
«Code LangId=1»
Private Sub FlatScrollBar1_Change()
If FlatScrollBar1.Value = FlatScrollBar1.Min Then
FlatScrol
....Read More |
Rating
|
|
|
|
Enumerating all available Clipboard formats
|
Total Hit (8139) |
Sometimes in your application you might want to check if any Clipboard data available and if available then in which format. You can check format of clipboard data and you can enable/disable menu options based on available clipboard data formats. For example in timer event you can check for CF_BITMA
....Read More |
Rating
|
|
|
How to take ownership of a file/folder ?
|
Total Hit (15303) |
This sample article will show you how to get owner of a file/folder and how to take ownership of a file/folder?
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add one module
- Add one textbox and one command button on the form1
- Add one ListView control on the form1. To add
....Read More |
Rating
|
|
|
How to find Time Zone information on current system ?
|
Total Hit (3398) |
The following code will extract the timezone information from your system. It includes three functions. One returns the current date/time in UTC (or ZULU or GMT) time, the next returns the offset of your time zone from GMT in minutes (divide by 60 to get hours), and the last returns the name of the
....Read More |
Rating
|
|
|
|
End points of the connection
|
Total Hit (3519) |
This part of the tutorial series is about how to use the getpeername and getsockname Winsock API functions in Visual Basic in order to determine parameters of the TCP connection's end-points.
|
Rating
|
|
|
|
|
ListView Demo 3 - Adding Sorting Functionality
|
Total Hit (1096) |
This page adds a popup menu and the routines necessary to sort and change list views.
When the demo is completed, the final app will retrieve the users selection and populate the listview with selected files from that folder, complete with associated icons, file name, file type, file size and cre
....Read More |
Rating
|
|
|
|