0

I want to activate and run the tray system on a specific time. Right now my tray system will running when the PC turn is on but what I want to do is, I want the tray system start and running when there is a specific status from database trigger the tray system to active and running. I develop this using the tray system.

wmazizi
  • 99
  • 1
  • 1
  • 6

1 Answers1

1

If you wish to hide all icons in the tray, You will have to use windows dlls (pinvoke) for that.

  1. first you need to find the processId then the Handler of the object you want to hide/show.
  2. Use the SendMessage or ShowWindow windows api to send an hide/show to the Handler

    [DllImport("user32.dll")]
    static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    

    private const int SW_HIDE = 0x00;
    private const int SW_SHOW = 0x05;

'IntPtr hWnd' is the Handler (Like in windows form 'this.Handler')
'int nCmdShow' is the message you whant to send, in your case SW_HIDE or SW_SHOW

you will find a way to manipulate other process element in this tutoriel:
http://en.code-bude.net/2014/12/04/manipulate-any-program-by-using-c/

this is a question about hiding a program in the taskbar, maybe useful, just change to the right handler ...

in the past, when i was doing this kind of stuff, i was using Inspect to find the Handle i need then try different messages ...

In your google search, include the term 'pinvoke'.

Handler will change on each new instance, you will need a function to find it by process, then name. i was using FindWindowEx in the past (windows xp)

get all controls by FindWindowEx

I hope it help you to find the solution.

Community
  • 1
  • 1
Benoit
  • 1,109
  • 14
  • 29