 |
|
 |
how transtale to C# ??
AE
|
|
|
|
 |
|
 |
Hi,
I have an MFC project, I'm just trying to make it so the size is adaptable to different screen resolutions. For example, the program runs correct in a screen of size
1024 by 768, but only parts of it show in a smaller screen.
I have used the following line in my OnMove function, but it's not working.
SystemParametersInfo(SPI_GETWORKAREA,0,lprect, 0);
I would greatly appreciate your help.
|
|
|
|
 |
|
|
 |
|
 |
In FindTrayWnd(HWND hwnd, LPARAM lParam),
Code is:
// The system clock may be either to the right or above the system tray
// area. Adjsut accordingly
if (rectClock.bottom < lpRect->bottom-5) // 5 = fudge factor, just in case...
lpRect->top = rectClock.bottom;
else
lpRect->right = rectClock.left;
return FALSE;
Should be:
// The system clock may be either to the right or above the system tray
// area. Adjsut accordingly
if (rectClock.bottom < lpRect->bottom-5) // 5 = fudge factor, just in case...
lpRect->bottom = rectClock.top;
else
lpRect->right = rectClock.left;
return FALSE;
|
|
|
|
 |
|
 |
I just tested this... and yes... this is a bug. The code above this post is a 100% correct bug fix.
|
|
|
|
 |
|
 |
How to remove icon after the process has been killed? It seems it still shown on the System Tray even after the process has been killed by TerminateProcess(hProcess,1). It doen't work by using the: Shell_NotifyIcon(NIM_DELETE, &nid);
The icon will be dispeared until the cursor is moving over it after the process has been killed.
Thank you.
|
|
|
|
 |
|
 |
Can we resize systray?? I have tried that using MoveWindow or SetWindowPos but this does not work.
any body having an idea about that?
Thanks,
|
|
|
|
 |
|
 |
hi
maybe you will be able to do it with
the SHAppBarMessage() function
|
|
|
|
 |
|
 |
I want to minimize my program to the tray at startup if the user selects "start minimized" in the shortcut properties. My current approach for minimizing to the tray is calling ShowWindow(SW_HIDE) in OnSize() (CDialog derived class). Once the program is running, this takes care of all minimize-operations (EVEN the "minimize all windows" feature, which does not send any SYS_COMMAND SC_MINIMIZE at all. That's a problem with other approaches, eg, try it on mIRC, it will minimize to the taskbar). It doesn't have the fancy DrawAnimatedRects() feature, but I can
live with that. The problem is with "start minimized".
At program startup, OnSize() is indeed called with the MINIMIZE parameter, just as it should be when "start minimized" is activated. But instead of hiding the window, the call to ShowWindow(SW_HIDE) just makes it pop up again, restored to normal size, and visible. A click on the
minimize button makes it go away into the tray, but this is what I'd like to get rid of.
Any suggestions/pointers to info?
|
|
|
|
 |
|
 |
hi
it's all about timing in windows programming.
we do similar thing in the hideStatus() function. buy you can do also just a minimize.
user defined messages are all the time helpfull to work with the windows message que.
#define WM_POST_CREATE (WM_USER+101)
BOOL WatchdogClientDlg::OnInitDialog()
{
...
// normaly at the end of this function
PostMessage(WM_POST_CREATE);
return (TRUE);
}
LRESULT WatchdogClientDlg::DefWindowProc
(
UINT message,
WPARAM wParam,
LPARAM lParam
)
{
if (message == WM_POST_CREATE)
{
hideStatus();
return (TRUE);
}
return CDialog::DefWindowProc(message, wParam, lParam);
}
void WatchdogClientDlg::hideStatus()
{
ShowWindow(SW_HIDE);
}
|
|
|
|
 |
|
 |
I want to show text in systray instead an icon
|
|
|
|
 |
|
 |
I am looking for the same... kindly let me know if you have solution.
|
|
|
|
 |
|
 |
Hey guys,
Its simple.
Create a Memory DC. Draw some text into it. Get the Bitmap handle . Convert to HICON. Then set the icon to system tray. Becareful while drawing the text. Take care of font,size, color etc of the text.
|
|
|
|
 |
|
 |
Karthik Murugan wrote:
. Becareful while drawing the text. Take care of font,size, color etc of the text.
What About taking WindowDC and Directly writing to System Tray
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
 |
|
|
 |
|
 |
Hello, my name is Javier, I don´t know speak english very well, but I have to say I have had the same problem that you.
I have tried with much methods, but never satisfacied.
To delete an icon of the left of the clock you have to know
the HWND'S icons of that but it is dificult.
I´m sorry, I tell you this, because you aren´t the one with this problem.
I supose that Hwnd`s icons can be knew with the parent application, because from this is called to create this icon, only you need to know all icons that have a form and
asking with the function shell_NotifyIcon (NIM_DELETE,...)
I think that knowing all form´s icons we can delete the f***ed icon.
Well, I forgot of this because I couldn´t more, I put out white flag.
One salute, and if someday you know resolve this, please
send me something.
My e-mail is: javier.donis@tup.es
THANKS YOU.
|
|
|
|
 |
|
 |
Try looking here:
http://www.mlin.net/TraySaver.shtml
There is source-code toa program which hides tray icons, amoung other things.
Hope it helps!
--Leo
|
|
|
|
 |
|
 |
Hi,
now that we have the handles of these windows, I though I could modify their content with SendMessage(WM_SETWINDOWTEXT,...), but seems this doesn't work.
Anybody knowing more about this
|
|
|
|
 |
|
 |
I would assume that the content of the system tray would not be affected by WM_SETWINDOWTEXT, since it just draws icons, and the clock window should also ignore WM_SETWINDOWTEXT since it is meant to display a constantly changing value, hence WM_SETWINDOWTEXT handlers are probably not wired in
|
|
|
|
 |
|
 |
what about making the icons move and hot track 3d buttons like IE5 toolbar
|
|
|
|
 |
|
 |
Microsoft tried this in Windows 2000 Beta 2. It was ugly, didn't work very well, and didn't survive into Beta 3
|
|
|
|
 |