Share this page

# Example: lr_load_dll

In the following example, lr_load_dll is used to load user32.dll so that a standard Windows message box can be displayed during script replay, then to load kernel32.dll to use file functions.:

    WIN32_FIND_DATA fdFile;
    HANDLE hFind = NULL;

    char *filepath;
    char sPath[2048];

    lr_load_dll("user32.dll");
    MessageBoxA(NULL, "This is the message body", "message_caption", 0);

    filepath = lr_eval_string("{UploadDirectoryPath}");

    lr_load_dll("kernel32.dll");

    sprintf(sPath, "C:\\TEMP\\*.*");

    // see http://www.win7dll.info/kernel32_dll.html
    if((hFind = (void*) FindFirstFileA(sPath, &fdFile)) == INVALID_HANDLE_VALUE)
    {
       lr_message("Path not found: [%s]\n", sPath);
       lr_abort();
    }

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: