Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    163

    Cant restore/show system tray window?

    Hi! I have my app set to "system tray" mode but it seems you cant minimize and restore it via the built in window actions. even if I get the winhandle again (there is non in system tray?) after minimizing it it does not get restored.

    I tried window.hide and window.show but I get this error in debug mode:
    TRACE: LastError = 2005 ("Error, could not show window.")

    its the same issue, right? It has no winhandle as system tray icon?
    but its still shown so I dont know why it says "could not show". Restoring does not work at all.

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Try Window.Hide / Show (instead of Window.Minimize when running via sys tray). You get the same results.

    Whoops, read yer post again. I just tried the Window.Hide method (as I posted avove) using just system tray, and it worked here. You may have something else going on?

    Granted the minimize method doesn't work I believe because the window must be active and it's kinda hidden in the sys tray as you summized.
    Last edited by rhosk; 11-06-2005 at 08:34 AM.

  3. #3
    Join Date
    Dec 2003
    Posts
    163
    I added a traymenu but cant restore the window. I tried window.show and window.restore and even if I save the winID in a variable when I minimize it it can't be opened with this windowid (getwinhandle function). :(

    is there no way to make my "open" button in traymenu work?

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    I modified the code in the AMS 6 Help file to the following (note: what's in bold):
    Code:
    function g_OnSystemTrayMenu(X, Y)
       tblMenu = {};
       tblMenu[1] ={};
       tblMenu[1].Text = "&New Menu";
       tblMenu[1].ID = 100;
       tblMenu[1].Checked = false;
       tblMenu[1].Enabled = true;
       tblMenu[1].SubMenu = {};
       tblMenu[1].SubMenu[1] = {};
       tblMenu[1].SubMenu[1].Text = "&SubItem 1";
       tblMenu[1].SubMenu[1].ID = 101;
       tblMenu[1].SubMenu[1].Checked = false;
       tblMenu[1].SubMenu[1].Enabled = true;
       tblMenu[1].SubMenu[2] = {};
       tblMenu[1].SubMenu[2].Text = "S&ubItem 2";
       tblMenu[1].SubMenu[2].ID = 102;
       tblMenu[1].SubMenu[2].Checked = false;
       tblMenu[1].SubMenu[2].Enabled = true;
    
       result = Application.ShowPopupMenu(X, Y, tblMenu, TPM_RIGHTALIGN, TPM_BOTTOMALIGN, true, false);
       
       if result == 101 then
       	Application.Restore()
       end
    
    end
    Intrigued

Similar Threads

  1. System Tray Icon - need coordinates
    By Intrigued in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 10-20-2005, 07:54 PM
  2. Program to run in system tray and check for updates??
    By patrick6 in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 05-11-2004, 06:21 AM
  3. System Tray? & Task Bar? Ideas?
    By Tux in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 04-06-2004, 12:44 AM
  4. How to minimize to system tray?
    By nim in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 03-09-2003, 05:09 PM
  5. Is There a Program to Create an Icon in the System Tray?
    By joeterra in forum Setup Factory 6.0
    Replies: 1
    Last Post: 02-04-2003, 08:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts