|
|
|
|
|
|
|
OverwriteHandler - A class for handling overwrite mode
|
Total Hit (2251) |
«Code LangId=1»'---------------------------------------------------------
' OverwriteHandler class
'
' you can associate this class to a form, using the
' Form property, and all the textbox controls in the
' form will support insert/overwrite mode switching
'
' Usage: Dim ov As New Overwrite
....Read More |
Rating
|
|
|
|
|
GetFileOwner - Get the owner of an NTFS file
|
Total Hit (5177) |
«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 (2429) |
«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
|
|
|
|
Determine memory usage
|
Total Hit (3984) |
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 (3040) |
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
|
|
|
Never mix SingleUse and MultiUse classes
|
Total Hit (2765) |
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 (2961) |
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
|
|
|
Load items faster in the TreeView and ListView controls
|
Total Hit (2598) |
There is an easy, but under-utilized, technique for loading many nodes in a TreeView control (or ListItems in a ListView control) that is faster than the standard technique. Consider this loop:
«Code LangId=1»
For i = 1 To 5000
TreeView1.Nodes.Add , , , "Node " & i
Next
«/Code»
Instea
....Read More |
Rating
|
|
|
Read and modify a TextBox control's formatting rectangle
|
Total Hit (3400) |
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 (3466) |
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
|
|
|
|
Undocumented Shell Path APIs (Combining and Constructing Path).
|
Total Hit (3125) |
Way back when Microsoft released Internet Explorer 4.0, they bundled with it a number of upgrades to the operating system including a new DLL called SHLWAPI.DLL (Shell Lightweight Utility APIs). That DLL provided programmers with some useful path manipulation functions (amongst other things), but ob
....Read More |
Rating
|
|
|
FillFlexGrid - Routine to fill flexgrid from ADO recordset
|
Total Hit (3594) |
The following routine takes 2 arguments, ADO recordset and flexgrid which you want to fill.
«code LangId=1»
Sub FillFlexgrid(rst As ADODB.Recordset, msfGrid As MSFlexGrid)
Dim cln As Field
With msfGrid
.Rows = 2
.Cols = rst.Fields.Count
'get the number of gri
....Read More |
Rating
|
|
|
How to take ownership of a file/folder ?
|
Total Hit (14998) |
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 use AnimateWindow API to animate form on Load/Unload events
|
Total Hit (7050) |
The AnimateWindow function enables you to produce special effects when showing or hiding windows. There are three types of animation: roll, slide, and alpha-blended fade.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add a new form called Form2 (Form1 is added by default)
- A
....Read More |
Rating
|
|
|
How to find Time Zone information on current system ?
|
Total Hit (3291) |
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
|
|
|
Path API Demo (BeginPath, EndPath, AbortPath)
|
Total Hit (4257) |
This is very simple demo to demonstrate how to use path API in grawing.
To learn more about path Please visit following URL
«a href='http://msdn.microsoft.com/library/en-us/gdi/paths_8acz.asp'»http://msdn.microsoft.com/library/en-us/gdi/paths_8acz.asp«/a»
«b»To implement Quick Demo, Copy/Past
....Read More |
Rating
|
|
|
Search for values in a FlexGrid control and sort it by columns
|
Total Hit (2285) |
To search for values, simply loop through the grid looking for the target value. Use the TopRow property to ensure that the row is visible after you find it.
To sort by columns, use the MouseRow property to see if the user clicked the control's column header. Use MouseCol to see which column was
....Read More |
Rating
|
|
|
|
End points of the connection
|
Total Hit (3376) |
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
|
|
|