 |
|
 |
Anybody know how to tell if they clicked on the upper left "menu" icon instead of the title bar?
|
|
|
|
 |
|
 |
You can do it by tracking "how close that click was to the upper left hand corner"
i.e. GetCursorPos compared with the windows edge.
|
|
|
|
 |
|
|
 |
|
 |
Great Article! Got 5 from me.
I want to send window to tray when it is minimized.
Can this be done using your hook?
What message will I receive when a window is minimized?
Thanks in advance
Regards,
zee
|
|
|
|
 |
|
|
 |
|
 |
Thanx for this, very nice
|
|
|
|
 |
|
 |
Hi,
I am working on an application which can restrict notepad application from moving. For that, I am writing a HOOK dll and using WH_CALLWNDPROC to trap WM_WINDOWPOSCHANGED & WM_WINDOWPOSCHANGING messages. As per the MSDN we can not modify the message in WH_CALLWNDPROC hook.
Is there any way to restrict a window(Notepad, Word, IE) movement ?
Regards
Anuj
|
|
|
|
 |
|
 |
Nice liitle utility, just what I wanted.
|
|
|
|
 |
|
 |
This simple and neat utility basically does what i wanted and only that!!
Thanks.
SRV
|
|
|
|
 |
|
 |
It seems to be related to the nView menu that nVidia installs with its video drivers. Every time the nView menu pops up, a new "Tray Me" pops up into the System menu.
I can disable the nView menu since I don't use it, but this may get problematic over a long session with an application (days).
Oh, forgot to add - great little app. Thanks for writing it!
-- modified at 18:03 Monday 7th August, 2006
|
|
|
|
 |
|
 |
I have searched for days (it feels like months) to find an example of hooking messages in other process's windows (not just mouse and keyboard, like everyone else seems to be obsessed with).
You may have just saved my sanity
James Randle.
|
|
|
|
 |
|
 |
I was browsing the site to get some example to do something like this... and I found it ready to use! Thanks a lot! Really useful!
|
|
|
|
 |
|
 |
Could you provide me with a C# version of this? I'm still pretty new and am having a hard time understanding the code here.
|
|
|
|
 |
|
 |
HookDll.dll:Hooks.cpp
It appeared that share section has "g_iLastIndex" that is not actual. I have added SWM_TRAYUNINSTALL message and moved "free minimized windows" code to InitMenuHookProc.
A. Sakhno 2006/05/15
Summary of changes can be found below:
#pragma data_seg(".SHARE")
HHOOK g_hInitMenuHook = NULL;
HHOOK g_hMenuCommandHook = NULL;
WNDDATA g_listWnd[255];
UINT g_iLastIndex = 0;
UINT SWM_TRAYMSG = 0;
UINT SWM_TRAYUNINSTALL = 0;
#pragma data_seg()
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
...
SWM_TRAYUNINSTALL= RegisterWindowMessage("MY_HOOK_UNINSTALL");
...
}
.....
BOOL WINAPI UnInstallHook()
{
BOOL bSuccess = FALSE;
// send a message to free all minimized windows
// broadcast message is not a best way, but it works...
// A. Sakhno
SendMessage(HWND_BROADCAST,SWM_TRAYUNINSTALL,NULL,NULL);
// unhook InitMenu
bSuccess = UnhookWindowsHookEx(g_hInitMenuHook);
if(!bSuccess){
return FALSE;
}
// unhook MenuCommmand
bSuccess = UnhookWindowsHookEx(g_hMenuCommandHook);
if(!bSuccess){
return FALSE;
}
return TRUE;
}
...
LRESULT CALLBACK InitMenuHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
// return immediately if system required
if (nCode < 0){
return CallNextHookEx(g_hInitMenuHook, nCode, wParam, lParam);
}
// get window procedure struct
CWPSTRUCT *wps = (CWPSTRUCT*)lParam;
if (wps->message == SWM_TRAYUNINSTALL) {
for(UINT i = 0; i < g_iLastIndex; i++){
if(g_listWnd[i].m_bMinimized){
Shell_NotifyIcon(NIM_DELETE, &g_listWnd[i].m_niData);
ShowWindow(g_listWnd[i].m_hWnd, SW_SHOW);
g_listWnd[i].m_bMinimized = FALSE;
}
}
}else.....
Anatoly Sakhno
-- modified at 10:58 Monday 15th May, 2006
|
|
|
|
 |
|
 |
I assume what you mention is the reason that the "free minimized windows" code is commented out--it isn't global so can't track all the windows, in reality. [Making this broadcast message necessary]. Is that right?
-=r
|
|
|
|
 |
|
 |
On the first mouse click, the system menu is not getting populated with the new "Tray Me" menu item with many applications like Internet Explorer...
Why is this happenning, and what can be the solution?
|
|
|
|
 |
|
 |
I am trying this with Windows XP Media Center Edition and it doesn't seem to work - Jus shows a bunch of additional menus for Explorer but not for any other windows. Anybody noticed this?
|
|
|
|
 |
|
 |
This program is great! I just installed it at both home and work.
When I try to tray Novell GroupWise, the "Tray Me" option is disabled. Obviously, I would like to know if anyone has found a workaround, but more interestingly I would like to know how it does this. Could it have something to do with it already extending its popup menu for taskbar right clicks (It has an "always on top" option)? This could possibly be related to why you can't tray CMD windows (they also have a custom menu), although with them you don't even get the "Tray Me" option.
Thanks for you contribution, Chau.
- Xavier
|
|
|
|
 |
|
 |
Why doesn't it work with CMD windows?
|
|
|
|
 |
|
 |
Exactly, why?... would be nice to tray some tail -f's
|
|
|
|
 |
|
 |
heh..that was the sole reason i downloaded it. lol. ive tried other programs that also dont work for it.
|
|
|
|
 |
|
 |
Hey thanks for the app...
I was trying to compile your code to make some changes, but it gives missing semicolon error in TrayIcon.cpp
// Global Variables:
HINSTANCE hInst; // current instance
NOTIFYICONDATA niData; // notify icon data
HMODULE hInjectDLL = NULL;
BOOL bEnabled = FALSE;
right after HINSTANCE hinst
Basically I was trying to get rid of the tray icon by commenting out the line:
Shell_NotifyIcon(NIM_ADD, &niData);
Let me know if you know what's going on.
Thanks!
Shom
sombando at hotmail dot com
|
|
|
|
 |
|
 |
Tray icon works fine in XP, but in Win98 (tried on several computers) once a program is minimized to the system tray it can't be restored, even with tray icon still running.
Have to use ctrl-alt-del to kill the minimized program.
Suggestions?
|
|
|
|
 |
|
 |
Hi,
I have the Icon displayed on the Task Bar, but How do I associate my Outlook window(or any other window) to be minimized to the Task Bar.
|
|
|
|
 |
|
 |
First, ensure his program is enabled.
Then, right click on the program in the task bar and select "Tray Me" to put it in the system tray.
|
|
|
|
 |