News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

MASM 64 Desktop mini app.

Started by hutch--, May 28, 2017, 12:31:01 PM

Previous topic - Next topic

hutch--

The attached zip file contains a small working app that functions as a simple desktop that has programmable menus that can be set in a plain text file. I have used this app as a test piece to develop the 64 bit version of the programmable menus that I use in my editors and it seems to be working well at the moment. It splits the calling of programs between the old but well behaved "WinExec()" and the newer but limited "ShellExecute()". WinExec handles command lines for exe/bat files with no problems where "ShellExecute()" will run non executable files. It supports HLP, CHM and PDF extensions.

The 9k icon blew the size out to 21k but I doubt it will break any hard disks in terms of storage space.  :P

Tested only on Win10 64 but it should run on Win7/8 64 as well.


:biggrin: One day I will make a post with no typos.  :P

avcaballero

Hello. Works well on W7 64 bit. It creates a window without frames with WS_VISIBLE+WS_POPUP and paints the desktop with PaintDesktop and the WinExec for the menu entries.

Raistlin

Just a quick question / clarification needed. The explanation on technet/ms seems to be implicit, that
the execution of the called application context is independent of caller. The caller has no further control
over the initiated target except the ability to have exit codes passed. RE: Shellexecute(). The thread choice
in which the application context executes is controlled by the OS and cannot be manipulated by the caller
re: Processor Affinity. However it would theoretically be possible to shift the run-time priority of the application
target.


Is this assumption correct ?
Are you pondering what I'm pondering? It's time to take over the world ! - let's use ASSEMBLY...

TWell

In ShellExecuteEx() it is possible get hProcess with mask SEE_MASK_NOCLOSEPROCESS and then use SetProcessAffinityMask().

Raistlin

SEE_MASK_NOCLOSEPROCESS (0x00000040)
Use to indicate that the hProcess member receives the process handle. This handle is typically used to allow an application to find out when a process created with ShellExecuteEx
terminates. In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle
when it is no longer needed

typedef struct _SHELLEXECUTEINFO {
  DWORD     cbSize;
  ULONG     fMask;
  HWND      hwnd;
  LPCTSTR   lpVerb;
  LPCTSTR   lpFile;
  LPCTSTR   lpParameters;
  LPCTSTR   lpDirectory;
  int       nShow;
  HINSTANCE hInstApp;
  LPVOID    lpIDList;
  LPCTSTR   lpClass;
  HKEY      hkeyClass;
  DWORD     dwHotKey;
  union {
    HANDLE hIcon;
    HANDLE hMonitor;
  } DUMMYUNIONNAME;
HANDLE    hProcess;
} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;


(Note: ShellExecuteEx runs on a background thread by default if the caller's threading model is not Apartment.)
Are you pondering what I'm pondering? It's time to take over the world ! - let's use ASSEMBLY...