|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
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? |
|
#5
|
|||
|
|||
|
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; |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
Well thanks for the help! I'll read up on it.
|
|
#8
|
|||
|
|||
|
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!! |
|
#9
|
|||
|
|||
|
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 |
|
#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? |
|
#11
|
|||
|
|||
sorry, no idea... |
|
#12
|
|||
|
|||
|
Well thank you for all your help.
Maybe someone else will know =) |
|
#13
|
|||
|
|||
|
App to send any other app to the system tray. enjoy!
URL |
|
#14
|
|||
|
|||
|
Or start the app from a shortcut set to run minimized.
|
|
#15
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Windows Help > App that can send programs to the tray? |
| Thread Tools | Search this Thread |