The blank project test worked. The application was invisible and could only be seen in Windows' task list, as I would expect.
Would my problem be related to having a tray icon? The following was in the code I had commented out but my original application window still showed even when this wasn't invoked.
With TrayIconData do
begin
cbSize:= SizeOf(TrayIconData);
hWnd:= Handle; // Note: different from Delphi which was just Wnd
uID:= 0;
uFlags:= NIF_MESSAGE + NIF_ICON + NIF_TIP;
uCallBackMessage:= WM_ICONTRAY;
hIcon:= Application.Icon.Handle;
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIconW(NIM_ADD, @TrayIconData); //Note: needed amendment from Delphi
If Debugging then
begin
Writeln(DL, 'Added Tray Icon ' + DateTimeToStr(Now));
Flush(DL);
end;
Maybe that's a red herring: I've just commented out the above again and recompiled, and my application still showed as in my original image.
I don't think I can change my main form without messing up the project badly, since there's a lot of initialisation (opening of files behind the scenes) in the initial form's OnCreate event.
Any further ideas/help from anyone would be welcome. Thanks.