|
Thanks for the reply, but unfortunately that only works for console/DOS apps (though I tried it anyway) - the app I'm launching is a Win32 EXE...
Thanks for all the suggestions so far,
KB
|
|
|
|
|
|
Hi people !
I must some Pens in my project , but those pens must be created dynamically.
I´ve tried to call new operator , but it always returns NULL :
Pen *PenaI;
PenaI = new Pen(Color(255,255,255,255),1);
(After that , I saw in Debbuger that PenaI is NULL)
Can you help me ?;)
|
|
|
|
|
Hi
If the new-operation fails call GetLastError() to get some more information about the last error.
Look for the error codes at
MSDN library: Error codes
Regards
Frank
|
|
|
|
|
Hi!!
I like to open the web browser in new window and open the site www.codeproject.com. For this purpose i am using the folowing code:
ShellExecute(NULL,"opennew","http://www.codeproject.com","","",SW_SHOWNORMAL);
The above code is not working. If i insert "new" in place of "opennew", it starts working.
Please tell me how can i open browser in new window
|
|
|
|
|
Shah Shehpori wrote:
The above code is not working. If i insert "new" in place of "opennew", it starts working.
Maybe because "opennew" cannot be used unless an actual file is specified (e.g., http://www.codeproject.com/index.htm). To further complicate things, the specified file must be a local file, not an http: file.
I tried several permutations of FindExecutable/ShellExecute/CreateProcess, all to no avail. Internet Explorer does support the -new command-line switch so I think what you want is possible, but just can't put my finger on it at the moment.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hi Everyone,
I want to ask u how to move character on screen. And also voice hearing. Like MSWord office assistant give some speech. I want like that.
If there is any answer,pl let me know.
Thanks
|
|
|
|
|
sunju wrote:
Like MSWord office assistant give some speech. I want like that.
I think this will require a jog through the SAPI forest.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
sunju wrote:
I want to ask u how to move character on screen
Do you need the character to move freestyle across your app's window or to move within its own window (like the Office Assistant)?
Will the movement be dynamic like in a video game, or pre-determined (like the Office assist.)?
If it is to be pre-determined, then you should just create an AVI file and have it play.
|
|
|
|
|
Hi,
I want to access the content of client area of MDI client window. For example, I want to access the content of word document opened in microsoft word from my application. I used EnumWindows() and EnumChildWindow() and reached upto the handle of MDIChild's frame. I can get & set its caption text. But I unabled to change the text of MDIChild's client area which is actual document content.
Can anyone help me to achieve the goal?
Thanks,
DJ
|
|
|
|
|
Word doesn't expose its client area as a control to which you can send a SetWindowText (or any other kind of) message.
If you want to manipulate a Word document from another application, use Word's OLE Automation programming model.
|
|
|
|
|
Hi Mike,
Thanks for replying. Actually, I dont want to access the client area of Microsoft Word. I want to access the client area of a simulator software(from 3rd party). I refer microsoft word just to visualise my problem.
Can you let me know, how to access client area of any standard MDI Child application?
Thanks
DJ
|
|
|
|
|
We had some code, which mysticly worked on NT4
void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
if(nState == WA_INACTIVE)
ChangeDisplaySettings(NULL, 0);
if(nState != WA_INACTIVE){
DEVMODE* pDevMode;
pDevMode = new DEVMODE;
pDevMode->dmSize = sizeof(DEVMODE);
if(EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS, pDevMode )){
DWORD dw_width = pDevMode->dmPelsWidth;
DWORD dw_height= pDevMode->dmPelsHeight;
if(dw_width < 1024){
pDevMode->dmPelsWidth = 1024;
pDevMode->dmPelsHeight = 768;
ChangeDisplaySettings(pDevMode, 0);
}
}
delete pDevMode;
}
}
}
if i am changing my resolution to 800x600 and starting the application the resolution is set to 1024x768 (like i expected...) but the start bar is floating around (when it is set to "stay in foreground".. sorry bad translation... but i have got the german version installed)
i've tried out some parameters for ChangeDisplaySettings.. but it didn't work in the way it did in WinNT..
any ideas ?
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Bernhard wrote:
any ideas ?
Well, I'm not quite sure what you are asking. The subject is about changing the resolution dynamically, which you appear to have working. Yes? However, the post itself mentions a floating start bar, at which point I got lost. What exactly are you after?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
the resolution change works.. but the bar (with the start - button.. i don't know the word for this bar).. doesn't seem to recognise the change.. and so it shows up at the old position (in the middle of the screen)
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Try
RecalcLayout();
to redraw the Framewnd which in your case a mainframe.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hello,
here is my problem; using the GDI+ i draw a string using DrawString() and i draw a rectangle around this string.
But when i scale the view (to simulate a zoom in or zoom out) the string can becomes larger than the rectangle !
It seems that the true type fonts are not truly scalable.
However i read that the GDI+ subtly manipulates the character and word spacing...
Can you help me ?
Thanks a lot.
|
|
|
|
|
Hi !
Did you try to modify the unit parameter in the Font class constructor ?
|
|
|
|
|
Yes, no effects... sorry...
|
|
|
|
|
How are you using the scale ? Are you using an API method ?
|
|
|
|
|
here is the code used;
void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
Matrix myMatrix;
myMatrix.Translate(m_cx / 2.0f + m_fOffsetX, m_cy / 2.0f + m_fOffsetY);
myMatrix.Scale(m_fZoom, m_fZoom) ;
graphics.SetTransform(&myMatrix);
// Create a string.
WCHAR string[256];
wcscpy(string, L"These days, products with VIA's new PT880 and the SiS 655FX are becoming available");
// Initialize arguments.
FontFamily fontFamily(L"Arial");
Font myFont(&fontFamily, 14, FontStyleRegular, UnitPoint);
// the hardcoded coords come from MeasureString();
PointF origin(-753 / 2.0f, 0.0f);
SolidBrush blackBrush(Color(255, 0, 0, 0));
Status status = graphics.DrawString(string, (INT)wcslen(string), &myFont, origin, &blackBrush);
RectF boundingBox;
graphics.MeasureString(string, (INT)wcslen(string), &myFont, origin, &boundingBox);
// Get the height of myFont.
REAL height = myFont.GetHeight(&graphics);
wcscpy(string, L"et blablabla...");
origin.Y += height;
status = graphics.DrawString(string, (INT)wcslen(string), &myFont, origin, &blackBrush);
// here we draw a rectangle around the text, the values come from the initial MeasureString()
// Create a Pen object.
Pen blackPen(Color(255, 0, 0, 0), 1);
// Draw the rectangle.
// the hardcoded coords come from MeasureString();
graphics.DrawRectangle(&blackPen, -753 / 2, 0, 753, 23);
}
|
|
|
|
|
How exactly are you doing the scaling? If you use the ScaleTransform (or whatever it's called) it should work without incident.
Joel Lucsy - You can have it done cheaply.
- You can have it done well.
- You can have it done fast.
Pick any two.
|
|
|
|
|
I'm trying to build a utility that runs a few console commands and directs the output to an edit control.
i.e. Click a button, it copies some files, and the output of the xcopy command shows up in an edit control.
Another desired result (for an entirely different project down the road) - is to be able to interact with the console application. (end user can give input as needed to the application)
It seems like a fairly easy thing to accomplish (fingers crossed), but I'm having a hard time finding sample source code to work from.
Can you point me in the right direction?
===
The workflow that I'm trying to implement is as follows:
1. Copy files from e:\tiff to c:\clients\$customer name$\tiff
2. Convert images from tiff to jpg (I can do this via command line, requires command line parameters - meaning c:\convert.exe /s:conversiontemplate.txt )
3. Create thumbnail size images (also via command line)
4. Create html for web photo album
5. Copy other files to directory for CD-ROM (autorun.inf, drive.ico, etc.)
6. Upload html docs, images to web server. (using dundas tcp-ip)
I want to put these commands in an MFC app so that my receptionist can just click a button and have all the magic happen. I want the output in an edit control so that if there is a problem, the receptionist can copy/paste the output into an email and have me troubleshoot the process.
(Maybe even have a send-to-steve button that handles that part)
===
|
|
|
|
|
skallestad wrote:
...and the output of the xcopy command shows up in an edit control.
Take a look at the MSDN article Q190351, and the one titled "Creating a Child Process with Redirected Input and Output."
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|