RELNOTES.TXT File Release Notes file for ShowBasic Development Kit, Version 1.2 (C) Copyright MIKSoft, Inc. 1995 This document includes updated information for the documentation provided with ShowBasic Development Kit for Windows version 1.2. The information in this document describes the improvements and added features as compared to ShowBasic version 1.0 and 1.1. The main emphasis in ShowBasic version 1.2 was on the compatibility issues with Windows 95 and Windows NT operating systems. We feel that the nature of titles developed with ShowBasic requires them to be as much as possible independent of the version of Windows they are executed on. To achieve this goal ShowBasic now automatically detects the current operating system and tries to ensure that each function will behave consistently in the current environment. As there are major differences between Windows 3.1, Windows 95 and Windows NT - sometimes it is required to adjust the program's behavior depending on the current environment. WinInfoSystem() function allows to detect the environment and therefore to branch execution path depending on the detected system. The real preemptive multitasking is one of the major difference between the 32-bit Windows NT and 95 and 16-bit Windows 3.x. It might cause troubles during keyboard/mouse simulations, when as a result of this simulations the layout of the desktop changes, i.e. new windows appear on the screen or the active window changes. Consider the following example. Let's assume that we have Notepad and Write running, and we want to type the word "notes" into Notepad and then type "writing" into Write by simulating the series of keystrokes. In Windows 3.1 we can do it the following way: WinSetPosSizeState(WinLocate("Notepad"), NULL, SBC_WINACTIVE) Simulate("notes") WinSetPosSizeState(WinLocate("Write"), NULL, SBC_WINACTIVE) Simulate("writing") The above sequence will work OK on Windows 3.1, however it might not work in Windows NT and Windows 95. Why? In Windows 3.1 when we activate Write using WinSetPosSizeState() function, it is guaranteed that no other Windows application (including ShowBasic) will receive control until Write really becomes the active window. Therefore, when ShowBasic places keystrokes into the system queue, it is guaranteed that the "writing" keystrokes will be retrieved by Windows and played into Write. This is not true for 32-bit operating systems because of their preemptive multitasking nature. When activation request is passed to Windows, all other applications (including ShowBasic) continue to work, and the pending keystrokes are extracted from the system queue and played into the currently active window. While Windows executes request to make Write the active window, Notepad itself may remain the active window for some time - so the beginning of "write" keystrokes can go into Notepad instead of Write. If you experiment with this, you might not observe it, it depends on the computer, operating system parameters, etc. However it can happen. How to cure this? You can apply some delay between windows activations to ensure that the required window gets activated. For example, WinSetPosSizeState(WinLocate("Notepad"), NULL, SBC_WINACTIVE) Simulate("notes") sleep 2 WinSetPosSizeState(WinLocate("Write"), NULL, SBC_WINACTIVE) Simulate("writing") This is not a very reliable solution. What if 2 seconds is not enough for another window to activate? It would be better to have a function that really waits until the required window gets active. We've introduced such function in version 1.2 - WinActivate(). It allows not only to pass the activation request but also to delay the following script execution until the requested window gets active and ready to receive the keystrokes. Using this function our sample can be modified to look like this: If WinActivate("Notepad", "", 2) <> 0 Then Simulate("notes") Endif If WinActivate("Write", "", 2) <> 0 Then Simulate("writing") Endif The last parameter (2) is an optional time-out for the WinActivate() to ensure that the required window is really active already. It will wait for activation no longer than 2 seconds (in our example). Check the ShowBasic Reference for further details. What's new? =========== - WinActivate() function; - WinLocate(), WinLocateChild(), WinClickControl(), WinControlState() functions can have an optional parameter that restricts the search among the windows created by a particular module; - DECLARE32 statement, and the ability to call functions in 32-bit DLLs; - New TBUSER32.DLL, and the ability to control ShowBasic from 32-bit programs; - '$INCLUDE metacommand; - ALIAS keyword can be used in Declare or Declare32 statements; - {XThenY} {YThenX} {XAndY} {Tick x} codes added to Simulate function; - System variable SBV_SIMWINDOW and constants SBC_SIM_NONE, SBC_SIM_VISIBLE, SBC_SIM_ACTIVE. SBV_SIMWINDOW system variable allows to control window activation during the simulations.(See Simulate() function); - Added PRAGMA DOUBLEDECLARATION ON|OFF and PRAGMA SEGMENT xx statements ( see Interpret() function); - Constant SBC_NOCLICK (to already existing SBC_CLICK and SBC_DOUBLECLICK) for WinClickxxx() functions; - 32-bit Recorder for Windows NT and Windows 95 is included, it allows to record events for 32-bit applications; - a very helpful Fatbits utility is included (freeware by John Ridges); What's changed? =============== There are many improvements in functionality, but most of them are "invisible". Some noticeable changes are: - WinClickMenuXXX functions now ensure that mouse movements occur only vertically/horizontally. Direct mouse movement from point to point could result in a wrong menu selection in Windows 95 (because of the new way the menus are selected with the mouse in this system). - The size of the P-code has been significantly optimized; you can expect you BEX files to become 30%-50% smaller. - If the first parameter of the WinLocateChild() function is NULL, it will search not only the currently active window, but also all other windows in order to locate the child with the given caption/ID and/or class. - ShowBasic Compactor, Recorder and ShowBasic IDE are improved; Known limitations ================= For both Windows NT and Windows 95: - Exclusive() subroutine works only for the 16-bit environment, i.e. it doesn't stop the 32-bit applications running at the same time. For Windows 95: - Color of the text on dialog box buttons cannot be changed; For Windows NT: - flags SBC_IGNOREALLINPUT, SBC_IGNOREWATCHEDINPUT and SBC_ACCEPTWATCHEDINPUT are not supported for the WaitInput() function; - WaitWinActive(), WaitWinClose(), WaitWinFocus(), WaitWinWndMsg() functions support only events in the 16-bit applications; - EnableInput() is not supported; - PlayTune() is not supported.