|
|
|
|
How to read value from remote registry ?
|
Total Hit (3589) |
This article explains how to use a Visual Basic application to access the registry on a remote computer in conjunction with the Windows application programming interface (API).
«B»Requirements«/B»
You need the following hardware and software to perform the procedures in this article:
A Micro
....Read More |
Rating
|
|
|
|
|
ConcatenateFiles - Merge multiple text files in one
|
Total Hit (3033) |
«Code LangId=1»
' Concatenate a variable number of text files into a single result file
'
' Params:
' - ResultFile: the complete path of the result file you want to create
' - Separator: a string that is written when a file is added to the result
' file.
' Note: this string can conta
....Read More |
Rating
|
|
|
Atn2 - Arc tangent of Y/X
|
Total Hit (3388) |
«Code LangId=1»' arc tangent of Y/X - returns values in all four quadrants
Function Atn2(x As Double, y As Double) As Double
If x = 0 Then
Atn2 = Sgn(y) * 1.5707963267949
ElseIf x > 0 Then
Atn2 = Atn(y / x)
Else
Atn2 = Atn(y / x) + 3.14159265358979 * Sgn
....Read More |
Rating
|
|
|
Check whether RAS is installed
|
Total Hit (3119) |
When you work with RAS APIs, you should have to make sure if RAS library is installed on the system. A simple way is to verify the existence of the Rasapi32.dll file in the windows system directory; the same thing can be obtained with a call to the InternetGetConnectedState API, as the following cod
....Read More |
Rating
|
|
|
Create a System Tray icon
|
Total Hit (4907) |
Sometimes is useful to add an icon in the Window taskbar's status area (a.k.a. System Tray), to gain a better interaction between the user and your application. The only API you have to use is Shell_NotifyIcon:
Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" _
(ByV
....Read More |
Rating
|
|
|
Read and write File ODBC data sources
|
Total Hit (4292) |
A file DSN is nothing but a text file that contains all the parameters for an ODBC connection. To prove this, just go to the default directory that holds all File DSNs (this is the \Program Files\Common Files\ODBC\Data Sources directory on Windows's boot drive) and load any .dsn file into a text edi
....Read More |
Rating
|
|
|
Understanding interface marshaling
|
Total Hit (3596) |
There is quite a lot of misunderstanding among COM newbies about what really happens when a COM interface is passed as a method parameter. As in most of the cases, VB programmers are protected from a lot of details on the COM run-time, but you do have to know such details if you want to assemble som
....Read More |
Rating
|
|
|
|
Fill a TreeView control with random data
|
Total Hit (2159) |
Every now and then you need to fill a TreeView control with some random data, for example when you want to test a routine and you don't want to write a lot of code just for this secondary task. Here is a recursive routine that does the work for you:
«Code LangId=1»
' MaxChildren is the max num
....Read More |
Rating
|
|
|
Limit the length of an item in a ListView control
|
Total Hit (3723) |
The ListView control doesn't expose any property that lets you limit the amount of text users can type when editing an item's label. However, you can do the trick with a couple of SendMessage API calls from within the BeforeLabelEdit event: with the LVM_GETEDITCONTROL message you retrieve the handle
....Read More |
Rating
|
|
|
The "Assume No Aliasing" compiler option
|
Total Hit (2893) |
A procedure is said to contain aliased values if it can refer to the same memory addresses in two or more distinct ways. A typical example is the following procedure:
«Code LangId=1»
Dim g_GlobalVariable As Long
...
Sub ProcWithAliases(x As Long)
x = x + 1
g_GlobalVariable = g_GlobalV
....Read More |
Rating
|
|
|
|
|
Working with AVI Files - Part 2 (Working with AVI streams)
|
Total Hit (16629) |
In previous Article «b»«a href='CodeDetail.aspx?Codeid=3612'»Working with AVI Files - Part 1 (Opening and Closing AVI file)«/a»«/b» We learned how to open and close AVI File. We also learned How to read AVI file information using AVIFileInfo api. In this article we will go one step further. Today we
....Read More |
Rating
|
|
|
Use CopyMemory api for performance.
|
Total Hit (4462) |
This article will demonstrate that how CopyMemory can boost the performance of for some simple operations (e.g string append.). Here we will banchmark VB Mid function vs CopyMemory Api.
|
Rating
|
|
|
How to set NTFS permission programatically using Security APIs
|
Total Hit (5326) |
Using security APIs you can set NTFS permissions in more technical term you can change ACL (Access Control List) for a user.
Here for demo purpose I have created a user called "tejuwala" and I have created a folder c:\test and two files c:\test\file_a.txt and c:\file_b.txt . User tejuwala dont ha
....Read More |
Rating
|
|
|
|
|
|
Using CopyFileEx and Callbacks as a File Backup Mechanism
|
Total Hit (1316) |
So that's how you do it!" This demo shows how to add a callback to the CopyFileEx API that returns the progress of a copying routine. But there is a catch ... CopyFileEx is only available on real operating systems - AKA Windows NT.
|
Rating
|
|
|
|
Hue Luminance and Saturation (HLS) Model and Manipulating Colours
|
Total Hit (679) |
Normally in computers colours are described in terms of their Red, Green and Blue components. Whilst you can specify all displayable colours this way, it leaves something to be desired when it comes to picking a colour. For example, most people find it very difficult to determine what RGB values you
....Read More |
Rating
|
|
|
SGrid 2.0
|
Total Hit (3160) |
SGrid 2.0 is an updated version of the popular SGrid control which adds drag-drop hierarchical grouping, owner-draw cells and many other features. It has the same highly-optimised display code but is now further enhanced by much better sort, row insert and delete performance. It remains a great alte
....Read More |
Rating
|
|
|
Panel Selector Control
|
Total Hit (2451) |
This article provides a regional selection control which can be floated over other controls to provide additional options for the selected item. The demonstration then shows how to use the control in conjunction with SGrid 2.0 in hot-tracking mode to provide an interface similar to the lists in the
....Read More |
Rating
|
|
|