|
Interprocess communication using DDE (Dynamic Data Exchange) - Part1
|
Total Hit (16238) |
Microsoft Windows provides several methods for transferring data between applications. One method is to use the Dynamic Data Exchange (DDE) protocol. The DDE protocol is a set of messages and guidelines. It sends messages between applications that share data and uses shared memory to exchange data b
....Read More |
Rating
|
|
|
How to Write Multiple String to Windows NT EventLog ?
|
Total Hit (3263) |
This example code will show you how to write to EventLog. If you have defined Message with multiple parameter substitutions then you have to pass pointer to array of string pointers....!!! Sounds little complicate huhhhhh.. Lets see actual code to clear this confusion.
Note : Before you write to
....Read More |
Rating
|
|
|
Retrive and set Auxiliary devices volume info.
|
Total Hit (3675) |
This code will loop through all Aux devices and set volume to 50%. You might have problem under NT/Win 2000 using auxXXXXXX APIs. Microsft recommands to use mixerXXXXX APIs. auxXXXXXX APIs are old school APIs. But for example purpose we have used auxXXXXXX APIs here.
«code LangId=1»Private Const
....Read More |
Rating
|
|
|
Tunnel graphical effect
|
Total Hit (1735) |
Usage
«Code LangId=1»
'Create a Form and place this code inside
'Sorry but the comments are in german :((
Option Explicit
Dim offx% ' x-offset zur mitte
Dim offy% ' y-offset zur mitte
Dim anz% ' anzahl sterne
Dim bahnx%(100, 180)
....Read More |
Rating
|
|
|
|
|
|
|
|
BinToDec - Convert from binary to decimal
|
Total Hit (4015) |
«Code LangId=1»' convert from binary to decimal
'
Function BinToDec(value As String) As Long
Dim result As Long, i As Integer, exponent As Integer
For i = Len(value) To 1 Step -1
Select Case Asc(Mid$(value, i, 1))
Case 48 ' "0", do nothing
Case 4
....Read More |
Rating
|
|
|
Any2Dec - Convert from any numeric base to decimal
|
Total Hit (3242) |
«Code LangId=1»' convert from any base to decimal
' BASE can be in the range 2-36
Function Any2Dec(ByVal otherBaseNumber As String, ByVal base As Integer) As Long
Dim index As Long
Dim digits As String
Dim digitValue As Long
' check base
If base < 2 Or base > 36 T
....Read More |
Rating
|
|
|
Check whether a serial or parallel port is available
|
Total Hit (2895) |
The Open statement also supports special device names such as COM1 or LPT2. You can build on this feature and use the Open command to test whether a given serial or parallel port is available. Here are two functions that perform this task:
«Code LangId=1»
' Check whether a given COM serial port
....Read More |
Rating
|
|
|
Determine the Windows version (without any API call)
|
Total Hit (3141) |
You can use the GetVersion or GetVersionEx API functions to determine which Windows version the application is running on. However, there is a much simpler solution, based on the fact that Windows NT creates an environment variable named "OS" while Windows 95/98 don't. So you can quickly discern bet
....Read More |
Rating
|
|
|
Copy the contents of the WebBrowser control to the Clipboard
|
Total Hit (7364) |
To programmatically copy text from the WebBrowser control you can use its ExecWB method, to which you must pass the OLECMDID_COPY constant as its first argument.
WebBrowser1.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT
You can also select the entire WebBrowser's contents by invoking the Exec
....Read More |
Rating
|
|
|
Get or Set the height of TreeView nodes
|
Total Hit (3851) |
In plain VB there is no way to determine or change the height of node elements in a TreeView control. All you need to accomplish both tasks, however, is send the right message to the control.
«Code LangId=1»
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
hW
....Read More |
Rating
|
|
|
Logging under a different name makes your add-ins disappear
|
Total Hit (2153) |
After you install Visual Basic and log on to the machine as a different user (with or without administrator privileges), you cannot see any Add-Ins in the Add-In dialog in Visual Basic.
I ran across this problem when I logged in and installed VB6 on NT Workstation under my User, for a developer
....Read More |
Rating
|
|
|
Static Variables are slower than Dynamic ones
|
Total Hit (3846) |
Referencing a static local variable in a procedure is 2-3 times slower than a regular local, dynamic variable; if you want to really speed up your procedures, convert all static variables into module-level variables.
The only drawback to this approach is that the procedure become less self-conta
....Read More |
Rating
|
|
|
Five Tips for the Microsoft Office XP Web Components
|
Total Hit (1627) |
Discover how you can retain the original format of the numbers in a PivotTable component, determine which version of the Office Web Components you have, and more. This article provides the sample code that you can use in you own applications which use the Office XP Web components.
«b»Contents«/b»
....Read More |
Rating
|
|
|
Changing File and/or Folder Attributes Recursively
|
Total Hit (1329) |
The basic recursion techniques from Performing Recursive Searches Using FindFirst and SearchTreeForFile are used in this demo, but modified to include code for changing either the file, folders or both beneath the target directory specified. The code returns to the list all files processed, as well
....Read More |
Rating
|
|
|
Using the ChooseColor Common Dialog API
|
Total Hit (1413) |
Although the API uses a structure to pass parameters to the ChooseColor API, the dialog can be shown by providing just the flags, hwndOwner, lStructSize and lpCustColors members completed. Other options, such as a hook, can be added to provide additional functionality such as positioning, custom cap
....Read More |
Rating
|
|
|
How to Automatically Select (Track) a ListView Item
|
Total Hit (1353) |
By setting a ListView extended style bit using the API SendMessage with the message LVS_EX_TRACKSELECT, the ListView action changes. While a cursor is moving over the listview items, it is highlighted in coloured text (look at the line below the selection in the illustration.) If the cursor remains
....Read More |
Rating
|
|
|
Pre-selecting a Folder using the Browse Callback
|
Total Hit (1392) |
Add a callback routine to your VB5/6 code to allow pre-selecting of a file system object when displaying the Browse for Folders dialog. Added version-detecting code and necessary changes to allow the String method to function on NT
|
Rating
|
|
|
Enumerating Windows Fonts with Preview
|
Total Hit (1221) |
This is the code required to enumerate the system fonts into a listbox using a callback routine, and provide a sizeable preview of the font selected.
|
Rating
|
|
|
Implementing Unsigned Right and Left Shift Operators
|
Total Hit (1270) |
When translating C code to VB, often you come across the Right Shift and Left Shift operators ( << and >> respectively ). There is no inbuilt support for Right and Left Shift in VB, so you have to code your own. One of the main problems with replacing these functions is that C code often uses them i
....Read More |
Rating
|
|
|
PopupMenu - Context Menu Demonstration
|
Total Hit (1400) |
All Windows controls provide a facility to show context menus when the user right clicks on the control through the WM_CONTEXTMENU message. VB doesn't provide a way to interact with this message however, so if you want to replace the default context menu on a TextBox, or to provide a custom context
....Read More |
Rating
|
|
|
Splitting the Easy Way
|
Total Hit (1490) |
The EasySplitter class provided with this download completely automates most of the tasks involved with setting up a split between two objects. All you need to do is tell it which two objects you want to split and which direction to split and it does the rest.
....Read More |
Rating
|
|
|
Complete Registry control
|
Total Hit (2079) |
The cRegistry class is an easy, self-contained way to get complete access to the Windows registry. Simple methods allow you to create, enumerate and delete keys and values in the registry, without restriction. You can even read/write binary data to the registry. To see how powerful this library is,
....Read More |
Rating
|
|
|
How to create folder on remote machine using WMI
|
Total Hit (1080) |
Hey, AN. Life is full of mysteries. To name one, what possessed somebody to think that the world was clamoring for Clamato juice, an unholy concoction combining tomato juice and clam juice? (As long as we’re on the subject: clam juice?) To name another, why is it that neither the FileSystemObject no
....Read More |
Rating
|
|
|
How To Use ADO with Excel Data from Visual Basic or VBA
|
Total Hit (1018) |
This article discusses the use of ActiveX Data Objects (ADO) with Microsoft Excel spreadsheets as a data source. The article also highlights syntax issues and limitations specific to Excel. This article does not discuss OLAP or PivotTable technologies or other specialized uses of Excel data.
....Read More |
Rating
|
|
|