|
Thanks.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
how to run the command "ipconfig" using createprocess. anyone knows thecode
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Is there any way to hide the DOS window that
shows when system command is executed. system("Dir/ar>File.txt");
lists the readonly files to the file.txt.
Arise Awake Stop Not Till ur Goal is Reached.
-- modified at 0:07 Tuesday 6th March, 2007
|
|
|
|
|
Consider using ShellExecute , and use last parameter nShowCmd = SW_HIDE to hide the command window
|
|
|
|
|
i cant use shell execute i can use only system("");
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: i cant use shell execute i can use only system("");
Why ?
I doubt if there is such option with system .
|
|
|
|
|
yes we can execute a dos command from mfc like system("Dir/ar>File.txt");
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: yes we can execute a dos command from mfc like system("Dir/ar>File.txt");
I was talking about hiding command window.
|
|
|
|
|
oh sorry. i have post thread for that only. i need to hide the dos window. is there any option
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
What is that you want to do? Is prasad's answer not helping you? Have you tried ShellExecute ?
A friend is, as it were, a second self.
- Marcus Tullius Cicero
|
|
|
|
|
shellexecute rund only certain commands. its not woking for netsh. i am getting output with system("netsh > c:\ipconfig.txt"); but i have to hide the dos window
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: shellexecute rund only certain commands.
ShellExecute executes everything that can be executed. The problem may be that netsh is not accepting parameters passed on to it.
If you need to Hide the dos window, that can very well be done. Pass SW_HIDE as the last parameter while calling ShowWindow .
ShellExecute(m_hWnd,"open","netsh","","",<code>SW_HIDE</code>);
Let us not listen to those who think we ought to be angry with our enemies, and who believe this to be great and manly. Nothing is so praiseworthy, nothing so clearly shows a great and noble soul, as clemency and readiness to forgive.
- Marcus Tullius Cicero
|
|
|
|
|
yes thanks its working
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
You can execute DOS commands with ShellExecute and have the DOS window hidden. Try this:
ShellExecute(
NULL,
"open",
"cmd",
"/C \"Dir/ar>File.txt\"",
NULL,
SW_HIDE
);
Steve
|
|
|
|
|
I have set this from the property window but doesn't set.what should i do?
I am working in win32(.NET).
Amit
|
|
|
|
|
Hi Amit.
Though I am not sure abt .NET environment as I haven't used it before, but this code snippet certainly works for VC++. See if it is helpful for you
Here I have trapped the WM_CTLCOLOR message for the dialog box on which the static control resides.
HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( nCtlColor == CTLCOLOR_STATIC )
{
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(255,255,255));
hbr = static_cast < HBRUSH >(GetStockObject(NULL_BRUSH));
}
return hbr;
}
Sameer Thakur
|
|
|
|
|
thanks sameer. you are right I have completed it in the same way as
you shown me in vc++.
|
|
|
|
|
|
can anybody please tell me what's the coding for changing filled color n line color of an ellipse and a rectangle using C++ (Graphical User Interface)?
|
|
|
|
|
The Rectangle and Ellipse functions use the device context's current pen and brush for the lines and fills.
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC DC = BeginPaint(m_hWnd, &ps);
HPEN Pen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
HBRUSH Brush = CreateSolidBrush(RGB(0, 0, 255));
HGDIOBJ OldPen = SelectObject(DC, Pen);
HGDIOBJ OldBrush = SelectObject(DC, Brush);
Rectangle(DC, 10, 10, 200, 200);
SelectObject(DC, OldPen);
SelectObject(DC, OldBrush);
DeleteObject(Pen);
DeleteObject(Brush);
EndPaint(m_hWnd, &ps);
}
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I am trying to draw text on a bitmap, and the text has a lot of jaggies in it. I am using native Win32 calls like TextOut to draw the text.
The only way I have found to reduce the jaggies is to draw the bitmap really large, then scale it down through a StretchBlt call, which is very inefficient.
Is there another way to accomplish what I am looking for, either in Win32, or using the .NET framework?
Thanks!
|
|
|
|
|
Is it text that gets saved with the bitmap or just used at display time?
For saving you don't have a lot of choice. If the bitmap is small and it's later always displayed
zoomed then it's going to be jagged, unless some kind of smoothing/interpolation is used for the
zoom.
If used at display time then you could adjust the font size based on the zoom factor.
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
When you create the font, either with CreateFont() or by setting up a LOGFONT , you can set a quality. Try ANTIALIASED_QUALITY and see if that gives better results.
|
|
|
|
|
how to run a batch file from mfc
|
|
|
|
|
You can use of CreateProcess
|
|
|
|