|
Have a look at the popen() function.
|
|
|
|
|
Thanx for the replies
I did find something that looks like it's exactly what I want here: http://www.codeproject.com/threads/consolepipe.asp.
Apparently I wasn't searching for the right keywords
-- modified at 7:11 Tuesday 10th January, 2006
|
|
|
|
|
Does anybody know how to detect if there are system global window hooks present? Piece of code, freeware, or a solid pointer to where I may find the information, is highly welcome.
|
|
|
|
|
Jörgen Sigvardsson wrote: Does anybody know how to detect if there are system global window hooks present? Piece of code, freeware, or a solid pointer to where I may find the information, is highly welcome.
I've seen this question asked before, and as far as I know, you cannot do it (at least in user mode) in 32 bit Windows. I believe it was possible in the 16-bit days.
So, you'd probably have to go the kernel route and try some undocumented stuff.
Alternatively, you could hook the hooker - SetWindowsHookEx, when Windows starts.
Regards,
Nish
|
|
|
|
|
I've seen shareware apps claiming they can detect window hooks, but I have yet to find a free one. Nor do they provide any technical detail on how it is done (trade secrets ).
Nishant Sivakumar wrote: Alternatively, you could hook the hooker - SetWindowsHookEx, when Windows starts.
That won't help me much, as I'm trying to detect what's messing up my keyboard input. I know (from dabbling with hooks myself), that it is easy to screw up the keyboard handling, if you do not pass all messages to the next hook on the chain. I remember failing to forward "peeks" to the next chain, which caused the accelerator translation to fail in some instances, depending on key up/down sequences in n-key combinations. The symptoms I'm witnessing right now matches such bad hook behaviour. The only problem is that I have no hooks installed on this machine...
|
|
|
|
|
Jörgen Sigvardsson wrote: I've seen shareware apps claiming they can detect window hooks, but I have yet to find a free one. Nor do they provide any technical detail on how it is done (trade secrets ).
Do any of them work?
Jörgen Sigvardsson wrote: That won't help me much, as I'm trying to detect what's messing up my keyboard input.
Well, if you hook it, you'll at least know what program it is that's putting a silent hook without your knowledge.
Regards,
Nish
|
|
|
|
|
Nishant Sivakumar wrote: Do any of them work?
One of them appeared to work, as far as I could tell.
Nishant Sivakumar wrote: Well, if you hook it, you'll at least know what program it is that's putting a silent hook without your knowledge.
How, exactly...?
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Jörgen Sigvardsson wrote: How, exactly...?
I think I wasn't clear in my original post. I meant an API hook on SetWindowsHookEx . The 3rd parameter to SetWindowsHookEx is an HINSTANCE to the DLL where the hook procedure is located. So if you have an API hook on SetWindowsHookEx, you can locate those DLLs (and possibly the parent exes too) that attempt to set a hook.
Regards,
Nish
|
|
|
|
|
this will only work if you somehow manage to patch SetWindowsHook for every running process...
the information you require is only available in kernel-mode. You will need a driver to access it. Under the current PEB structure for a process is a pointer to the PDESKTOP kernel object. Under this there is a linked-list of further difficult-to-understand kernel structures, some of which contain info about hooks and the DLLs that they belong to.
You need WinDbg+Symbols+lots of patience
James
Microsoft MVP: Windows SDK http://www.catch22.net
|
|
|
|
|
Hellow,
the type of Key is "int". can someone help?
|
|
|
|
|
i don't know about CMap ; i tried to use it when i designed the 1st version of VisualCalc but came back to the old standars C++ std::map<>.
if it is like the standard map, the map is already sorted by the "key".
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
thanks,i will have a test on CMap.
|
|
|
|
|
|
I got the result. it seems it is sorted by the time when item was put in.
|
|
|
|
|
xyhan wrote: I got the result.
Great!
But toxccts advice still stands: Stop using CMap and use std::map
CMap is Microsoft proprietary and is the legacy of a time when Microsofts C++ compiler was too braindead to cope with a STL. And when the STL itself was still in the process of definition.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi there,
Because of a post on the wrong forum i have to write this again...
I have to display a page in a little webbrowser on my dialog app and want to display the webpage background in the same color as the dialog background.
How can I get the Windows Standard Dialog Background color?
thx in advance
best regards
Michael
|
|
|
|
|
if you're talking about your windows configuration, this would better be placed into the OS/Admin forum than into a pure programming forum. anyway, i will not spam CP much than it is already.
you go there :
Start Menu > Control Panel > Display , Appearence Tab > Advanced Button.
there, under each category, you have one or more colors, which you can click on...
if it is not what you asked for, please reformulate with more details about what you have, what you need and what you do...
thx
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
toxcct wrote: Start Menu > Control Panel > Display , Appearence Tab > Advanced Button.
there, under each category, you have one or more colors, which you can click on...
I think he wanted to get it using the Win API ...
~RaGE();
|
|
|
|
|
Rage wrote: I think he wanted to get it using the Win API ...
yes, looking at nish's answer made me though of this too... but the question was not clear enough i find...
;P
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
seems that some guys have no humour (refering to the vote '1' my post have been shot - but strangely, not the first one )
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
:tease:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
master87 wrote: How can I get the Windows Standard Dialog Background color?
You can use GetSysColor with COLOR_BTNFACE .
Regards,
Nish
|
|
|
|
|
@toxcct <ironie>thx for the very helpful post. here we have of corse a windows forum and not a visual C++ forum
I know but this doesn't work.
CString rgbcolors;
rgbcolors.Format("%d,%d,%d", GetRValue(COLOR_BTNFACE), GetGValue(COLOR_BTNFACE), GetBValue(COLOR_BTNFACE));
rgbcolors returns "15,0,0"
And thats black not the dialog gray.
|
|
|
|
|
ow, that was my mistake...
now it works...
COLORREF col = GetSysColor(COLOR_BTNFACE);
CString rgbcolors;
rgbcolors.Format("%d,%d,%d",GetRValue(col),GetGValue(col),GetBValue(col));
|
|
|
|
|
Do this :-
DWORD color = GetSysColor(COLOR_BTNFACE);
cout << (int)GetRValue(color);
cout << (int)GetGValue(color);
cout << (int)GetBValue(color);
Regards,
Nish
|
|
|
|