|
where is your callback declared ?
I assume that it is located in your program.
to make a global hook, the callback must be placed in a dll.
|
|
|
|
|
You got it!
I've just tried it and now it works!!
THANKS!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
I've developed a little systray app using the SystemTray and Wininet wrappers here, but it's memory usage appears to be way more than it should. By using NT4's Task Manager, it's using 3444k, and other programs (like Apache, an FTP client, and Cacheman) use way less (<1mb!). The only program that comes close in memory usage is my web browser!
Any ideas on how to optimize its memory usage? I applied a bunch of exe size optimizations from the tips section, and got my size down to 26.5k, and now I want to un-bloat its memory usage.
|
|
|
|
|
|
Ok, so size doesn't matter; I still want to know why, out those 20+ processes, mine is by far the biggest (not counting the web browser)!
|
|
|
|
|
The size that you see in Task Manager is the size of all the DLLs that are mapped in your address space. You've said that it is a SysTray app, that maps SHELL32.DLL into your space - that is 2.5MB right there. You use WININET.DLL that is 500K more. If you use MFC that is another 1MB. KERNEL32.DLL 700+K, NTDLL.DLL 500K. Look at Dependency Walker and see all the DLLs that are being used by your program. All those other programs you are talking about obviously do not use that many DLLs for one reason or the other.
|
|
|
|
|
This is beginner question Im sure. How do people alter already compiled programs like Yahoo messenger and Icq?
Just really curious. Is it the dll's? And if so, how does one find out about these dll's?
thanks
harry
|
|
|
|
|
Alter the program in what way? Some applications provide support for plugins that you can write to modify and add functionality. Other applications provide an SDK for you to make changes to.
Michael
|
|
|
|
|
you cant send more than 1 message in 3 seconds or something like that but I have recieved 100's in a matter of seconds. I dont want to do this, I just want to know how.. It drives me crazy
harry
|
|
|
|
|
Is there a simple way (preferably in the form of a tutorial or sample) to use the RichEdit view (MFC) to colour syntax dynamically. Say the language the user would type into the program was HTML and i wanted things like :
<HTML>, <HEAD>, <BODY> and so on in blue. Then scripts in red etc...
the syntax would need to be updated so that if i entered a new <SCRIPT> tag as soon as i typed the ending '>' it would turn red. Is there a way of using an array so that i place all the blue words in one array and all red ones in another.
Also is there a way of making text that is between two sets of quotation marks in one colour etc...
Please advise me on this i'm still a bit of a beginner to C++
Thanx
.NET or not .NET? MFC is the question......
(P.S. .NET Server is the biz, when u poor folks get it next year u'll realise )
|
|
|
|
|
See http://www.scintilla.org/.
Should do all you want and more.
i ain't happy, i'm feeling glad; i got sunshine in a bag; i'm useless, but not for long; the future is coming on...gorillaz, clint eastwood
|
|
|
|
|
Thanks that looks like it could work.
If any one else can find a better way i'm open for more suggestions!
.NET or not .NET? MFC is the question......
|
|
|
|
|
|
which site? codeproject?
.NET or not .NET? MFC is the question......
|
|
|
|
|
|
All,
I am loading a string into a CEdit box and want the cursor at the EOL so user can immediately add text.
When I try to use CEdit member function to do this, compiler complains that my variable is a CString type - which of course it is.
Have studied "Using the CEdit control" By Wolfram Steinke but can not duplicate how he assigned 2 variables (a CString type AND a CEdit type) to the same edit box.
Any help would be much appreciated!
Robert
|
|
|
|
|
Create your member variable of CEdit type - MFC Wizard "Add Member Variable" dialog has "Variable Type" combo for this. You can also keep two variables of different types for one control.
|
|
|
|
|
Thanks Alex,
I've got that working (thank-you!), but there still seems to be a "trick" I am missing.
If I write a simple test program that writes to and reads from an edit control, everything seems to work fine.
My "control CEdit" variable is: mc_editkey
=== for example, the following works fine:
mc_editkey.SetWindowText("some stuff");
int len = strlen("some stuff");
mc_editkey.SetSel(len,len,FALSE); //need to put cursor at end
mc_editkey.SetFocus();
UpdateData(FALSE);
===this seems to work fine also;
UpdateData(TRUE);
mc_editkey.GetWindowText(buf, bufmx);
But at other times, the SetWindowText() function does not seem to work and also any attempt to force the cursor to the end of the line also does not work.
Are there any tricks to getting the control to "pay attantion to me"?
Is it possible to issue UpdateData(FALSE) at the wrong time or too many times?
I think there is something(s) fundamental I am missing. For example when the Diaolog Box pops up I want the focus to be in the edit box, i.e. I want the cursor to be there. So in the OnInit function I issue:
mc_editkey.SetFocus();
UpdateData(FALSE);
But it never works.
Much thanks in advance,
Robert
|
|
|
|
|
UpdateData doesn't matter for variables of type Control such as CEdit, CComboBox etc., it works for variables of Value type such as CString, int... To set focus on dialog control use CDialog::GotoDlgCtrl. Don't forget also to set Tab Order in dialog resource editor (Layout menu).
|
|
|
|
|
Thank-you again Alex,
I pretty much have it working.
In the syntax for CDialog::GotoDlgCtrl it asks for CWnd* pWndCtrl as a function parameter.
I confess that I'm not sure which variable to use.
Best to you, Thanks again,
Robert
|
|
|
|
|
Write GoToDlgCtrl(GetDlgItem(nID)) or use variable of control type (CEdit etc.): GoToDlgCtrl(&m_edit_box).
|
|
|
|
|
Alex ... again... thanks,
Got the Init focus problem resolved
Have a good weekend,
Robert
|
|
|
|
|
Hi Robert!
I have encountered the same problem, specifically when subclassing the control.
See this thread.
SetWindowText() does not work well for me,
so I resorted to using ReplaceSel() instead.
To move the caret to the end, try:
mc_editkey.SetSel(0, -1);
mc_editkey.SetSel(-1, -1);
Now, use ReplaceSel to append text:
ReplaceSel(buf);
In your case, I think it might be enough with ReplaceSel(), since it should move the caret to the end.
There is no need to use UpdateData(), it will work anyway.
Do you return FALSE from OnInitDialog()? You must do that when setting the focus on a control. See CDialog::OnInitDialog in MSDN.
Cheers,
/Fredrik
Do you Sonork? I do! 100.11430 PhatBoy
|
|
|
|
|
Thank-you Fredrik,
I pretty much have it working
I appreciate the the reference too!
Best regards, and thanks again,
Robert
|
|
|
|
|
Hi
How can i get the time From the pc clock?
|
|
|
|