WWMoveViewWindow() allows the user to reposition the main window of WindowViewer from within a script function. This can be useful on systems with virtual desktops or multiple monitor configurations. This script function is not sensitive to the ‘title’ or ‘caption’ of your main WindowViewer™ window.
WWMoveViewWindow(Left, Top, Width, Height);
|Left||This is the desktop location of the left edge of the main view window once it is repositioned.|
|Top||This is the desktop location of the top edge of the main view window once it is repositioned.|
|Width||This is how wide the main view window should be once it is repositioned.|
|Height||This is how tall the main view window should be once it is repositioned.|
Returns an integer value. The return value is 1 to indicate that the call to SetWindowPos was successful. The return value is 0 indicate that the window probably was not repositioned as desired.
Installation of WWMoveViewWindow()
Download the WWMoveViewWindow.zip file. Unzip the file that you downloaded and move the files WWMovewViewWindow.Dll and WWMovewViewWindow.Wdf in the InTouch folder.
Example of Using WWMoveViewWindow()
Suppose you had a video card with two monitors configured to extend the windows desktop, and each monitor was configured to be 1024 pixels wide and 768 pixels high.
You could cover the desktop area displayed by the two monitors with the main WindowViewer window with some code similar to the following (within your Application Startup script):
iStatus = WWMoveViewWindow( 0, 0, 2048, 768 );
If many windows open at startup and a lot of activity is occurring when WindowViewer initializes, some customers have found the need to place the call into the Application Running script. The function is called one time after a few seconds delay.
If you add the function call to the Application Startup script, and then close WindowMaker, the window will resize when you run WidnowViewer.
If the fast switch is used and WindowMaker is still open when WindowViewer is starting, the WindowViewer main window will not resize and it will remain where the WindowMaker window was located.
If ‘Maximize WindowViewer’ Configuration Is Enabled
If your WindowViewer window is already configured to maximize at startup, it is recommended that the Always Maximize option be disabled if you are going to resize the main window by using this script function.
- Run WindowMaker™ and select Special/Configure from the main menu. Select WindowViewer from the sub-menu.
You should see a tabbed dialog box labeled WindowViewer Properties.
- Select the Window Configuration tab
- Ensure the Always Maximize check box under Miscellaneous labeled is NOT checked.
- Click OK, quit WindowMaker and try WindowViewer again.
Note: Disabling this button may have other effects on your application, so check your WindowViewer carefully if you change this option.
You might need to make further adjustments to the Window Configuration tab field options.
Probable Reasons For Failure
There are many reasons this function can fail and return a value of 0, and this list attempts to document some of them:
• WindowViewer is not currently running (tricky, but you might have called the function from another program, right?).
• The main WindowViewer window is not on the screen.
• The class name of the main WindowViewer window is no longer “WindowViewer”.