|
Hi All,
I'm using Visual Studio 2003, and MFC/C++.
I want to simulate just the update/refresh portion of the maximize command, on an ie window. I've already managed to connect to the window and can send minimize and maximize commands to it, as well as move the window around the screen, even hide and show the window if I wish to. I just need to know what message or function I have to pass to that window to get it to do JUST the refresh portion of its maximize command.
Here's some background info and stuff I've already tried:
I have an internet page, that uses java applets served from a server I have no control over. The internet page loads, but none of the background graphics, or button graphics load, so you pretty much have to click on a blank screen and "guess" where the buttons are.
However, if you minimize the window, and maximize (tested over 100 times, by multiple people, under different conditions, with a 100% success ratio), it'll redraw the window properly.
I've tried simulating a very rapid alt+tab and it restored the buttons graphics but not the main graphic (not acceptable to my client). I've also tried the following commands:
::RedrawWindow(hWnd,0,0,RDW_INVALIDATE);
::RedrawWindow(hWnd,0,0,0);
::UpdateWindow(hWnd);
::SetFocus(hWnd);
Any help here would be greatly appreciated.
Thanks,
Brian
|
|
|
|
|
|
Hi
I used RichEdit ctrl with "RICHEDIT20W" for unicode support.
When FindText or FindTextW is called, its getting Failed.
Please could you tell the procedure for utilizing the FindText method
Regards,
nag.
|
|
|
|
|
nagamohan_p wrote: When FindText or FindTextW is called, its getting Failed.
So what does GetLastError() return?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Which either indicates that FindTextW() is not failing, or some other function is being called after FindTextW() but before GetLastError() .
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
FindTextW() returns -1...
AFter calling FindTextW(), immediately GetLastError() is called.
Initially I placed richedit ctrl in dialog...after that RICHEDIT is replaced with RICHEDIT20W in .rc file...
I have to diplay the text with different colors. When RICHEDIT20W is replaced with RICHEDIT, FindText() is not getting failed...
|
|
|
|
|
nagamohan_p wrote: FindTextW() returns -1...
AFter calling FindTextW(), immediately GetLastError() is called.
So you have something like:
long lResult = m_richedit.FindTextW(...);
if (lResult == -1)
DWORD dwError = GetLastError();
What happens if you use FindText() with RICHEDIT ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Here is code: <br />
m_listCtrl.SetListView(LVS_LIST);<br />
LV_COLUMN lsCol;<br />
LV_ITEM lsIte;<br />
lsCol.mask = LVCF_FMT|LVCF_WIDTH|LVC_TEXT|LVC_SUBITEM;<br />
lsCol.fmt = LVCFMT_LEFT;<br />
lsCol.cx = 20;<br />
<br />
char* arColumns[7] = {"Date","I","II","III","IV","V","VI"};<br />
<br />
for(int i=0; i<7; i++)<br />
{<br />
lcCol.iSubItem = i;<br />
lsCol.pszText = arColumns[i];<br />
m_listCtrl.InsertColumn(i, &lsCol);<br />
}
error C2065: 'LVCTEXT' : undeclared identifier
'LVC_SUBITEM' : undeclared identifier
lcCol' : undeclared identifier
left of '.iSubItem' must have class/struct/union type
Generating Code...
Error executing cl.exe.
WHAT IS WRONG?
Given this bug. I need to the a header file or what?
What is this?
|
|
|
|
|
Hakan Bulut wrote: lsCol.mask = LVCF_FMT|LVCF_WIDTH|LVC_TEXT|LVC_SUBITEM;
Should be:
lsCol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it must be overlooked... Thank you very much.
Volkan Cin
What is this?
|
|
|
|
|
I go to control panel and change the regional language & settings as germany
And i start my application it gets hanged.
Will there be any possiblity that language will cause this problem..
|
|
|
|
|
Of course.
It depends what you do... you need to debug it yourself
Greetings from Germany
|
|
|
|
|
|
Hi experts
I want to detect shutdown of the system through my application mine application is a property sheet.
Thanks in advance
RYK
|
|
|
|
|
VC_RYK wrote: I want to detect shutdown of the system through my application mine application is a property sheet.
Handle WM_QUERYENDSESSION .
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
WM_ENDSESSION
prasann
who else
|
|
|
|
|
But i want any API suppose i ahve to use somewhere in console base aaplication.
|
|
|
|
|
VC_RYK wrote: suppose i ahve to use somewhere in console base aaplication.
In that case, you could use the SetConsoleCtrlHandler() API.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've written a control that hosts the web browser which works great when viewing a web page (HTML) but has a problem when viewing an XPS document. When the operator tabs to my host window I send a WM_SETFOCUS message which is processed by the following function:
VOID OnSetFocus(HWND hwnd)
{
IOleObject *pOleObject=getOleObject();
if (pOleObject)
{
RECT rc;
GetClientRect(hwnd,&rc);
pOleObject->DoVerb(OLEIVERB_UIACTIVATE,NULL,pSites,0,hwnd,&rc);
IWebBrowser2 *pWebBrowser=NULL;
if (pOleObject->QueryInterface(IID_IWebBrowser2,(void **)&pWebBrowser)==S_OK)
{
IOleInPlaceActiveObject *pOleInPlaceActiveObj=NULL;
if (pWebBrowser->QueryInterface(IID_IOleInPlaceActiveObject,(void **)&pOleInPlaceActiveObj)==S_OK)
{
MSG msg={0};
msg.hwnd=hwnd;
msg.lParam=1;
msg.wParam=VK_TAB;
msg.message=WM_KEYDOWN;
pOleInPlaceActiveObj->TranslateAccelerator(&msg);
pOleInPlaceActiveObj->Release();
}
pWebBrowser->Release();
}
}
}
The above works fine for web pages as focus always seems to be changed to the first window below 'Shell DocObject View' which for web pages is 'Internet Explorer_Server'. When using the XPS view plug-in there are two levels below which are 'DocObject_Top_Class' and 'HwndWrapper'.
The window layouts when viewing a web page looks like this:
MyHostWindow
ShellEmbedding
Shell DocObject View
Internet Explorer_Server --> This window gets the focus which means the tab key continues to function
The window layout when viewing an XPS document looks like this:
MyHostWindow
ShellEmbedding
Shell DocObject View
DocObject_Top_Class --> This window gets the focus which means the tab key stops working
HwndWrapper[WCP_Hosted... --> Focus should be here so the tab key continues to function
Does anyone know how to sort out the focus problem?
|
|
|
|
|
There is no source code available for the current location!
When my VS2005 run the vc++ project, it will appear above message.
But my VS2005 did not have this problem yeaterday.
How do I solve this problem?
|
|
|
|
|
Release build?
Greetings from Germany
|
|
|
|
|
Hi,
Generally people use 'new' keyword to memory allocation. But I red that it will slow down the process or project. I also know that using virtual memory is one of solution to it. But the thing is, I am not getting how to implement this code in C++/MFC. Please help me to achieve this feat by providing any one of simple program.
Thanking you,
-Jagadeesh Musham
|
|
|
|
|
I will make a citation that I read somewhere (sorry, I don't remember from who it was):
"Early optimization is the root of all evil". Specially in your case if you don't know exactly what you are doing and you just heard that somewhere.
So, are you having troubles ? Is your program becoming slow ? Are you allocating/dealocating a lot (and when I say a lot, read it as really a LOT) of objects ?
If no, then you will probably make things a lot more complex and probably much buggy than they are. Because if you need to implement a system that manages memory allocation in a more efficient manner it's going to be quite complex.
Finally, I really would like to see where you read it and if you didn't interpret the thing out of context (or maybe the author is just plain stupid). C'mon you're not going to experience slowdown if you allocate a bunch of integers or objects.
|
|
|
|
|
Cedric Moonen wrote: I will make a citation that I read somewhere (sorry, I don't remember from who it was):
"Early optimization is the root of all evil".
Knuth: We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." (Knuth, Donald. Structured Programming with go to Statements, ACM Journal Computing Surveys, Vol 6, No. 4, Dec. 1974. p.268.)
BTW, my favorite one on the topic is:
“More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity.” - W.A. Wulf
|
|
|
|