GetWindowHandle Example

InstallShield 2016 ยป InstallScript Language Reference

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the GetWindowHandle function.

*

* This script starts the setup in a normal window.  After three

* seconds, the window is minimized.  Then after another pause,

* the window is maximized and a message box is displayed.

*

\*--------------------------------------------------------------*/

 

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

 

export prototype ExFn_GetWindowHandle(HWND);

 

function ExFn_GetWindowHandle(hMSI)

    NUMBER nHwnd;

    HWND hInstallHwnd;

begin

 

    // Specify a standard window for this setup.

    Enable (DEFWINDOWMODE);

    

    // Display the background window.

    Enable (BACKGROUND);

    

    // Get the setup's window handle.

    nHwnd = GetWindowHandle (HWND_INSTALL);

    

    // Wait three seconds.

    Delay (3);

    

    // Send system command to minimize the window.

    SendMessage (nHwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);

    

    // Wait three seconds.

    Delay (3);

    

    // Send system command to maximize the window.

    SendMessage (nHwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);

    

    // Display a message.

    MessageBox ("Demo completed.", INFORMATION);

 

end;