|
Retriving ICMP statistics using GetIcmpStatistics API
|
Total Hit (2855) |
This code will show you use of GetIcmpStatistics API which can give you some important information regarding ICMP information.
Here is the sample output of this program
«code LangId=0»# Messages [in/out] : 9/11
# Error [in/out] : 0/0
# Redirects [in/out] : 0/0
# Echos [in/out] :
....Read More |
Rating
|
|
|
How to renew/release DHCP lease of a selected interface ?
|
Total Hit (6065) |
This article will show you how to use IP Helper APIs GetAdaptersInfo, GetInterfaceInfo, IPReleaseAddress and IPRenewAddress to list all available IPs and perform renew/release operation on a selected IP.
Before we see actual code lets quickly check the description of each API.
«b»GetAdaptersIn
....Read More |
Rating
|
|
|
How to Add/Remove NT user account programatically
|
Total Hit (5617) |
This article will show you use of NetUserAdd and NetUserDel API to add/remove useraccount.
Windows NT and Windows 2000 exposes LanMan 32-bit Application Programming Interfaces (APIs) to provide network services. These APIs are called only from 32-bit programs running on a Windows NT or Windows 20
....Read More |
Rating
|
|
|
How to Create Constants and DLL Declarations in a Type Library
|
Total Hit (1663) |
It can be very useful to package constant definitions and DLL declarations in a type Library. Visual Basic allows you to access type libraries and their contents. Once you have made a reference to the type library, you can view its information in Visual Basic's own Object Browser. Type Libraries are
....Read More |
Rating
|
|
|
How to Add/Remove NT group programatically
|
Total Hit (4100) |
This article will show you use of NetGroupAdd and NetGroupDel API to add/remove NT user group.
Windows NT and Windows 2000 exposes LanMan 32-bit Application Programming Interfaces (APIs) to provide network services. These APIs are called only from 32-bit programs running on a Windows NT or Window
....Read More |
Rating
|
|
|
|
|
Working with Resource file
|
Total Hit (5999) |
Resource file is embedded into you compiled exe, dll, ocx etc. You can store Icon, Cursor, AVI, GIF, Bitmap word document or any thing you want. VB provides few function to access application resource but these functions (LoadResData, LoadResPicture and LoadResString) not enough if you want more fle
....Read More |
Rating
|
|
|
Tray to Title and Title to Tray Effect using DrawAnimatedRects API
|
Total Hit (4445) |
This little snippet will give you an effect so it looks like that your window is flying from system tray or minimizing to system tray depending on which flag you pass to DrawAnimatedRects API.
Create a standard exe project and place the following code in form1 and run the project to see the effec
....Read More |
Rating
|
|
|
Printing using GDI printing APIs
|
Total Hit (3758) |
This sample code will show you how to perform basic print operations using GDI print APIs
- Create a standard exe project
- Add one command button control on the form1
- Add the following code in form1
«code LangId=1»Option Explicit
Private Declare Function StartDoc Lib "gdi32" Alias _
....Read More |
Rating
|
|
|
Creating an API Window (Using C Style Message Loop and Window Proc)
|
Total Hit (11156) |
Sometimes you might need to create a window using code on the fly. Many times I have been asked that why do I write this odd code to create a very simple form,I can use VB form instead of Dynamic C style window creation....
Now here is the answer
One common use of this technique in socket pro
....Read More |
Rating
|
|
|
|
Using LineDDA api to control each point of line.
|
Total Hit (3318) |
This small code snippet will show you the use of LineDDA api which is very useful when you want to control each point of line. LineDDA use a callback method which gives x and y cordinates of the point to be drawn.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add one module t
....Read More |
Rating
|
|
|
|
How to perform clipping using API
|
Total Hit (5678) |
To perform very complex clipping operations you can use a set of clipping APIs. From this sample code you will learn several techniques of clipping.
A clipping region is a region with edges that are either straight lines or curves. You can create simple or complex regions using various region API
....Read More |
Rating
|
|
|
Using GetPath and PolyDraw API to extract and draw path segments.
|
Total Hit (5609) |
GDI Paths are different than most of GDI objects. Path doesn't have handle but they always bound to device context. Path can be generated by calling BeginPath and EndPath API. Here the example how path can be generated.
«code LangId=1»BeginPath(Me.hDc)
'//....
'//Draw Lines
'//Draw Polygon
'/
....Read More |
Rating
|
|
|
clsEMF : A class to Create/Play/Save Enhanced Meta File (EMF).
|
Total Hit (6266) |
Internally, a metafile is an array of variable-length structures called metafile records. The first records in the metafile specify general information such as the resolution of the device on which the picture was created, the dimensions of the picture, and so on. The remaining records, which consti
....Read More |
Rating
|
|
|
Working with Meta Files (EMF,WMF and APM)
|
Total Hit (12337) |
A metafile is a mechanism for storing a graphics device interface (GDI) "picture"—a series of GDI functions that are used to draw an image. A metafile consists of a series of records, each representing a GDI function. When the metafile is played back, each stored function is executed using its recor
....Read More |
Rating
|
|
|
|
Extract and Play individual record stored in WMF/EMF file
|
Total Hit (7086) |
A metafile is a collection of structures that store a picture in a device-independent format. Device independence is the one feature that sets metafiles apart from bitmaps. Unlike a bitmap, a metafile guarantees device independence. There is a drawback to metafiles however, they are generally drawn
....Read More |
Rating
|
|
|
|
|
Mapping network share as a mapped drive using API
|
Total Hit (3855) |
«code LangId=1»Option Explicit
Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" ( _
ByVal lpszNetPath As String, _
ByVal lpszPassword As String, _
ByVal lpszLocalName As String) As Long
Private Sub MapDrive(share_name As String, Optional drive_
....Read More |
Rating
|
|
|
|
Rotating Image using PlgBlt API (Win 9x/ME not supported)
|
Total Hit (8360) |
- Create a standard exe project
- Place two picture box and one timer control onth form1
- Assign some image (relatively small image would do betetr) to Picture1.
- Add the following code in form1
«code LangId=1»Private Declare Function PlgBlt Lib "GDI32.dll" (ByVal hDCDest As Long, _
....Read More |
Rating
|
|
|
High quality image scaling
|
Total Hit (2806) |
Have you ever tried to use StretchBlt to resize image. Yep its easy to use with VB but if you use it without setting correct "Stretch Mode" it wont be a high quality image. To get high quality stretched image you can call SetStretchBltMode and set HALFTONE mode for highest quality image resizing. Fo
....Read More |
Rating
|
|
|
Performing FTP operation using WinInet APIs
|
Total Hit (12772) |
«b»Step-By-Step Demo«/b»
- Create a standard exe project.
- Add one module to the project.
- Add six textbox controls and nine command button controls on the form1. Set MultiLine=True and Scrollbar=Both for Text6.
- add two frame controls and add two radio button controls to each frame.
«b»
....Read More |
Rating
|
|
|
Update/Delete Bitmap and String resource using API at runtime
|
Total Hit (12213) |
A Resource File is a repository in executable file (exe/dll/ocx) where you can store images, sounds, videos, data, or whatever you like. VB provides addin to modify resource during design time but what if you want to modify it during runtime. Win32 API is the solution to this problem. There are 3 ma
....Read More |
Rating
|
|
|
How To Read/Write Data File Using ReadFile and WriteFile API
|
Total Hit (7964) |
The Win32 API allows binary files to be opened and written using the CreateFile, ReadFile, and WriteFile APIs. These functions offer increased flexibility to write and read from files. This article demonstrates a technique to write large amounts of data, in the form of a large array, to a binary fil
....Read More |
Rating
|
|
|