Window hider
#1
Posted 04 August 2009 - 10:17 AM
Is this even possible?
I'm trying to make it using C++. Im a newbie and have only learned the basics but im a fast learner and will take all of your advice!
Thanks in advance,
Ozi
#2
Posted 04 August 2009 - 12:04 PM
#3
Posted 04 August 2009 - 12:58 PM
Anyone out there that can help me? Anyone?
#4
Posted 06 August 2009 - 10:28 AM
Oziyn, on Aug 4 2009, 01:58 PM, said:
Anyone out there that can help me? Anyone?
You might want to be a bit clearer. If by "hide" you mean "minimize", then yes it can be done. However, "rename or hide" might be another matter all together and is likely not possible. If you want to find all the active windows, I can dig out a sample of that (it's in Delphi, but it's all Windows API calls anyway). Minimizing them isn't too hard to do from there once you have the window addresses.
And it's not necessarily an issue of learning C++ in this case, it's learning the Windows API. Two different things.
Okay: Samples. This gets all your window addresses.
WinAddr := GetActiveWindow; repeat WinAddr := GetNextWindow(WinAddr, GW_HWNDNEXT); until WinAddr = 0;
This tests the kind of window address you have:
IsWindowVisible(WinAddr) - is it a visible window? GetParent(WinAddr) <> 0 - is it the main (or parent) window?
These get text information about the window address.
GetClassName(WinAddr, ClassNamea, 256); - Class Name GetWindowText(WinAddr, WinNamea, 256); - Window Text (what you see in the title of the window)
This gets the thread id and process id for a window address.
ThreadID := GetWindowThreadProcessID(WinAddr, @processid);
All are Windows API commands, if you want to see documentation on them, look them up on Microsoft's Developer site.
This is the one for "GetClassName", all the others will appear there as well upon search
This post has been edited by Glenn9999: 06 August 2009 - 10:47 PM
#5
Posted 06 August 2009 - 10:43 PM
In "msn messenger PLUS" theres a feature where you press ctrl+space and it hides your window in your system tray as a search icon.
Thats my goal right there.
#6
Posted 06 August 2009 - 10:49 PM
Oziyn, on Aug 6 2009, 11:43 PM, said:
In "msn messenger PLUS" theres a feature where you press ctrl+space and it hides your window in your system tray as a search icon.
Thats my goal right there.
With your app or anyone's app? Having a System Tray icon requires interprocess communication, which means the app in question would need to be set up to handle it. Which means it wouldn't be possible with anyone's app. Your app, however, could do it. Searching for "system tray" with respect to coding/programming should net you the answer on how to do it.
#7
Posted 06 August 2009 - 10:52 PM
http://www.thewonder...n.com/faqs.html
#8
Posted 07 August 2009 - 08:08 AM
Now i have some of the stuff i need. What about the icon? How would i choose what it looks like? and make all my windows re-open when i double click it?
#9
Posted 07 August 2009 - 10:09 AM
Oziyn, on Aug 7 2009, 09:08 AM, said:
Now i have some of the stuff i need. What about the icon? How would i choose what it looks like? and make all my windows re-open when i double click it?
ShowWindow would be what you would need to control the windows, as the link indicated. The icon is set through the systray notification API routine. This is in Delphi, but again it's just nothing but Windows API calls that you can look up on the site I mentioned. It shows my app setting up a systray icon.
with TrayIconData do
begin
cbSize := SizeOf(TrayIconData);
Wnd := Handle;
uID := 0;
uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
uCallbackMessage := WM_ICONTRAY;
hIcon := Application.Icon.Handle; // get the icon if the app.
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIcon(NIM_ADD, @TrayIconData);
You could realistically do this for each app you would control as the other link described (wasn't too sure of the API to say you could do it in my last post, but I'm very sure now you could completely hide windows and control them through a systray icon), but you would have to keep track of them and keep a handler set up for each one. All control of icons go through Shell_NotifyIcon, either NIM_ADD, NIM_MODIFY, or NIM_DELETE.
However, I'm not sure you could make a systray icon respond by an expressed double-clicking it, since it seems to respond only to single mouse-clicks. Generally you would then start a popup menu at the systray icon.
Speaking of this, now that I see all of what is required to run windows through a systray icon, I might go try it myself. What may be interesting is if you can modify the standard system menu to include an option to "minimize to tray" or the like. Let me know if you have any more specific questions.
#10
Posted 07 August 2009 - 12:46 PM
PM me if your interested.
#11
Posted 08 August 2009 - 06:33 PM
Glenn9999, on Aug 7 2009, 11:09 AM, said:
I just finished writing the basic idea of what I was typing of here (minimize windows to systray, restore them, and so forth). I'm not sure it would be worth releasing the source for it, yet. But my main question to those in group is if there any demand for something like this? If so, I might go ahead and release the app itself as a beta test when it's ready...
#12
Posted 12 August 2009 - 11:40 AM
- ← VB Datatype Question
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- The ! (exclaim) char in Batch Scripting →



Help
Back to top









