|
|
|
|
|
|
|
|
|
ReadFromStdInput - Read from standard input stream
|
Total Hit (3452) |
«Code LangId=1»Private Declare Function GetStdHandle Lib "kernel32" (ByVal nStdHandle As Long) _
As Long
Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, _
lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, _
lpNumberOfBytesRead As Long, lpOverlapped As Any)
....Read More |
Rating
|
|
|
NdxShellSort -Sort Indexed Arrays using ShellSort
|
Total Hit (2759) |
«Code LangId=1»' Indexed ShellSort of an array of any type
'
' Indexed Sorts are sort procedures that sort an index array
' instead of the main array. You can then list the items in
' sorted member by simply scanning the index, as in
' For i = 1 To numEls: Print arr(ndx(i)): Next
'
' NUMEL
....Read More |
Rating
|
|
|
NumberToWords - Convert a number into its string representation
|
Total Hit (1855) |
«Code LangId=1»
' Convert a number into its textual equivalent.
'
' Pass True in the second argument if you want a null string when
' zero is passed.
' This is a recursive routine that is probably the most concise
' routines that solves the problem
Function NumberToWords(ByVal Number As L
....Read More |
Rating
|
|
|
EncryptString - Encode and decode a string
|
Total Hit (3172) |
«Code LangId=1»
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)
' encrypt a string using a password
'
' you must reapply the same function (and same password) on
' the encrypted string to obtain the original, non-enc
....Read More |
Rating
|
|
|
MK? And CV? - Convert numbers to strings and back
|
Total Hit (3060) |
«Code LangId=1»
' This group of routines convert a numeric value into a string
' that contain the internal representation of the number.
' They can be useful when converting outdated QuickBasic programs,
' because that language supported these functions that were
' never ported to Visual Basic
....Read More |
Rating
|
|
|
Misconceptions on variables and binding
|
Total Hit (1800) |
Consider this line of code:
Dim x as Project1.Class1
Many developers think that we were declaring x as a "Project1.Class1" object. This is wrong. All object variables in VB are interface variables. In this line of code x is declared as the _Class1 interface defined in the Project1 Type librar
....Read More |
Rating
|
|
|
Check whether the user is working off-line
|
Total Hit (3376) |
Internet Explorer offers the possibility to simulate an Internet connection with the off-line mode. If you want to know if off-line mode is on or off you can use InternetQueryOption API.
«Code LangId=1»
Const INTERNET_OPTION_CONNECTED_STATE = 50
Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10
....Read More |
Rating
|
|
|
Play an AVI movie in a PictureBox control
|
Total Hit (5251) |
With MCI functions you can play an AVI movie into a PictureBox. All you need to do is open the file with a special procedure:
«Code LangId=1»
Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal _
lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uR
....Read More |
Rating
|
|
|
Add an horizontal scrollbar to a ListBox control
|
Total Hit (4732) |
By default, VB ListBox controls don't display an horizontal scrollbar, so if the items you add to the controls are wider than the control's Width, the end user isn't able to read them in their entirety.
Adding an horizontal scrollbar to a ListBox control is easy, however. You only have to increas
....Read More |
Rating
|
|
|
Add a file to the list of recent documents
|
Total Hit (2919) |
To add a file to the "Recents" folder, you just need a single API function: SHAddToRecentDocs. This function takes two parameters. The first is SHARD_PATH if you want to refer to the file with its path string, while is SHARD_PIDL if you use its identifier. The second is the path string of the file,
....Read More |
Rating
|
|
|
Avoid Integer Overflow
|
Total Hit (2875) |
When working with integer expressions there is often the risk of raising the "Overflow" error. More specifically, there can be two occasions when this frequently occurs:
When you multiply or add Integer values and the result exceeds 32,767.
When you create generic string routines that iterate
....Read More |
Rating
|
|
|
|
WMI : Retrive extended information about processor
|
Total Hit (3224) |
Windows Management Instrumentation (WMI) makes Windows extremely manageable using a single consistent, standards-based, extensible and object-orientated interface. WMI is the Microsoft implementation of Web-Based Enterprise Management (WBEM), an industry initiative to develop a standard technology f
....Read More |
Rating
|
|
|
Redirect command line output to textbox using CreatePipe API
|
Total Hit (16361) |
This example illustrates a Visual Basic application starting another process with the purpose of redirecting that process's standard IO handles. The Visual Basic application redirects the created process's standard output handle to an anonymous pipe, then proceeds to read the output through the pipe
....Read More |
Rating
|
|
|
|
|
Developing Client-Server Applications with MS Winsock Control
|
Total Hit (2201) |
In this article, I am going to show how to use the Winsock in a client server environment, we will create two separate applications, one of which will be a server and the other will be a client. Both client and server will interact with each other to exchange data. Client will send a request to the
....Read More |
Rating
|
|
|
How to Add Images to a ListView Header
|
Total Hit (923) |
In most Windows applications, a visual indication of the sorting direction of the currently active listview column header is indicated by an up or down arrow. This functionality has previously been unavailable to the Visual Basic developer. The method detailed here demonstrates the steps to add your
....Read More |
Rating
|
|
|
System Internet Connection - Determining How and If Connected
|
Total Hit (2502) |
If you are designing a project which can use an Internet connection, it can be useful to know whether the system is connected or not. There are various methods of doing this, however the most informative and reliable method is to use the WinInet.DLL InternetGetConnectedStateEx API call. The only pro
....Read More |
Rating
|
|
|
Perlin Noise
|
Total Hit (1579) |
Perlin Noise, named after its inventor Ken Perlin, is a widely used texturing primitive in two- and three- dimensional image creation. The Perlin Noise function generates a smoothly interpolated space of pseudo-random values which can be used as the basis for the procedural generation of realistic n
....Read More |
Rating
|
|
|
|
Using the Find and Replace Common Dialogs
|
Total Hit (2672) |
VB has never provided direct support for the Find/Replace common dialogs. This may have been because these dialogs are non-modal, and it is more difficult to use these from an ActiveX control container, or that it is fairly simple to knock up your own Find/Replace form in VB without bothering with t
....Read More |
Rating
|
|