Intersystem Concepts, Inc.
VB6 and the Surface Pro Tablet
Can your VB6-created program run under Windows 8 on Microsoft's Surface Pro tablet?
Yes, but Windows and/or the tablet have several quirks of which you should be aware.
VB6's main runtime library, the MSVBVM60.DLL, is included with Windows 8 so your
basic .EXE will run without the user installing that .DLL.
Mouse vs. Touch
In theory, a mouse-enabled program should work just as well with a touch screen,
but in reality there are several gotchas:
You might expect that when the user touches the tablet's screen a mouse down event
would occur, but that is NOT the case. Instead, touching the screen does not
immediately trigger any event whatsoever in your VB6 program. Events are triggered
only when the user either 1) stops touching the screen, or 2) moves his finger.
If the user stops touching (lifts his finger from the screen), your VB6 program will
see mouse down, mouse move, and mouse up events one immediately after the other.
If the user moves his finger, your VB6 program will see a mouse down and mouse move
There is no pure mouse move event with touch. If you program relies on the user
hovering the mouse cursor over objects, it will need redesign to handle touch.
One consequence of the lack of touch hover: ToolTipText never appears.
Note, however, the stylus Microsoft includes with the Surface Pro does simulate a
mouse hover: when the user moves the stylus close to the screen, mouse move events
will occur in your program without any mouse down events. Also, the stylus will
cause ToolTipText to show.
Since a simple touch lacks a left and right button, Windows simulates the button as follows:
a quick touch and release generates a left mouse click, a touch - hold - release generates
a right click. The touch-and-hold process feels a bit kludgey, so if your program makes
extensive use of right-clicking you may want to redesign it.
Pinch and Spread
Two-finger pinch and spread gestures are sent to your VB6 program as a sequence of Ctrl key down
followed by mouse wheel rotation, followed by (when the user lifts his funder) Ctrl key up.
If your program hooks into mouse wheel activity via the SetWindowLong API, it will see these pinch
and spread gestures.
Unfortunately, this process is quirky: usually but not always intermixed with the Ctrl
key down and mouse wheel actions will be mouse move events. The mouse move events send X and Y
coordinates that we have not yet been able to decipher.
Another quirky thing on the Surface Pro we have tested: if via the Windows Control Panel,
Appearance and Personalization, Display, the user employs "Change the size of all items" to enlarge
window content, Pinch and Spread send events to the VB6 program only if those gestures are performed
on the right side of the tablet's screen. For example, at a 200% size setting Pinch and Spread on
the left half generate no events. This is likely a Windows problem.
No other gestures, like flick, are transmitted to your VB6 program. Access to other gestures
appears to be via Windows 8 APIs which at this time are poorly documented.
A fingertip is much larger than a mouse cursor. When a user touches (and lifts) his finger
your VB6 program will see mouse activity at a single X-Y location that was somewhere under the
user's fingertip. This means precise pixel-by-pixel touching is not possible for the user.
In our tests an area of 16 pixels in diameter was about the smallest a person could
touch with a decent level of accuracy, but still resulted in many missed touches. If your
program relies on small areas to be clicked, it may need redesign to allow larger areas for
Fat Finger 2
As a user touches the screen, his finger obscures part of the display. If your program
displays important information where the user clicks his mouse, that information may be
hidden behind his finger during a touch. This could mean redesign.
Unless the user employs the stylus, no mouse cursor appears. If your program shows an
hourglass mouse cursor to tell the user to wait, note the hourglass will not be visible.
In our tests, no DragIcons have been visible. Drag-and-drop works, but no icon appears.
DragMode Automatic without a DragIcon specified has very sluggish performance, so slow as to be
virtually unusable since the tablet sometimes appeared to lock up.
Ctrl, Shift, F1, etc.
When operating purely as a tablet, the Surface Pro has no physical keyboard. If your
program requires specific keypresses, such as F1 to invoke Help, or Shift+click
combinations, it will need redesign.
If you use the Clipcursor API to limit the range of mouse cursor movement, beware of
some flakey possibilities. We have observed Clipcursor to fail spectacularly, resulting
in apparent cursor locations far outside the allowable area, even off the edge of the
display. Add programming to check the values returned by the API.
BitBlt and StretchBlt
The BitBlt and StretchBlt APIs appear to operate significantly faster than on any other
hardware or Windows version. This is nice, but can make animations that you have
not throttled via a timer to run too quickly.
Pull down menus appear at the left edge of the screen rather than beneath their
corresponding menu bar item.
The ToolWindow setting for a Form's BorderStyle yields a window with an
oversized caption, instead of the usual smaller caption.
Link: some guidelines from Microsoft
Other VB tips