|
'Dual view' is complicated stuff, and this is how it works. If anything can be done to avoid this behavior then that can be done in 'Display Driver', as far as I know.
Cheers,
Vishal
|
|
|
|
|
Hi Vishal,
Could you please give me a hint how to do in "Display Driver"? I never use it. But I would like to try.
|
|
|
|
|
logiqworks wrote: wnd->CenterWindow(parent->GetParent());
Here you should pass i think only parent.
BTW what is parent?? is it main window or just another child of main window??
I hope it helps..
Regards,
Sandip.
|
|
|
|
|
Do you mean to pass only parent like this:
wnd->CenterWindow(parent);
The parent is one child of main window. Because it is complicated to get the main window, so I just use one child window.
|
|
|
|
|
logiqworks wrote: Do you mean to pass only parent like this:
wnd->CenterWindow(parent);
Yes, But does window pointed by parent come in primary display or it comes properly.
You can get the handle to main window using
AfxGetMainWnd();
Regards,
Sandip.
|
|
|
|
|
Hi Sandip,
The situation is that the parent window is initially generated in primary display. I drag it to the secondary display. Then do some operations and pop up some windows. And the pop up window will go back the primary display.
I tried
wnd->CreateEx(menuAlwaysOnTop ? (WS_EX_TOPMOST | WS_EX_TOOLWINDOW) :
WS_EX_TOOLWINDOW,
AfxRegisterWndClass(CS_NOCLOSE), "MenuWindow",
WS_POPUP, rect, AfxGetMainWnd(), 0, NULL);
wnd->CenterWindow(AfxGetMainWnd());
as you said. But the pop up window is still in the primary display. And it doesn't locate in the center of the window.
|
|
|
|
|
May be then you should do
CRect rect;
parent->GetWindowRect(rect);
wnd->MoveWindow(rect.left,rect.top,500,400,TRUE);
this should work i think.
If it works then you can adjust the wnd position according to rect values to where ever you want.
Regards,
Sandip.
|
|
|
|
|
Hi Sandip,
Thank you very much for your so nice help. I tried the code above, but it still doesn't work. I debugged it. rect.left is -2200, rect.right is -786. Does it mean the parent lies in the secondary display? I set the secondary display as in the left side, and the primary display in the right side.
The strange thing is that whatever I do, the pop up window is always in the primary display, the same position.
Best regards,
|
|
|
|
|
I have u URL as a CListCtrl item. When i couble click it the URL page gets opened.
But the same thing i am not able to do when i press enter key what to do. On pressing enter key the ClisCtrrl Disappers.
Please help me.
|
|
|
|
|
Have you used Spy++ to see what messages that control is receiving?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi!
How to check whether a file is present in a particular path?
|
|
|
|
|
See PathFileExists()[^]
Note: You must link to shlwapi.lib and include shlwapi.h to use this API.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
Jijo raj wrote: You could use the api - PathFileExists()[^].
you and rajesh replied almost on sametime
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
bool FileExisting(const char * filename)
{
return GetFileAttributes(filename) != 0xFFFFFFFF;
}
or simply PathFileExists API
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Use the "File" class & check the return value of the below function to check whether the file exists or not.
File::Exists( path )
Regards,
Rane
|
|
|
|
|
Rane wrote: Use the "File" class & check the return value of the below function to check whether the file exists or not.
File class belongs to the .NET framework. We discuss native programming here.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Oops
Regards,
Rane
|
|
|
|
|
There's also _access() .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Or you can use of FindFirstFile .
|
|
|
|
|
Hi,
I have a ClistCtrl control which is being filled by data from the server after every 8 seconds.
Now when when i click a row the selected information is being displayed on another CListCtrl. But when i use keyboard navigatiuon keys to change the row i am not able to show the data updated data.
What i mean to say is that it is working fine for click events as i have used
NM_RCLICK
LVN_COLUMNCLICK
NM_DBLCLK
NM_CLICK
What should i use for navigation keys.
Please help me
Thanks in Advance
Dhiraj
modified on Wednesday, September 10, 2008 7:10 AM
|
|
|
|
|
Hi,
You better use this.
afx_msg void OnSetFocus(
CWnd* pOldWnd
);
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Can u just show me an example
Please
|
|
|
|
|
Hi,
First inherit the CListCtrl class.
Then override OnSetFocus message.
When you select a row in the first List Control. In the OnSetFocus message show the particular row in the second list control..
Thats it..
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
IMO you don't need to handle those four messages. you should handle LVN_ITEMCHANGED instead
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|