|
Kreatief wrote:
I am using this for a class for minimizing the app to the tray.
You use Shell_NotifyIcon() for this. There are plenty of examples on how to do this here at CP, and on MSDN. You can Google for even more.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yeah sure. I did that, and got it to work. I am having other problems with the trayicon, which caused the problem! I have an MFC app, where I wanna handle Messages, eg. a Buttonclick on the icon. I dunno how to do that. Who can tell me just the base. I can learn myself, but I need to know the base. For a normal app you make an endless loop checking for messages. But here?
DKT
|
|
|
|
|
ok....tis a long story.....here goes......
u c.....the code.....
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
return TRUE;
is a working code coz i have put this in my Dialog based application (Xyz) in a class called CXyzDlg..... that is, i have already added this function "OnSetCursor()".....and the cursor changes......in the main Dlg box but..... i have derived a class from the CStatic Class named it as "CMyClass".....and i have created obcts of it in the CXyzDlg class.....basically these objects i have created by placing the "static control" on the dialog box and then..... thru the class wizard created an object linking it with the picture control of type CMyClass(that is .....SUBCLASSING).....
also in thiz CMyClass i have added the "OnSetCursor()" function as well......and many other mouse functions like "onmousemove()","LbuttonDown()".....etc.....but here when i put in the same code as i had put in the main Dlg box for the "OnsetCursor()".....it does not change!!!!!......y???
heres the code......that i have put in the derived class CMyClass......
<br />
#include "stdafx.h"<br />
#include "creamz.h"<br />
#include "MyClass.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
<br />
CMyClass::CMyClass()<br />
{<br />
m_DragOn1=FALSE;<br />
m_pot1=0;<br />
m_update=TRUE;<br />
}<br />
<br />
CMyClass::~CMyClass()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CMyClass, CStatic)<br />
ON_WM_LBUTTONDOWN()<br />
ON_WM_LBUTTONUP()<br />
ON_WM_MOUSEMOVE()<br />
ON_WM_SETCURSOR()<br />
END_MESSAGE_MAP()<br />
<br />
<br />
void CMyClass::OnLButtonDown(UINT nFlags, CPoint point) <br />
{<br />
<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );<br />
SetCursor( hIcon );<br />
m_DragOn1=TRUE;<br />
<br />
<br />
CStatic::OnLButtonDown(nFlags, point);<br />
}<br />
<br />
void CMyClass::OnLButtonUp(UINT nFlags, CPoint point) <br />
{<br />
<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );<br />
SetCursor( hIcon );<br />
m_DragOn1=FALSE;<br />
<br />
<br />
CStatic::OnLButtonUp(nFlags, point);<br />
}<br />
<br />
void CMyClass::onmousemove(UINT nFlags, CPoint point) <br />
{<br />
<br />
<br />
if(m_DragOn1==TRUE)<br />
{<br />
<br />
if(m_pot1<62)<br />
m_pot1+=1;<br />
else<br />
m_pot1=0;<br />
<br />
if(m_pot1%2==0)<br />
m_update=TRUE;<br />
<br />
}
<br />
<br />
<br />
<br />
CStatic::onmousemove(nFlags, point);<br />
}<br />
<br />
BOOL CMyClass::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) <br />
{<br />
<br />
if(m_DragOn1==FALSE)<br />
{<br />
<br />
<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );<br />
SetCursor( hIcon );<br />
}<br />
else<br />
{<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );<br />
SetCursor( hIcon );<br />
} <br />
<br />
<br />
return TRUE;<br />
<br />
<br />
}
plz help me out......
thanx in advance.....and thanx for ur intrest!!!!!
|
|
|
|
|
How can I convert an _int64 variable to double?
|
|
|
|
|
How about:
__int64 i64;
double d = (__int64) i64; If you are using the .NET framework, check out the Convert.ToDouble() method.
Another way would be like:
__int64 i64;
char s[32];
sprintf(s, "%I64d", i64);
double d = atof(s); I've not explicitly tried either of these.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How can I turn off all network traffic and then later turn it on again.
Regards
Tobias
|
|
|
|
|
A fixed font should allow 80 columns across a screen. However this doesn't quite fit when there are standard borders around the window when viewed in maximized mode.
Can anyone suggest how I can display a window, based on CScrollView, which does not have the normal side borders. Either no border or a very narrow border.
All suggestions appreciated.
Sara
|
|
|
|
|
Hi,
I want to write an application.
I want to hide it in Task List on Windows 9x/Me.
Please help me !
Thanks.
|
|
|
|
|
Does ShowWindow(..., SW_HIDE) not do what you want?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I use ShowWindow(..., SW_HIDE).
It will be hidden. But It will be shown in Task List.
I don't know the way to hide it in Task List.
|
|
|
|
|
I do not know of a way to hide processes (those items on the Processes tab) shown by Task Manager. Why do you need this functionality?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I want to write an application which run in background. And it cannot be killed by anyway.
Do you know the way to do this ?
|
|
|
|
|
chauhoangtrung wrote:
I want to write an application which run in background.
"Run in background" is a phrase not used with Windows since it is a multitasking OS.
chauhoangtrung wrote:
And it cannot be killed by anyway.
This sounds very suspicious. Can you explain why this should not be considered a virus, worm, or trojan horse?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Have you seen EasyCafe, an application to manage PC room ? I want to write an application same it.
When I use Ctrl+Alt+Del to show Task Manager, I don't see it in Task Manager. So I cannot kill it.
|
|
|
|
|
As I understand it, to trap the Ctrl+Alt+Del keystroke combination requires the creation of a custom GINA DLL.
For Windows 9x and Windows Me, you can use SystemParametersInfo() to trick the system into thinking that a screen saver is running.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The solution trapping Ctrl+Alt+Del (using SystemParametersInfo) is not appropriate for my application. Because it will also trap Alt+Tab.
My application allows users :
- kill other applications (using Ctrl+Alt+Del)
- switch among applications (using Alt+Tab).
I'm finding the way to solve this.
|
|
|
|
|
chauhoangtrung wrote:
I'm finding the way to solve this.
Please let us know when you do.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have just known the way to hide an app on Win 9x/Me :
Call RegisterServiceProcess of kernel32.dll
|
|
|
|
|
That function registers or unregisters a service process. I'm not sure how that compares to hiding an app on Win 9x/Me.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I've just written a program in WinMe. And I saw that it works well :
My program is not shown in Task List.
|
|
|
|
|
Perhaps you should write an article on your findings so that everyone can benefit.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
OK. I will write an article about my findings.
|
|
|
|
|
Whats wrong with my code:
Control ^editText = gcnew frmChangeTxt::txtChangeText();<br />
this->lblText->Text = editText->Text;
I'm using it to try and access the text in text box 'txtChangText' from form 'frmChangeText' and make the label in the main form 'frmMain' that text from the textbox. I'm doing this from a button control in the mainform by the way.
If doing it this way isn't possible, can someone tell me the right way?
Thanks in advanced.
|
|
|
|
|
This doesn't look like VC++ code. Am I missing something?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|