|
why not use a splash screen?
|
|
|
|
|
Yes it could be. And I also could use a dialog with a progress, which I already have.
But, I don't want them! Besides, the problem remains, and I don't want a workarround (wich I already have, via the WM_PAINT).
The real problem is: why do I get a WM_SHOWWINDOW message and the form is not visible? What message sould I expect after the form is shown?
I don't want a workarround, just to understand the message sequence...
ALMC
|
|
|
|
|
Hello everybody,
I am writing a simple application in MFC , similar to Spy++ Utility , that displays different information about chosen window.
I want to draw that black rectangle(like in Spy++) over windows ,when mouse is over that window. I manage to draw it , but when i move mouse to another window the rectangle stays on the previous window and on the new also.
I used to store previous windows handle and when the mouse was over another window i used to call the Invalidate() function for the previous window.
For some strange reasons this worked on 90% of the windows , there were some windows where the rectangle stayed partialy.
Can anyone suggest me any another way of achieving this??
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Look here:
http://www.codeproject.com/dialog/windowfinder.asp
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
I've seen this article already , but this program is written in with Win32, and i could not implement the technique Lim is using there in MFC
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Giorgi Moniava wrote:
...this program is written in with Win32, and i could not implement the technique Lim is using there in MFC
Why not?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
thanks alok
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Giorgi Moniava wrote:
thanks alok
Mention Not Buddy
"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
|
|
|
|
|
Here is a server that receice UDP visit.
The parameters of socket include the destination IP address and port.
Moreover, how to get the source IP address and port?
Thanks!
|
|
|
|
|
If you're using accept , the second parameter is an optional pointer to a structure that contains source information.
|
|
|
|
|
Hi folks!
I'm working on a MFC project and i've got a question to make. The project i'm involved in, is a dialog based aplication. So, the Wizard took the first steps of the work. I'm basing the program on an example that has been created entirely programming, and it makes reference to a HWND handle variable that is necessary to pass to one of the methods.
The code is like this:
Code:
HRESULT CText::BlendText(HWND hwndApp, TCHAR *szNewText)
{
LONG cx, cy;
HRESULT hr;
CSubtitlesDlg dialog;
// Create a device context compatible with the current window
HDC hdc= GetDC(hwndApp);
HDC hdcBmp = CreateCompatibleDC(hdc);
// Write with a known font by selecting it into our HDC
HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
// Determine the length of the string, then determine the
// dimensions (in pixels) of the character string using the
// currently selected font. These dimensions are used to create
// a bitmap below.
int nLength, nTextBmpWidth, nTextBmpHeight;
SIZE sz={0};
nLength = (int) _tcslen(szNewText);
GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
nTextBmpHeight = sz.cy;
nTextBmpWidth = sz.cx;
// Create a new bitmap that is compatible with the current
//window
HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth,
nTextBmpHeight);
ReleaseDC(hwndApp, hdc);
// Select our bitmap into the device context and save the old one
BITMAP bm;
HBITMAP hbmOld;
GetObject(hbm, sizeof(bm), &bm);
hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
...
I make a reference to this method in another class like this:
Code:
hr = Text.BlendText(___________, Text.g_szAppText);<- I need to know what to put in here
Does anybody know which method do i need to use in order to get this handle to the window i'm working with? I wonder if the question is clear, but i'll try!! Many thanks. Serj.
|
|
|
|
|
Did you try
AfxGetMainWnd()->m_hWnd
John
|
|
|
|
|
In continuation with Mr John... , you can use this tooo
AfxGetMainWnd()->GetSafeHwnd
"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
|
|
|
|
|
I am trying to get the text from a control in another process. I know the handle for the control and I know the afx class name. It is as follows:
Class Name : Afx:400000:20
This control is part of a chatbox in an external application. I have tried several different things but I have so far failed to get the text from it.
Any ideas or help would be greatly appreciated.
Thanks.
Dave
|
|
|
|
|
cats8199 wrote:
I have tried several different things...
Such as?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I have tried sending the messages EM_GETLINECOUNT and WM_GETTEXT. Both return zero. This is a multiline text box. I have tried treating it as a CListBox, a CComboBox and a CListCtrl. All to no avail.
Dave
|
|
|
|
|
cats8199 wrote:
This is a multiline text box. I have tried treating it as a CListBox, a CComboBox and a CListCtrl. All to no avail.
It's no surprise! Why haven't you tried CEdit instead? That, however, is not the problem here. If neither EM_GETLINECOUNT nor WM_GETTEXT worked, using an MFC class is just added complexity.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Send the WM_GETTEXT message to that control.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
I have tried sending the messages EM_GETLINECOUNT and WM_GETTEXT. Both return zero. This is a multiline text box. I have tried treating it as a CListBox, a CComboBox and a CListCtrl. All to no avail.
Dave
|
|
|
|
|
Check out this article, it has code that does what you want.http://www.codeproject.com/tools/WindowScraper_Utility.asp[^]
If you tried sending a WM_SETTEXT message to the window and it doesn't work, it could because the authors of the control did not implement a WM_SETTEXT handler. I see this error quite often in custom controls. What a lot of people seem to do is override the GetWindowText() function, instead of adding a WM_GETTEXT message handler.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I read MSDN whole day, but it didn't work. I need some example or good FAQ.
|
|
|
|
|
I mean TAPI for 2 modem connection (not internet).
|
|
|
|
|
have you tried this article[^] ?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
this may help u.. Click
Regards,
V
|
|
|
|