Using Native WIN32 APIs in VB; A Message Box Example

Category:
ASP, HTML and XML
Type:
Modules
Difficulty:
Advanced
Author:
Timothy L Slater Jr.

Version Compatibility: Visual Basic 6

More information:
This module will allow you to create a MessageBox using the Native WIN32 API 'MessageBoxW'. The built in MsgBox() function of VB uses the Virtual Machine to create the messagebox, this is a proof of concept showing how it can be done. Using this routine will result in faster code. NOTE: It uses Pre-Compiled Assembler code. To test this, set a variable of type Long to the ntvMessageBox function, passing it the title and message as strings. Email me with questions.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: