|
Not sure its possible but, Spy++ gives you a graphical view of the system’s processes, threads, windows, and window messages.
Using Call Stack[^] you can view the function or procedure calls that are currently on the stack but not the source of windows messages.
--
"Programming is an art that fights back!"
|
|
|
|
|
Elsie wrote: In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.
There are no documented methods to determine the source of a window message. However the InSendMessageEx Function[^] can be used to determine if your window is currently processing a message from SendMessage.
Anyway... your application needs to handle WM_PAINT as the system generates it. If you have Vista Aero/Glass enabled then your application may recieve a greater number of WM_PAINT messages and your window update region is not completely under your control.
Best Wishes,
-David Delaune
|
|
|
|
|
Using MFC VC6.0
I have a Dialog box with simple buttons on it. In the buttons caption I have used the '&' symbol to define an accelerator key to the button. ie I have "&Exit" in my exit buttons caption. The resource view shows the button correctly with an underscore below the 'E' in the exit. However if use the "test" (ctrl T) option within the resource editor or compile and run the code then I don't see the undersocre below the 'E' on the button.
Why might this be ? Have missed some option I should have set ?
|
|
|
|
|
Press and release the Alt key. The underscores are hidden until you do this.
|
|
|
|
|
Press the Alt key when your dialog is up, that should make your underscores visible.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Yes, that works, thanks. Is there an option I can add to OnInitDialog() to make them appear straight away ?
|
|
|
|
|
This is a user option. Even if there is a way to do this programmatically, it would be a Bad Thing.
|
|
|
|
|
Not that i know of but that doesn't mean it can't be done.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Neil Urquhart wrote: Is there an option I can add to OnInitDialog() to make them appear straight away ?
You can modify the registry to turn on the "Hide underlined letters for keyboard navigation until I press the Alt key" checkbox. Let me check my notes. As Hans has said, making a change to something that the user may have turned off/on might not be looked upon highly.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
A user can control this (on XP) by going to Display Properties | Appearance | Effects and clicking the checkbox "Hide underlined letters for keyboard navigation until I press the Alt key".
|
|
|
|
|
Hello,
i've created several dialogs for my Tab-Control.
Now i'd like to update a ListBox on the main Dialog by clicking a Button inside one of the Tab-Dialogs.
How may i address the control variables from my main-Dialog?
When i try "GetParentOwner" i cant see the functions or variables, i have declared in my Dlg-Class.
Any guess?
Ty
|
|
|
|
|
Don't have to guess, this is a standard situation that comes up with all dialogs. Look at CFontDialog , for example. You will see a bunch of GetXXXXX() APIs, that the parent can use to access dialog info, after the user hits OK.
In this case, you can set a UserClickedButton variable in your dialog class, that the parent can access. Or even better, implement a GetUserClickedButton() API. If you need to update the listbox immediately, the tab dialog can send a user message to the parent.
|
|
|
|
|
But it aint possible to access membervariables or even instanced classes?
|
|
|
|
|
You can access any member variable declared public. However, it is better form to use accessor APIs.
|
|
|
|
|
Due to my low knowledge on API's and due to the fact that adressing public variables is my lifetime goal i need to know how i may adress them.
i tried to pass the this pointer from the main dialog to the tab dialog. this worked well, but the pointer didn't hold any of the functions or variables declared public.
how is it possible then?
|
|
|
|
|
Are you using C++? Is this an MFC app?
|
|
|
|
|
|
In that case it's pretty simple. Just declare a variable in the child dialog. You can declare it public, or create GetXXXX() API. When the child dialog exits (when user clicks ok), the parent can get data from variable.
If you want to send parent immediate notification, send a user defined message when button is clicked. To do this, when child dialog is invoked, be sure to pass pointer to parent (usually pParent - this is usually defined as CWnd *pParent). Then child dialog can send message by pParent->SendMessage(...).
|
|
|
|
|
Ty,
i just learned how to handle messages
works really well.
|
|
|
|
|
|
Hello all,
I have a function like below
int fn_RecognizeWord(TCHAR** strUnicode)
{
string unicodeStr;
.....
//Problem in this line
strcpy(strUnicode[0],unicodeStr.c_str());
}
How can i initialize into 'strUnicode' variable using 'unicodeStr' variable. For example 'unicodeStr' variable contains just a single line of string, like '80653478'.
Thanks to all
|
|
|
|
|
What is the problem ? Did you initialize your strUnicode array properly ? What I mean is, did you create an array of TCHAR* of the correct size, then for each of these pointers allocate the correct number of characters ?
The second step is probably easier to do once you know the size of your string:
strUnicode[0] = new TCHAR[unicodeStr.size()];
strcpy(strUnicode[0],unicodeStr.c_str());
|
|
|
|
|
It is not working. I testing it with MessageBox(), but this statement not working
|
|
|
|
|
What do you mean it's not working ? Could you explain what you are expecting, what do you get and show some code ?
|
|
|
|
|
Actually it gives "Please tell Microsoft about this problem." window when it executes that line
|
|
|
|