Windows Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsWindows Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 21st, 2002, 04:44 PM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
App that can send programs to the tray?

Anyone know of a program that allows you to take app's that are
on the taskbar and hide the app in the taskbar, but show the
icon in the tray? I would like to use it for app's that don't have
the tray feature coded into them...so I don't know if it is even
possible.

Would this be easy to make?

Reply With Quote
  #2  
Old July 23rd, 2002, 01:15 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
yes, it is possible. i donīt know of a pre-made program, but:
are you a programmer? (c/delphi, some experience with winXXXX?)

then i can tell you how...
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old July 23rd, 2002, 01:53 PM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
I'm a programmer skilled mostly in
VB and PHP.

I've worked w/ C++ but only know basic
things: writing functions, write/reading files,
arrays, and general programming logic.

Where would I start?

Reply With Quote
  #4  
Old July 23rd, 2002, 02:16 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
get used to the windows ShellAPI and other low-level programming. do you know how handles and processes work in windows? this would help alot...

the "abstract" way:

- start the application using createprocess() -> you get a handle to the process (ProcessInformation.dwProcessHandle)
- get the Main Windowīs handle from this.

you app will then:
- hide the applicationīs taskbar button: SetWindowLong()
- go to the system tray: Shell_NotifyIcon()
- setup a menu for clicking on the system tray icon
- "sendmessage()" (and other functions for IPC) to the applicationīs main form.

do you understand this?

Reply With Quote
  #5  
Old July 23rd, 2002, 02:45 PM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
It seems that this is going to have to be done in C++, am I
correct? I don't know much about handles, etc. Just that if you
get a handle to a window, you can change some things about it.

It seems like my program would have to start other programs I
would like to hide. Is there a way I could make it so that right
clicking on my tray icon would bring up a menu of the programs in
the taskbar and another menu for programs that I hid?

If not, I guess that'd be ok...

If I'm using this function,
BOOL CreateProcess(
LPCTSTR lpApplicationName, // name of executable module
LPTSTR lpCommandLine, // command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
BOOL bInheritHandles, // handle inheritance option
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // new environment block
LPCTSTR lpCurrentDirectory, // current directory name
LPSTARTUPINFO lpStartupInfo, // startup information
LPPROCESS_INFORMATION lpProcessInformation // process information
);

What parameters are required besides the filename?

Also, I'm a little rusty w/ pointers... how would I go about
making one?
the parameter is prefixed w/ lp. Is it supposed to be of long
type or string, or I'm I just not understanding the terminology?

string strFileName = "C:\myprogram.exe";
string *ptrFileName;
ptrFileName = &strFileName;

Reply With Quote
  #6  
Old July 24th, 2002, 12:23 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
i canīt tell you all the details due to lack of time, but maybe i can point you in the right direction.

all variables in the windows api that start with "lp" are AFAIK "long pointer" (C: far pointer)

i only use delphi for programming at the moment, so there is not much i can tell you about how to do it in C

for using pointers, look in the "C" forum here, we had an interesting discussion just yesterday...

do you have a "string" class for c++? i donīt think there is a string type in C. but i donīt know for sure.

if i remember correctly (it is some months that i did not use C)
Code:
char *filename="C:\\WINDOWS\\NOTEPAD.EXE"; // double slashes in C!
OR:
String filename=new String("C:\\....."); // for C++ if you have a String class


createprocess(null,filename,....)

i recommend searching the web (ask mr google: "windows programming how to use createprocess")

if you know Delphi AND C, you can look at http://delphi.about.com and translate it to C. if you only know C, search http://www.microsoft.com for code examples (and download the SDK docs there!) and http://community.borland.com

Reply With Quote
  #7  
Old July 24th, 2002, 12:29 PM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
Well thanks for the help! I'll read up on it.

Reply With Quote
  #8  
Old July 26th, 2002, 01:58 AM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
I accomplished some of what I wanted to do with VB.

2 areas I'm concerned about are:

How do you get only the applications that are
shown on the taskbar? (hwnd's)

And, how do you get a handle of a console window?

Any further help would be appreciated!!

Reply With Quote
  #9  
Old July 26th, 2002, 10:26 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
hmmm. not 100% sure. i think for a window to appear in the taskbar, the following has to be true:

- it is a main window (parent is 0, the desktop)
- some parameters must not be set; eg. getWindowLong() must not contain the glx_toolwin parameter (that i use for removing it from the taskbar )

this should be documented in the windows SDK, if not, youīll have to do some tests. but this can be quite many since i am not sure of parameter combinations either.

maybe you want to write an automatic program that changes itīs own parameters, waits for a second or two, makes a screenshot and tests if the taskbar has changed. (just an idea..) then you could do all permutations in probably a few hours without attending

a console process also needs to have a window handle just like any other window too... maybe write a program that uses EnumWindows() to find all windows and compare the title barīs Caption.

this url tells you how to find the executable name from the main window handle, then you can iterate through all windows with EnumWindows() and check the executable name against the program you are looking for...

http://www.mooremvp.freeserve.co.uk...amed_tip038.htm

hope this helps.

M

Reply With Quote
  #10  
Old July 26th, 2002, 11:14 AM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
This time I got an h_wnd when I checked the window titles.

The program was already running. So I found it by typing in
what I wanted to find for a title. All that happened when I tried
to hide the console window was that it moved from being first on
the taskbar, to being last. Any ideas why?

Reply With Quote
  #11  
Old July 27th, 2002, 12:27 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
sorry, no idea...

Reply With Quote
  #12  
Old July 27th, 2002, 12:52 PM
wordracr wordracr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 601 wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level)wordracr User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 9 m 25 sec
Reputation Power: 10
Well thank you for all your help.

Maybe someone else will know =)

Reply With Quote
  #13  
Old August 27th, 2003, 02:34 PM
gregon gregon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 gregon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
App to send any other app to the system tray. enjoy!

URL

Reply With Quote
  #14  
Old August 28th, 2003, 06:45 PM
mojosoupus mojosoupus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 58 mojosoupus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Or start the app from a shortcut set to run minimized.

Reply With Quote
  #15  
Old August 28th, 2003, 06:52 PM
gregon gregon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 gregon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The problem with that is the app still resides on the task bar and not in the system tray.

Trayit lets you specify which apps to run in the tray as well as lets you temporally send an app to the tray by right clicking on the "x". It's a nifty app I use it all the time.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsWindows Help > App that can send programs to the tray?


Thread Tools  Search this Thread 
Email this Page