|
Hi,
It is not working.
SetTitle will change untitled to some value
but MyApp will won't change.
How to change MyApp name dynamically
|
|
|
|
|
Sorry, I'm very rusty on my MFC, try SetWindowText()[^].
It's time for a new signature.
|
|
|
|
|
Try that ^.
Life is a stage and we are all actors!
|
|
|
|
|
You can solve the problem inspired from here. It's working 100%.
|
|
|
|
|
Thank you.
Any have i have solved like this
CMainFrame* pFrame = (CMainFrame* )AfxGetMainWnd();
CSIRBaseView* pView = (CSIRBaseView* )pFrame->m_pNewView;
CSIRBaseDoc* pDoc = (CSIRBaseDoc* )pView->GetDocument();
CString strDoc, strFrame;
pFrame->GetWindowText( strFrame );
strDoc = "MyApp";
strDoc += strFrame.Right( strFrame.GetLength() - strFrame.Find( "-" ) +1 );
pFrame->SetWindowText( strDoc );
|
|
|
|
|
Thank you for your sharing, it's really useful for me.
|
|
|
|
|
In my app I automate word. In my main window I have buttons for going to first/prev/next/last page. When the user clicks on them I want to make word programatically go to the page. I do this for prev/next
m_Application.CreateDispatch("Word.Application");
.......
m_Browser.AttachDispatch(m_Application.get_Browser());
.......
void CMyView::OnPagesGoToPrevious()
{
m_Browser.Previous();
}
void CMyView::OnPagesGoToNext()
{
m_Browser.Next();
}
But there are no methods for going to first/last page. How do I implement it?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I did a quick check to see what Word (V12) would do if I recorded the 'keyboard equivalent' methods as a macro, and it put this
Selection.EndKey Unit:=wdStory
(for Control-End, go to end of (document?) ) in the macro and this
Selection.HomeKey Unit:=wdStory
for Control-Home to go to the start of the (document?)
So maybe you need to start with a Selection Object .. the MSDN references are a pita though - I couldnt make head nor tail looking at this ... http://msdn.microsoft.com/en-us/library/bb288734(v=office.12).aspx[^]
good luck
|
|
|
|
|
Hi,
I have an application working in DualMonitor also.But in my application.there is no Frame.So,manaully i coded in my application to move to secondary window with one shortcut key.
What my problem is,
In my coding I coded to move applcation by this follwing code:
pWnd->SetWindowPos( NULL, -1024, 0, 0, 768, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
But it works only when the secondary monitor is in Leftside of primary and resolution settings like this numbers.
But i failed to move it the secondary monitor in right side.
So i use the following to get virtual scrren dimesnions
GetSystemMetrics( SM_XVIRTUALSCREEN )
GetSystemMetrics( SM_YVIRTUALSCREEN )
GetSystemMetrics( SM_CXVIRTUALSCREEN )
GetSystemMetrics( SM_CYVIRTUALSCREEN )
it returns as (-1024,0,2304,768).
it returns whole width of two monitors.
But i want only the dimesnions of secondary monitor.
How can i do that?
Anu
|
|
|
|
|
Couldn't you take the width of both monitors and subtract the width of the primary monitor?
You might could also use a combintion of EnumDisplayDevices() and EnumDisplaySettings() .
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi,
AFAIK there are three ways to go:
1.
make some assumptions on the monitor situation; such as they are next to each other, trying to form one larger desktop. Then some simple arithmetic may get you what you want (kind of: x2 stretches from width1 to width1+width2). But that would fail if they were configured vertically.
2.
use GetSystemMetric() to find the size of the desktop; this is the bounding rectangle of all monitors present, however there could be holes in it, when you have a rectangular arrangement (say 3*2) with some monitor missing, or when the resolutions aren't all the same.
see SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN
3.
use some Win32 function, maybe EnumDisplayDevices(), to find out how many monitors there are, whether they all are part of the desktop, and if so, where they are in the uniform coordinate system.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
modified on Friday, May 21, 2010 9:05 AM
|
|
|
|
|
Hello all,
I've a question regarding login and logoff, Now with the help of WM_WTSSESSION_CHANGE i get notification of login and logoff, But at the same time i need to know who is logged in or logged off, But the problem is the shell is not started yet so i can't tell which user is looged on, Is there any way to do it..
Thanks all
|
|
|
|
|
Noone
|
|
|
|
|
Hello
I am using win32 console in visual stdio 2008, but conio.h and graphics.h and ... header files doesn't work. WHAT SHOULD I DO?
Is there any way to make visual studio 2008 compatible with these header files?
Thanks any one help me.
|
|
|
|
|
Hi,
the header files you mentioned aren't standard C++ or C header files. These files were specifically for DOS programming - that's the crufty 16 bit thing that pretended to be Microsoft's operating system until Windows NT came out. It's not the Windows console that you're programming.
If I recall correctly back in the mists of time Microsoft VC++ last shipped those headers with Visual C++ 1.5, which was released in 1993 or so with maybe patches up to 1997. Borland's compiler used to have conio.h but I haven't used that in about 20 years so I can't comment further.
So you've got three choices...
- the best option is find somone that's implemented the functions in the headers in a library for VC++ and then released them
- implement the functions in the headers yourself. This is going to be tricky for graphics.h as you don't set a graphics mode in a console based application and you'll probably have to get to grips with DirectX or OpenGL to do something equivalent. conio for the most part should be relatively trivial
- look at the functions the program you want to use is using and find equivalents in the Win32 API or a 3rd party library, converting the code that calls them as you go
Sorry to be the bearer of bad news,
Ash
|
|
|
|
|
|
Well blow me down, I thought it had gone yonks ago.
Thanks for that.
Cheers,
Ash
|
|
|
|
|
Hi,
I loaded a bitmap in resource and dispaly on window using Bitblt function. How could I load the jpeg and display it on screen.
|
|
|
|
|
|
See here.
Life is a stage and we are all actors!
|
|
|
|
|
Acually my motive is to create grayed image......from colored jpeg to grayed image.
I searched and I found "Setting JPEG Compression Level".
Can I also use same for color settings.
Am I on correct way?
|
|
|
|
|
I want to draw an arc in open gl implented in visualc++ console application but i donot find any function to draw an arc and join the two arcs.Can any one tell me how to do this???
|
|
|
|
|
See this discussion[^].
Did you already set-up OpenGL correctly ? Because if you are new to OpenGL, I suggest you start with the basis.
|
|
|
|
|
Problem with Activex control property pages. when any of the properties are changed and next property page is clicked using tabs and oncancel button is clicked of the property sheet the properties are saved.
When property page is changed onapply is getting called automatically and DoDataExchange function is gets called and properties gets updated even after oncancel button.
Inorder to avaoi this wht needs to be done.
sreenivas003@yahoo.co.in
|
|
|
|
|
Hello everybody,
I like to draw a small border inside my CEdit. To "highlight" it.
I use already OnEraseBgnd to fill the entire CEdit in another color.
But in OnEraseBgnd I can't draw a small border, because the entire Background will be redrawn.
If I handle OnPaint(), it works, but in this case, I need to redraw the entire control myself (text, background, etc ...)
Is there a function-call to draw the standard-appearance, and after it, I start to draw myself on it?
I tested already to call the Parent OnPaint() ( CEdit::OnPaint() ) but this won't work.
Big thanks for any idea or basic instruction
Greetings
|
|
|
|