|
How can I trap all windows messages - not only the ones sent to my application but all messages in the system?
modified 9-Mar-17 17:21pm.
|
|
|
|
|
You will have to deal with the messages using Hooks.
It's a suggestion that hooks should only be used if necessary.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Daniel Kanev wrote: How can I trap all windows messages - not only the ones sent to my application but all messages in the system?
Check Here to get sample of message hooking.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hope this helps you:
click here[^]
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Daniel Kanev wrote: ow can I trap all windows messages - not only the ones sent to my application but all messages in the system?
try to set SystemWide hook with SetWindowsHookEx with WH_CBT as parameter
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
Dear developers,
I am a Visual C++ developer and facing heat & difficulties from VC++.Net. It has changed the whole structure. With the introduction of Classes in .Net, programming in Vc++.net is very different from Vc++ And I find it hard to migrate to VC++.Net. Moreover, There are hardly any newsgroups favoring VC++.Net. Tell me Is It an end to VC++ future? Will VC# be our next programming language?
To me .Net appears equal to Java with the class concepts.
Kindly explain a simple example like adding two integers in VC++.Net.
Gagan..
|
|
|
|
|
You can also use the existing C++ syntax for adding 2 integers.
As Anshuman's signature,
Somethings seem HARD to do, until we know how to do them.
Check MSDN for more info about C++/CLI
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
in a console based application the code goes like this
int i=10;<br />
int j=20; <br />
int k=i+j;<br />
Console ::WriteLine (k.ToString());<br />
and yes as far as the answer to your second question is concerned let me make it clear with thousands of developers working on VC++ it's not going anywhere right now. It would take a long time to make applications without VC++ for half of the world
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 2:49 Tuesday 13th June, 2006
|
|
|
|
|
Thank you! but I am unaware of the programming pattern in VC++.Net or else is it the same as in VC++
//Taking simple interger addition function as an example
#include....
void main(void)
{
int i=10,j=20,k;
k=add(i,j);
Console::WriteLine (k.ToString());
}
int add(int a, int b)
{
return (a+b);
}
Please also tell me that to which header file does this ToString() function belong?
Thanks Once again
Gagan..
|
|
|
|
|
|
There are classes belonging to the System namespace.
Ex:
Int32 belongs to System namespace and ToString is the overriden function in that class.
The programming technique is a bit different when it comes to using .NET .
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
currently i am using the ADC0808 to change analog signal to digital and RS-232 serial cable to interface with my computer.But i face a problem how to write the Visual c++ or Matlab program for interfacing and signal processing.So any one interested to help is very welcome.
thank you in advance.
|
|
|
|
|
|
Hello,
I have to replace the occurances (which is near about 700) of a macro say ASSERT with its extended functionality say EXT_ASSERT. I can do in the following ways:
1. #define ASSERT EXT_ASSERT - but in this case if anyone want to use ASSERT he can not use it.
2. replace all the 700 occurances - replacing like this is difficult and more error prone.
Can any one tell me the better way of doing this.
Thanks and regards,
Ritesh S.
|
|
|
|
|
Ritesh wrote:
if anyone want to use ASSERT he can not use it.
what do you mean anyone ??
ASSERT is works in DEBUG mode only.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello! Mr. Ritesh
This question is quite interesting. I also even tried typedef but failed. But you can create a small string-based program that can read the whole file and will replace the string ASSERT with the specified word "EXT_ASSERT" simultaneously. I know its a lengthy and time-consuming procedure.
I hope there would be another way to solve this problem.
Gagan..
|
|
|
|
|
Ritesh S. wrote: replace all the 700 occurances - replacing like this is difficult and more error prone
Replacing in multiple files is less difficult if you use Edit --> Find and Replace --> Replace in Files command and specify Match case and Match whole word options.
|
|
|
|
|
I have created a modeless dialog box(suppose dlg2) and is being shown when a button is pressed in another dialogbox(dlg1).The problem is when dlg2 is o n top of all the windows i am clicking on the dlg1. It is getting activated but not comming to top of all windows. How to do this.
Please help me regarding this.
Thank You
KIRAN
|
|
|
|
|
kiran.pinjarla wrote: The problem is when dlg2 is o n top of all the windows i am clicking on the dlg1. It is getting activated but not comming to top of all windows. How to do this.
If your dlg1 is also Modeless then check how you showed the dialog which may restricts your dlg2 to come at front.
Knock out 't' from can't,
You can if you think you can
-- modified at 2:12 Tuesday 13th June, 2006
|
|
|
|
|
are you setting the style of the dialog as child.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
This may be the wrong way to do it, but you could set the parent for the second dialog to the Desktop window like GetDesktopWindow() .
this is this.
|
|
|
|
|
Use:
HWND GetActiveWindow(VOID);
and then use BringWindowToTop() function
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Nish has a good work around for this problem. this one i have taken from voidnish.com
He says:
How to steal focus on 2K/XP
I bet that sometimes you long for the old days when a simple SetForegroundWindow brought your dialog into focus. Sigh! Now with 2K/XP things have sorta changed so that if you try a simple SetForegroundWindow you end up flashing the taskbar icon a few times (I never counted but something tells me it flashes thrice). Not exactly what you wanted to do, eh? Luckily there are ways to bring your dialog into the foreground.
The trick is to use AttachThreadInput to attach the thread that owns the current foreground window to our thread, then call SetForegroundWindow and then detach the attached thread, again using AttachThreadInput. Cool, huh?
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),TRUE);
SetForegroundWindow();
SetFocus();
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),FALSE);
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
Hi,
I have used Splitter window and did a (1 row,2 cols ) split and Created Views for the Corresponding two panes. The View in the left pane has tree control in it and in the right pane has form view.
If I Click on the Items in the left pane I don't have any problem but if I
click the view in right pane and again click the left pane I am getting an exception.
CCreateContext context;
context.m_pCurrentFrame = NULL;
context.m_pCurrentDoc = GetActiveDocument();
//Getting an Exception in the above Line
context.m_pNewViewClass = NULL;
context.m_pNewDocTemplate = NULL ;
Any suggestions Please
Thanx in advance
|
|
|
|