Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Internals
  New Posts New Posts RSS Feed: HOW TO HIDE SYSTEM TRAY ICONS????????????
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

HOW TO HIDE SYSTEM TRAY ICONS????????????

 Post Reply Post Reply Page  <1234 6>
Author
Message
  Topic Search Topic Search  Topic Options Topic Options
LZW2006 View Drop Down
Senior Member
Senior Member


Joined: 11 February 2006
Online Status: Offline
Posts: 244
  Quote LZW2006 Quote  Post ReplyReply Direct Link To This Post Topic: HOW TO HIDE SYSTEM TRAY ICONS????????????
    Posted: 07 October 2006 at 3:13am
I wanted to make a delphi program that would minimize to the system tray (visibly) but I did not want to have a window/view menu so I wanted to put that function in the system menu! (the icon on the left of the title bar)

So I did that... and delphi is different, but similar with the API stuff. Yet, I could not see it in the icon tray! A couple of hours of debugging, and I could see it but it did not work!! A few more hours, then all worked!!!

The notifyicondata data is just that but to get it all working with the mouse and the system menu, took many more lines of code! is was like full procedures plus a couple of extra "gotcha's" to work out.

So it all works for your program if you can see it but to hide it? I think it has to be there to work... So maybe you would need a blank icon, or change the icon property to null?

Yet for someone elses program, wouldn't you just download a nifty icon tray util that does that sort of thing?

This program could allow you to mess with the icons in other programs:

http://www.angusj.com/resourcehacker/

Or you could use a program that just hides windows... Yet how would you hide the hider??

http://www.snapfiles.com/reviews/OuttaSight/outofsight.html
Back to Top
johnmack111 View Drop Down
Newbie
Newbie
Avatar

Joined: 05 October 2006
Location: India
Online Status: Offline
Posts: 14
  Quote johnmack111 Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2006 at 10:18pm
Hi LZW2006..thanks for ur reply man... the resource hacker does wonders!! lovely software and so small too!!

I tried the Shell_Notifyicon structure...but i just don't know how to proceed in that!! which is a big problem!!

Any idea how i can manipulate the fields of the structure? Asterisk....said that i should enumerate all the child processes...and then find the appropriate window...but i don't much understand that step...though i understand in the logic level, exactly what he's trying to do...pls. help.
Back to Top
johnmack111 View Drop Down
Newbie
Newbie
Avatar

Joined: 05 October 2006
Location: India
Online Status: Offline
Posts: 14
  Quote johnmack111 Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2006 at 4:21am
hey thanks for ur technical advice, i was trying ur code...and its compiling alright. I have selected the project as "win32 application". am i right in doing that? then..i compiled the code..its fine..but on build, i get 2 errors :     
"LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/test_winapi.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe."   

am stuck now... was wondering if u could help me in this. thanx
Back to Top
Mixel View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Location: Mexico
Online Status: Offline
Posts: 118
  Quote Mixel Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2006 at 11:39am
Originally posted by Dragonstory

void Shell_NotifyIconExample()
{

// Add a Shell_NotifyIcon notificaion for PocketPC or Smartphone.
NOTIFYICONDATA nid = {0};

nid.cbSize = sizeof(nid);
nid.uID = 100; // Per WinCE SDK docs, values from 0 to 12 are reserved and should not be used.
nid.uFlags = NIF_ICON;
nid.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_SAMPLEICON));

// Add the notification to the tray.
Shell_NotifyIcon(NIM_ADD, &nid);

// Update the notification icon.
nid.uFlags = NIF_ICON;
nid.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_SAMPLEICON2));

Shell_NotifyIcon(NIM_MODIFY, &nid);

// Remove the notification from the tray.
Shell_NotifyIcon(NIM_DELETE, &nid);

return;
}

just a copy-paste stuff for you


yeha it will nnever make aprogram for itself cuz main() is missed....

so you need soemthing like this:
void Shell_NotifyIconExample()
{

......
}

void main()
{   
    Shell_NotifyIconExample();
    return;
}

but it wont do what you want

Originally posted by asterisk


Enumerate child windows for Shell_TrayWnd window


I think this is the best option

you need:
EnumWindows, EnumChildWindows, GetClassName, DestroyWindow or ShowWindow (only for a non destructive action)...
Both EnumWindows and EnumChildWindows uses CallBack functions so learn a little about it....
Saludos from Durancho...


edited some erros


Edited by Mixel - 09 October 2006 at 11:40am
Security software
AV:Nod 32
FW: ZoneAlarm
ARK: RootKit unhooker
Brain: Own
do u need something more ??
Mixelandia
Mixel Adm
Back to Top
johnmack111 View Drop Down
Newbie
Newbie
Avatar

Joined: 05 October 2006
Location: India
Online Status: Offline
Posts: 14
  Quote johnmack111 Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2006 at 6:45am
