Announcement

Collapse
No announcement yet.

Window.Close and System Tray minimized window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Window.Close and System Tray minimized window

    Hi forum, I need a suggestion to solve a problem.
    I've two applications, App1 and App2.
    App1 sends a Window.Close command using the following code

    Code:
    -- Get the titles and window handles of all open windows.
    windows = Window.EnumerateTitles();
    
    -- A variable containing text in the title you want to search for.
    window_name = "Control Job";
    
    -- Loop through the table of windows.
    for handle, title in pairs (windows) do
    -- Check if the window title has the target text.
    result = String.Find(title, window_name, 1, false);
    -- if the string was found in the title, send the window a close message.
    if (result ~= -1) then
    Window.Close(handle, CLOSEWND_SENDMESSAGE);
    end
    end
    The issue:

    App2 doesn't receive this command because in "Settings" I checked System Tray for Taskbar. If I choose "Standard" the problem is solved.

    Note that I need System Tray minimized window and I can't performa a simple "kill process" because there are many actions on App2 Pn Shutdown. Finally even if I solve the sgutdown actions, by killing the process the icon in the tray does't close because icon cache is not updated

    Really I hope in your support.
    Thanks Forum.

  • #2
    Try using Window.EnumerateTitles(false) and see if this works better.

    Ulrich

    Comment


    • #3
      It works fine!

      Thank you Ulrich.

      Comment

      Working...
      X