User:Lucas Brooks/Researches/Windows 1.0 DR5 Programming

Programmatically Launch Apps
It is possible to programmatically run applications in Windows 1.0 DR5. This is done using the  API function. is a far pointer to the module name string (without extension). is a far pointer to the module load block. This function returns a handle to the loaded module directly, and a handle to the main application window indirectly through the module load block.

Module Load Block
A module load block is a  structure (2 bytes followed by a null-terminated string). The first field is reserved for a  (handle to window) and the second field is the string of arguments to pass to the module. This load block will be passed directly to the  of the module to be loaded, which means on return, the   field should contain a handle to the main application window if the module is a user application. It is up to you to set the visibility of that window (visible/hidden/iconic) through the  function. The module load block must be passed as, which means you will have to cast the   variable to   before calling. It is suggested that you set the  field of the load block to   before passing it to , this way you can easily determine the validity of the   returned.