Loading VB 6.0 requires that you load IE 4.72 which I did not want (but its ok to use). Some VB 6.0 programs that you write require that you distribute IE 4.72, otherwise, your programs won't work.
MainForm.Compare_Display_UIPicture.FontSize = Size
' Determine the height and width of a typical character
H1 = MainForm.Compare_Display_UIPicture.TextHeight("A")
W1 = MainForm.Compare_Display_UIPicture.TextWidth("A")
MainForm.Compare_Display_UIPicture.Width = 80 * W1
MainForm.Compare_Display_UIPicture.Height = 25 * H1
Re-sizing the form requires knowing information which is not available.
When internal objects are located at 0,0,
you need to know that 0,0 is really 40,300 or what ever.
(This may be my error, the object was not at 0,0 but I thought it was.)
VB has 34 base classes. Of these, 20 are UI controls, 7 are defined in Global (App, Clipboard, Forms, Licenses, Printer, Printers, Screen). The others are Form, MDIForm, Menu, PropertyPage, UserControl, UserDocument, VBControlExtender.
The PushKeys command is available for VB 5.0 and above only. This is the only reason I moved from VB 3.0 to VB 6.0. PushKeys works more than 100 times faster than the VB SendKeys command. However, the keystrokes appear to be queued until a DoEvents command is executed. Normally, this would not be a problem except that DoEvents stops the execution of the VB 6.0 application.
formSave = Screen.ActiveForm.Caption
AppActivate DOSAppName$ ' Transfers control to the DOS application
PushKeys DOS_ScreenCapture$ ' Send keys to the active (DOS) application
' The following 4 lines of code are not needed in VB 3.0,
' These are needed so that the clipboard will be available
For i = 1 To 10 ' I tried various values - 1, 10, 1000 -
' 1 failed, 10 work sometimes, 1000 hung
DoEvents ' Without this - Error - Can't Open Clipboard
Next i
AppActivate formSave ' Without this, DoEvents hangs the application
' The following code never fails in VB 3.0, is intermittent in VB 6.0
tt$ = Clipboard.GetText()
According to Microsoft, DoEvents returns control to the Visual Basic program after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent. The Sleep 32-bit API function is a subset of the DoEvents function.
When capturing the DOS screen using sendKeys, it is at least one thousand times slower than before (VB 3.0 is much faster than VB 6.0). Even the mouse hangs until to action is complete.
In order to continue a command on the next line, terminate the line with a space, underscore, enter. Both of the following should give the same result
Dim Msg ' Declare variable
Msg = "1st part of string "
Msg = Msg & "Next part of string "
Msg = Msg & "Last part of string"
Msg = "1st part of string " _
& "Next part of string " _
& "Last part of string"
CMDialog.Flags = OFN_FILEMUSTEXIST + OFN_HIDEREADONLYno longer hides the readonly checkbox. Instead, you must use
CMDialog.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly