BoxedApp Blog

BoxedApp: Tips'n'Tricks, Examples, Use Cases etc.

BoxedApp SDK 2.0, BoxedApp Packer 2.1


Share this post Bookmark and Share

Finally, we have made available the new releases with two extremely interesting features:

Launching a virtual file-based process

Briefly, having created a virtual file with an embedded exe, you can launch a process upon that file:

BoxedAppSDK_Init();

HMODULE hModule = GetModuleHandle(NULL);
HRSRC hResInfo = FindResource(hModule, _T("BIN1"), _T("BIN"));
HGLOBAL hResData = LoadResource(hModule, hResInfo);
LPVOID lpData = LockResource(hResData);
DWORD dwSize = SizeofResource(hModule, hResInfo);

HANDLE hFile = 
   BoxedAppSDK_CreateVirtualFile(
      _T("app1.exe"), 
      GENERIC_WRITE, 
      FILE_SHARE_READ, 
      NULL, 
      CREATE_NEW, 
      0, 
      NULL);

DWORD temp;
WriteFile(hFile, lpData, dwSize, &temp, NULL);

CloseHandle(hFile);

ShellExecute(NULL, NULL, _T("app1.exe"), NULL, NULL, SW_SHOW);

Shared virtual file system for several processes

Prior to this, BoxedApp SDK was limited by a single process; however, we have received numerous requests, the summarized idea of which was to allow third-party applications to access the virtual files created in the original process.

We have improved BoxedApp, by having added the BoxedAppSDK_AttachToProcess function, which embeds BoxedApp in the process. Once has been embedded, the process can see all virtual files, which have been or are being created in the main process. It can modify them, etc. In other words, the both processes have the full access to the shared virtual file system. BoxedAppSDK_AttachToProcess can be called for several processes at once, and all of them would have the same file system.

Besides that, we have added the DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES option, which specifies whether or not BoxedApp is to be embedded in each child process (by default this option is disabled) created in the application:

// yes, embed in child processes
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES, TRUE);
...
// no, do not embed in child processes
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES, FALSE);

[ Download the DEMO versions ]

Share this post Bookmark and Share






Write a Comment

You must be logged in to post a comment. Log in