|
can anybody tell me where a static variable get stored in memory
Thanks in advance
|
|
|
|
|
The static variables are stored in the .data section of the corresponding module.
|
|
|
|
|
Hi at all,
is there a possibility to look which code is behind the function ::SetFocus(m_hWndFocus) ?
Because even i set the m_hWndFocus to a given control, Focus will not set on this control,
it changes to another control on the view ...
Big thanks for help
Greetings
|
|
|
|
|
I don't think you can see code of WinAPI functions. In any case I can assure you that there is no bug in that function and looking at code of SetFocus is not going to help you fix your problem. Maybe if you share how exactly are you using SetFocus then someone can help you find the problem.
-Saurabh
|
|
|
|
|
Many thanks for you help!
Sure, in ::SetFocus isn't a bug, but maybe i can see why it doesn't accept my control.
I have the following action:
A View into a frame has some textboxes and a "self-created*" Grid.
If i hit a button a thread searches the elements and displayes all into the Grid.
If i hit ENTER on the Grid, i post a message wich creates a new View and switches
the view of the frame with this new view.
In the second view i have the possibility to hit ESCAPE and re-switch the first view on the frame.
So i went back to the first view, but the focus isn't no more on the Grid (where i left) but it's on
a textbox...
During i switch the view of the frame i call also a NewView->SetFocus() to set the Focus on the actual view of the frame...
If i set the m_hWndFocus manually on the Grids-Handler the ::SetFocus(m_hWndFocus) don't affect it
and sets the focus anyway on the textbox.
Big thanks for any help
* = not with the ressource designer, but with "new" and "Create(...)"
Edit:
OK, i find the bad code ...
It was a part of code which is running good for (A) and goes wrong with (B)
Thanks anyway
modified on Monday, April 28, 2008 9:51 AM
|
|
|
|
|
can we find whether a window belongs to particular application?
I want to find through code but not through spy++.
Actually I have dc of wiandow which I am converting it to handle now I want to know whether it belongs to our application or not...
Expecting favourable reply.
|
|
|
|
|
|
GetWindowModuleFileName(..) is not supported in winxp showing error even after incuding windows.h or winuser.h
are there any similar API's?
|
|
|
|
|
Actually it should be supported. What error do you get?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
'GetWindowModuleFileName' : undeclared identifier
|
|
|
|
|
On my system (I'm using VS 2005 ) GetWindowModuleFileName declaration is in winuser.h .
Furthermore, the function properly works on my XP OS .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
Super Hornet wrote: I am using Visual Studio 6.0
Then you probably need to get an updated Platform SDK.
Super Hornet wrote: I have found this message in MSDN: It doesn't work for other processeses on Windows 2000, XP and Vista.
http://msdn2.microsoft.com/en-us/library/ms633517(VS.85).aspx[^]
Well that maybe true, but it has nothing to do with the error you reported.
BTW some info about GetWindowModuleFileName failure on XP here [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Okay my bad this function work only if the calling process owns the window. using GetWindowThreadProcessId you can get both thread id and process id. Once you have process id then you can simple compare with your process id to check if window belongs to your application.
-Saurabh
|
|
|
|
|
Im not sure but I think I saw an article on the codeproject it was like spy++.
|
|
|
|
|
I am new to C++. I am trying to PostMessage a left mouse click so I can make a desktop sharing application. So far when I post the message, it does not post to the coordinate I make with MAKELPARAM.
<br />
HWND hWnd = GetDesktopWindow();<br />
LPARAM l = MAKELPARAM(30, 50);<br />
PostMessage(hWnd, WM_LBUTTONDBLCLK, 0, l);
The above succesfully clicks the desktop, but at a point completely differnt than 30, 50, as it clicks my start menu bar. Also, using WM_LBUTTONDOWN as opposed to WM_LBUTTONDBLCLK does not do any clicking. Any ideas?
Thanks!
modified on Monday, April 28, 2008 5:35 AM
|
|
|
|
|
A few tips, take 'em or leave 'em...
1: You may want to learn about the differences between screen/absolute coordinates and client coordinates
2: You may want to learn about which messages use which coordinates (screen or client) and under which circumstances
3: You may want to learn about how a "click" is a mouse-button down event followed by an up event, and that a double-click event is generally sent by controls that receive two consecutive click events, not by the mouse/system proper
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for the advice. I am aware of the differences between screen coordinates and client coordinates, though I am unsure about number 2. As for number 3, I tried doing a down followed by an up to no avail.
Thanks for the response!
|
|
|
|
|
|
I want to display font of other language(not english) in edit control.
so please tell me how it is possible .
Trioum
|
|
|
|
|
For instance (_UNICODE defined):
TCHAR szABC[]= {0x03B1,0x03B2, 0x03B3, 0x0000};
SetDlgItemText(hDlg, IDC_MY_EDIT, szABC);
to display the first three (lower-case) letters of the Greek alphabet.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
no no not this way.As I want to direct type on the Edit control in another language font.
Trioum
|
|
|
|
|
And you don't want change system locale, do you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
actually I want to type in the another language in the edit box and then save this value to the data base for further procesing. my clients donot
understand english .they need everything in their own language . even
vlaues in data base in their own language.
Trioum
|
|
|
|
|
What about this [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|