|
Many thanks you all helped me on this thread
Everything seem that is difficulty
Let me describe again
Assume you create new Win32 Application project with select "a typical Hello Word ! application ". When you execute this project, system will show a window contain "Hello Word !" string.
I expect to replace string "Hello Word!" with value of cammand "netstat -n"
Example: replace "Hello Word !" with
"Proto Local Address Foreign Address State
TCP 127.0.0.1:1148 127.0.0.1:1149 ESTABLISHED
TCP 127.0.0.1:1149 127.0.0.1:1148 ESTABLISHED
TCP 127.0.0.1:1150 127.0.0.1:1151 ESTABLISHED"
many thanks
|
|
|
|
|
created project Win32 Application and use this is function that help me to archive my goal
[code]
DWORD RunSilent(char* strFunct, char* strstrParams)
{
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
char Args[4096];
char *pEnvCMD = NULL;
char *pDefaultCMD = "CMD.EXE";
ULONG rc;
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;
Args[0] = 0;
pEnvCMD = getenv("COMSPEC");
if(pEnvCMD){
strcpy(Args, pEnvCMD);
}
else{
strcpy(Args, pDefaultCMD);
}
// "/c" option - Do the command then terminate the command window
strcat(Args, " /c ");
//the application you would like to run from the command window
strcat(Args, strFunct);
strcat(Args, " ");
//the parameters passed to the application being run from the command window.
strcat(Args, strstrParams);
if (!CreateProcess( NULL, Args, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&StartupInfo,
&ProcessInfo))
{
return GetLastError();
}
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
if(!GetExitCodeProcess(ProcessInfo.hProcess, &rc))
rc = 0;
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
return rc;
}
[/code]
I run this function with argument:
RunSilent("java -version","2>> javaVersion.txt");
many thanks you all helped me more
|
|
|
|
|
Hi.
I want to retrieve the response, by sending a request with an Agent name to a http server.
Can anybody please help me.
Thanks.
Kishore
|
|
|
|
|
|
Hi Friends,
Im using a dialog based window.which is used to enter some text & then
I want to generate a RTF report & print it.
Any help will be appriciated.
Thanks in advance.
Reagards
Shiva
|
|
|
|
|
Shivarudrayya wrote: Any help will be appriciated.
Read the first message in the thread titled "How to get an answer to your question" pay attention to item #2.
|
|
|
|
|
Hi, i'm trying to draw EMF or WMF files in an antialiased way.
I tried GDI+, AA drawing is ok when using DrawLine or other primitives but the DrawImage doesnt produce
AA output when beeing passed a Metafile object containing a WMF or EMF
So is there a way to draw EMF/WMF files with antialias ? (with or without gdi+)
Maybe something exists in order to convert EMF/WMF to EMF+ ? (it seems gdi+ can only AA on EMF+ files)
thanks for your help
|
|
|
|
|
hi all
i have five list control in report mode on my single dialog when i click one and go to second,third,fourth and five by clicking the cell of list control i want to change the color of cell of list control only where i click the particular cell of list controls,
how can i do this,reply please i will be so greatful
thank u in advance
malik
|
|
|
|
|
Anything in Windows that there's not a documented interface for, you can usually accomplish through Windows subclassing.
In your case, to sketch out a solution, you would subclass the list control window, and then handle in all liklihood WM_PAINT. On that message, you would send LVM_GETITEMRECT to the list control window, and get the bounding rect of the list control cell you were interested in. Then just BitBlt whatever color you want to the hdc of the window, using the dimensions of the rect you retrieved (possibly using PATBLT for a ROP code, first setting the hdc brush to the appropriate color.) So that's the basic idea.
Actually, although I'm not sure I entirely understood you, the above solution might not work if you BitBlt to the cell and then the original WinProc writes text over it, as the textbackground color may be wrong, unless its being drawn transparent. Of course, there's SetBkMode to make the text background transparent, but I don't know how you get this to work for the hdc the original WndProc is writing to. It looks like you've got some work to do on your own, but its certainly not impossible. Also there's LVM_SETTEXTBKCOLOR, FWIW.
-- modified at 11:09 Thursday 25th October, 2007
|
|
|
|
|
LVS_OWNERDRAWFIXED the list-view control sends a WM_DRAWITEM message to paint eachitem
|
|
|
|
|
please give some light on your approach because i am new for mfc
malik
|
|
|
|
|
do an article search for lvs_ownerdrawfixed. there are two that look particularly interesting to solve your dilemma, one by Muhammad Azam[^] and one by Piotr Szewczyk[^]
|
|
|
|
|
If you mean with color the item-selection and that only the current listtrl has a selection... you can play with the KillFocus to unselect the item/subitem when changing of ListCtrl. You should have no colors on any unselected ListCtrl.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
please give some more light on your approach because i am new to mfc
malik
|
|
|
|
|
I am familiar with win32 app development, c, masm, and some kernel knowledge(mainly from the book "programming applications for ms windows" by Jeffrey Richtie).
Who could give me some suggestions? Thanks a lot.
|
|
|
|
|
Finding a good single resource for learning drivers is very tough. It can be a complex subject, and requires a lot more knowledge of how the OS works than app level programming.
Here's the usual list that is given on other forums when the question arises.
The WDK itself - documentation andthe samples are improving but it assumes you already have a good knowledge of the OS
"Programming the Windows Driver Model" 2nd ed by Walter Oney - make sure it is the 2nd edition
"Microsoft Windows Internals, Fourth Edition: Microsoft Windows
Server(TM) 2003, Windows XP, and Windows 2000" by Mark Russinovich and David Solomon
"Windows NT Device Driver Development" by Peter Viscarola and Tony Mason - dated but the stuff they discuss hasn't changed and it's a good foundation.
"Developing Drivers with the Windows® Driver Foundation" by Penny Orwick and Guy Smith - this one is from Microsoft Press and is the only book currently published with a good description of KMDF
This one should be excellent (if they ever get it published) "Introduction to the Windows Driver Foundation Kernel Mode Driver Framework " by Peter Viscarola, Tony Mason, Mark Cariddi, Brenda Ryan, Scott Noone, and OSR
Judy
|
|
|
|
|
See here.
"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
|
|
|
|
|
Dear All,
I have three MFC Exes.My Installer runs all three exes as soon as I install my application.It works fine.I made entries in registry so that after rebooting My exes will automatically run.
But some times I faced very unusual problem,
I installed my application then rebooted my system After rebooting my all MFC exes of my application get deleted from my hard disk.
Please help me for solving this issue.
Rahul Vaishnav
|
|
|
|
|
Rahul Vaishnav wrote: Please help me for solving this issue.
Viruses!, because Windows didn't delete anything,till it instructed too.. you can also check Installer, might be somebody have play a prank on you.. MoveFileEx is famouse for playing prank with people. as it delete the file at reboot, if you use proper flags!
"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
|
|
|
|
|
Hello,
I have a question about callback function.
My code is waveInOpen(&hWav,0, &wfx,WaveInCallback ,0, CALLBACK_FUNCTION);
But it comes some problems, the error message is
error C3867: 'p2p::Form1::WaveInCallback': function call missing argument list; use '&p2p::Form1::WaveInCallback' to create a pointer to member
I dont realize what happened.
Can anybody solve this question for me?
Jane
|
|
|
|
|
This error happens when you tried to take the address of a member function without qualifying the member function with its class name and the address-of operator.
Can you show the callback function declaration?
- NS -
|
|
|
|
|
OK.
void CALLBACK WaveInCallback(HWAVEIN hw, UINT uMsg,
DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD dwParam2)
{
waveInAddBuffer(hw, (WAVEHDR*)dwParam1, sizeof(WAVEHDR));
}
I create it in the From.h.
But I don't know where to allocate it.
|
|
|
|
|
Isn't it a static function? AFAIK it should be static function.
Also I found a mismatch with the documentation in MSDN. See...
void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD dwInstance,
DWORD dwParam1,
DWORD dwParam2
);
You are using DWORD_PTR instead of DWORD. But I am not sure about this
- NS -
|
|
|
|
|
Appreciate for ur reply.
But it's still same.
|
|
|
|
|
Try to cast like
waveInOpen(&hWav,0, &wfx,(DWORD_PTR)WaveInCallback ,0, CALLBACK_FUNCTION);
- NS -
|
|
|
|