Hey guys..need help again.... i need help on how EnumWindows works and also, how i can find HWND hWnd (handle) for the particular application that i want to hide icons from the system tray.

This is the code i have written: The error message on linking is also given after the code:

#include<string.h>
#include<windows.h>
#include<shellapi.h>
#include<stdio.h>
#include<winuser.h>



void Shell_NotifyIconExample()
{
     char *str="hello, this is just a test";
    
/* Add a Shell_NotifyIcon notificaion for PocketPC or Smartphone.*/

    NOTIFYICONDATA nid = {0};

    nid.cbSize    &n bsp;   = sizeof(nid);
    nid.uID      ;       = 100;      /* Per WinCE SDK docs, values from 0 to 12 are reserved and should not be used.*/

    nid.uFlags    = NIF_ICON;
    nid.hIcon    &nb sp;= LoadIcon(NULL, MAKEINTRESOURCE(10));
     
     /*HWND hWnd*/
     nid.hWnd   &nbs p; =NULL;
/* I have no clue as to what is to be filled in this   field!*/

    /* Add the notification to the tray.*/
    Shell_NotifyIcon(NIM_ADD, &nid);

    /* Update the notification icon.*/
    nid.uFlags   = NIF_ICON;
    nid.hIcon    = LoadIcon(NULL, MAKEINTRESOURCE(10));
    strcpy(nid.szTip,str);
    Shell_NotifyIcon(NIM_MODIFY, &nid);

    /* Remove the notification from the tray.*/
    Shell_NotifyIcon(NIM_DELETE, &nid);

    
}

void main()
{
    Shell_NotifyIconExample();
}


This the error message i got on linking:

--------------------Configuration: test_winapi - Win32 Debug--------------------
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/test_winapi.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...

test_winapi.exe - 2 error(s), 0 warning(s)
Back to Top
Poorguy View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 July 2006
Location: Argentina
Online Status: Offline
Posts: 419
  Quote Poorguy Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2006 at 6:39pm

Originally posted by johnmack111

Now that last post by Mixel was real funny...
I really appreciate asterisk for his post...thanks man...

Hey guys....looks like u guys are born programmers huh?

Thanks for all the post...atleast i got somewhere to start with...
I know C programming...but sadly, i have no experience with windows internals..api's, and stuff...The only api i used is windows wave mapper that too for a project.

Guess what....i just got into a company.. starting my programming career! Yeah..am into C itself..and a bit of assembly. Gonna be working for multimedia content for motorola mobile phones...

GUYS...i feel am in the right place in this forum... I'd need a lot of expertise like u people have. Thanks again asterisk!

If you find c++ or assembly too hard, i recommend you Delphi it lets you put assemly code in you app and you can have the same result if you make the program in c++ (or win32 asm), because it's too easy too program and make powerful programs (you can even make an app enterily using API calls and procedures!!)

Luis Fernando De La Fuente
Back to Top
jessy View Drop Down
Newbie
Newbie


Joined: 18 October 2006
Online Status: Offline
Posts: 4
  Quote jessy Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2006 at 3:20am
Back to Top
Mixel View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Location: Mexico
Online Status: Offline
Posts: 118
  Quote Mixel Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2006 at 1:07pm
lol my post was funny

Security software
AV:Nod 32
FW: ZoneAlarm
ARK: RootKit unhooker
Brain: Own
do u need something more ??
Mixelandia
Mixel Adm
Back to Top
Poorguy View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 July 2006
Location: Argentina
Online Status: Offline
Posts: 419
  Quote Poorguy Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2006 at 3:54pm

[QUOTE=jessy]here's what you want http://www.cpringold.com/products/astc.html[/QUOTE]

VB (and his "components" sucks) !!!, VB is for ladies (i don't want to offend the ladies for this), but Assembler rules, c++ rules, Delphi rules (i can even make a c++ builder app and then port to Delphi and viceversa!!!).

Luis Fernando De La Fuente
Back to Top
EP_X0FF View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 March 2006
Location: Russian Federation
Online Status: Offline
Posts: 4753
  Quote EP_X0FF Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2006 at 2:00am
Originally posted by Poorguy

[QUOTE=jessy]here's what you want http://www.cpringold.com/products/astc.html[/QUOTE]


VB (and his "components" sucks) !!!, VB is for ladies (i don't want to offend the ladies for this), but Assembler rules, c++ rules, Delphi rules (i can even make a c++ builder app and then port to Delphi and viceversa!!!).




Pascal/C/ASM - rulez.

Yes, VB is for Neocracker from rootkit.com the biggest idiot that i ever seen.
Ring0 - the source of inspiration
Back to Top
 Post Reply Post Reply Page  <1234 6>

Forum Jump Forum Permissions View Drop Down

Privacy Statement