LOWORD Example

InstallShield 2018 ยป InstallScript Language Reference

To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

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

*

* InstallShield Example Script

*

* Demonstrates HIWORD and LOWORD.

*

* This example script shows how to use HIWORD and LOWORD to

* to get the low-order word and the high-order word from a value.

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

 

#define TITLE_TEXT "LOWORD/HIWORD Example"

 

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

#include "Ifx.h"

 

export prototype ExFn_LOWORD(HWND);

 

function ExFn_LOWORD(hMSI)

    STRING  szMsg;

    NUMBER  nData, nLOWORD, nHIWORD;

begin

 

    nData = 305419896; // hex value: 12345678

    // Get the low-order word, 22136 (hex value: 5678).

    

    nLOWORD = LOWORD (nData);

    

    // Get the high-order word, 4660 (hex value: 1234).

    nHIWORD  = HIWORD (nData);

    

    // Display the results.

    szMsg  = "LOWORD: %ld\nHIWORD: %ld";

    SprintfBox (INFORMATION, TITLE_TEXT, szMsg, nLOWORD, nHIWORD);

 

end;