Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips
Tip Bank > Visual Basic > Windows > Windows APIs

Windows APIs - Page 2

21-40 of 228     Previous     Next
Cut, Copy, Paste, and Undo For Textboxes
by Reuben Cleetus
Many programmers use Visual Basic's Clipboard object to perform Cutting, Copying, Pasting and Undoing code. For example, to copy some text from a textbox, programmers sometimes use the following ...
Use a VB Label as a Web Link
by Yiming Sun
I like the idea of clicking on a VB label that looks like a Web anchor and pops up the Web browser pointing the user to the page. Here is how I would implement ...
Select a row in a listivew by clicking anywhere on that row
by Alex Whyte
This allows a user to select a row in a listivew by clicking anywhere on that row.
GetPrimaryDCName
by DevX Pro
I'm trying to get the PDC name for a domain on my network using the following code. It works fine within the VB IDE, but the moment I compile it and run it as an executable, it errors out with either NERR_DCNotFound(2453): Could not find domain controller for this domain or ERROR_BAD_NETPATH(53): The network path was not found Any idea what's going wrong? Here's my code: Private Declare Function NetGetDCName Lib "NETAPI32.DLL" _ (ServerName As Byte, DomainName As Byte, DCName As Long) As Long Private Declare Function lstrcpyW Lib _ "kernel32.dll" (bRet As Byte, ByVal _ lPtr As Long) As Long Private Declare Function NetApiBufferFree Lib _ "Netapi32" (ByVal pBuffer As Long) As Long Public Function GetPrimaryDCName(ByVal DName As String) As String Dim DCName As String, DCNPtr As Long Dim DNArray() As Byte, DCNArray(100) As Byte Dim result As Long DNArray = DName & vbNullChar result = NetGetDCName(0&, DNArray(0), DCNPtr) If result 0 Then Err.Raise vbObjectError + 4000, "CNetworkInfo", result Exit Function End If lstrcpyW DCNArray(0), DCNPtr result = NetApiBufferFree(DCNPtr) DCName = DCNArray() GetPrimaryDCName = Left(DCName, InStr(DCName, Chr(0)) - 1) End Function
NetUserGetInfo - API Call
by DevX Pro
I am using "NetUserGetInfo" API call to get the NT user profile. I use: typedef struct _USER_INFO_3 How can I parse the "usri3_flags" member in detail?
API Registry Calls
by DevX Pro
I have code in Visual Basic that allows a user to search the Registry and return a value from the passed key and path. Can you show me a simple way of implementing this in Visual FoxPro?
Delete a User in NT
by DevX Pro
How do I delete a user in NT with the API's?
Peek - Read a value of any type from memory
by Francesco Balena
read a value of any type from memory
PeekB, PeekI, PeekL - Read a byte, integer or long from memory
by Francesco Balena
read a byte from memory
Poke - Write a value of any type into memory
by Francesco Balena
write a value of any type in memory The value is written in the format of the value passed as the second argument, but you can overwrite it by passing an explicit data type in the third argument (this is the only way to store a value as a 16-byte Variant) This routine doesn't support ...
PokeB, PokeI, PokeL - Write a byte, integer or long value into memory
by Francesco Balena
write a byte into memory
StringFromAddr - Read a string at a given address
by Francesco Balena
retrieve a string at a given address if LENGTH < 0 the string is considered to be null-terminated and the function determines its length
StringFromBSTR - Convert a BSTR to a VB string
by Francesco Balena
convert a BSTR into a VB String
Get Server Time at Workstation
by DevX Pro
We want to timestamp transactions on an application that is not yet using a client/server database. Is there a Windows 2000 API that programmatically gets the server time?
Determine the Correct Screen Dimensions
by Matt Hart
The latest video drivers can change the display resolution without rebooting. Unfortunately, the Screen object doesn't always properly return the new display size; it only remembers the display size ...
Prevent Duplicate Listbox Entries
by Kedar Sathe
This useful code listing prevents users from entering duplicate entries into a listbox or modifying existing listbox entries. While the code prevents users from adding duplicate entries, you can ...
Send a Click Message
by Marc Boorshtein
Recently, I turned to Windows messaging to manipulate certain dialogs by simulating button clicks programmatically. I looked through my API references and found only the WM_LBUTTONDOWN and ...
Use Screen-Saver Passwords
by Marco Bellinaso
When you write a screen saver in C and the Windows SDK, a static library (SCRNSAVE.lib) allows you to create custom dialogs to change and request the password. But in VB you can't use this library. ...
Account for Taskbars When Centering Forms
by Konstantin Komissarchik
Most VB programmers must display a form centered on a screen. You can do this in a variety of ways, but most ignore aspects of the environment such as the taskbar or the office launchbar. This ...
Use System Icons for MsgBox Look-alikes
by Thomas Weiss
When VB's MsgBox function doesn't provide everything you need, you have to create a message-box
21-40 of 228     Previous     Next
Sitemap