|
one way is to send WM_GETTEXTLENGTH/WM_GETTEXT message to the edit box.
suhredayan There is no spoon.
|
|
|
|
|
But how can I insert some text in an edit box not in my program? How can I know the ID of that edit box?
Have a nice day!
|
|
|
|
|
|
Hi all
My problem in short is, that I call an external console program and this goes wrong:
1. it stops showing its output after a certain point. But only if called by me
2. it asks for "anykey" at the end. yet it does not accept input from my
This only happens if called by me through CreateProcess. I use umeca74's class to redirect the programs output.
When called from the shell, all works well and I can press "anykey" to end the program.
Does anyone have a clue how I can solve Problem 1 + 2? I'm desperate
Thanx a lot in advance, pat le cat
|
|
|
|
|
Problem #1 sounds like an issue within the class you are using to redirect output. You may want to check with the original author of the article to see if he has any suggestions.
For problem #2, it could be the program you are calling is using one of the functions to 'read any key' that reads directly from the console, rather than from the standard input. If that is the case, you may need to use the SendInput() Windows API function to directly 'inject' a keypress into the keyboard input stream.
Software Zen: delete this;
|
|
|
|
|
Sounds interesting, but since I am creating a foreign process via CreateProcess, how I can send any input to this process? SendInput doesn't offer any parameter for that. I just tried it now and it didn't work. My app is a GUI (MFC) app and the one I'm lauching is a console.
Thanx for that quick answer.
To Problem #1, maybe the console app is using printf() for a few outputs, but is then switching over to some other (maybe unbuffered) kind of console output? How can I gather/intercept all console output?
pat le clueless
|
|
|
|
|
SendInput doesn't need to know which process you are intending the input for, since it is injecting keypresses into the keyboard input stream. It's as if you were pressing the keys on the keyboard yourself.
PatLeCat wrote:
To Problem #1, maybe the console app is using printf() for a few outputs, but is then switching over to some other (maybe unbuffered) kind of console output? How can I gather/intercept all console output?
There may be a method for intercepting console output. Try investigating this topic[^] in the MSDN, which discusses console applications.
Software Zen: delete this;
|
|
|
|
|
Thanx again for your answer Gary.
The thing is, I have not enough means to take over control of another process, as it seems. Sending the Input via SendInput might just do the same as if I was pressing any key, if it directly goes to the keyboard buffer. But I want to target this precise process, which I do by taking over the input-stream. But it didn't work anyhow
With std-redirect I do not take over control of the program but it's output stream. Whereas if it doesn't send output there, I cannot do anyting about it. Unless I find another stream I can take over....
Besides I don't have a console where I could read it's content from. I'm calling this program from my GUI app.
Sadly my problem remains unsolved. This is really very annoying. Something so little becomes such a huge nag.
|
|
|
|
|
I am in the process of debugging an SDI (Single Document Interface) program. I have a very big class (Engine Class) that I call from the FormView class, and I have a few values in the Document class. I use CreateFile, then CreateFileMappingObject to read and write data to and from files from the Engine class. When I tried to use Save As or Open from the Menu for a few integers (not related to the date I am using the File Mapping Object for) in the Document class, the program crashes. If I simply run the program without using Save or Open, it runs. Whenever I use Save or Open, after that, the program fails to map into the files. The data I save and retrieve using Save or Open are NOT related in any way to the FMO data.
When I ran the Engine class in Console mode, whenever I clicked on the (x) to close the program, I would get an error and it would crash. I was thinking it could be related to the CStrings I use, but Im not sure...
Can anyone help me??
If you have further specific questions, I will answer ASAP...
Thank you!
Kem
|
|
|
|
|
Is it possible to programmatically find out if the monitor is connected to the computer? I would be very grateful if someone could provide that answer!
|
|
|
|
|
Hello
I was using EnumDisplayMonitors to find all monitors on the system. Try it.
<br />
EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, NULL);<br />
<br />
..<br />
<br />
BOOL CALLBACK MonitorEnumProc(<br />
HMONITOR hMonitor,
HDC hdcMonitor,
LPRECT lprcMonitor,
LPARAM dwData
)<br />
{<br />
MONITORINFO mi;<br />
mi.cbSize = sizeof(mi);<br />
<br />
if (GetMonitorInfo(hMonitor, &mi))<br />
{<br />
...<br />
}<br />
return TRUE;<br />
}<br />
|
|
|
|
|
Thanks, but unfortunately it still finds the monitor when it's been unplugged
|
|
|
|
|
GetDevicePowerState()
suhredayan There is no spoon.
|
|
|
|
|
Thanks, that function looks to be what I need, but it fails when I use the monitor handle given by EnumDisplayMonitors
|
|
|
|
|
i had make an application (exe) that display the name of user logon to the computer. when i doubleclik on exe it displays the user name. i m using windows xp.
now i want that when computer start my application automatically start can any body tell me what to do.i had made that application in visual c++ not in the .net framework.
ddd
|
|
|
|
|
If you are looking to run your application when a user login, then put a shorcut of your app in the following folder:
%userprofile%\Start Menu\Programs\Startup
or add a string value containing your applications full path in the following registry key.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run <br />
suhredayan There is no spoon.
|
|
|
|
|
will it works for all users of that computer and will my application will become a service ( not seen on process list of CTRL+ALt+DEl) in xp.
someone told me that if it does not work then u had to write the service.
ddd
|
|
|
|
|
tasleem143 wrote:
will it works for all users of that computer and will my application will become a service ( not seen on process list of CTRL+ALt+DEl) in xp.
someone told me that if it does not work then u had to write the service.
As stated in my post, It starts the application only if the user login. To make it work for all user login write to the registry path : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run But remember it requires administrator privilage to write to this key.
But if you are looking to run your application always irrespetive of whether user logs in or not, then you will have to make your application a NT service. There are several good articles here in codeproject to write NT service. CP search.[^]
suhredayan There is no spoon.
|
|
|
|
|
What is a good algorith for removing duplicates from a sorted vector
alex
|
|
|
|
|
It depends. What choices have you considered so far?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
actually i'm kind of lost. i have an idea to copy the first element in the vector and compare it to the rest, if they are equal pop_back(), else continue and so on, but i dont know where to start
|
|
|
|
|
In-place removal is definitely one possibility. See this[^] link for more information.
Alternatively, you could walk the source vector and copy non-duplicates to a target vector.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
hiho@ll
i'm working on a project using directshow
what i need now is a filter which duplicates
i mean, i need a filter which has one input pin and 2 output pins and it only forwards the input to the 2 output pins without any transformation
i need this vor DV video input and the audio input both
anybody knows a filter which can do this for me?
thx@ll
|
|
|
|
|
I am working with c++. How can i change console diplay mode to full screen.
We Believe in Excellence
|
|
|
|
|
Actually, I've used the CMDITabs from this site and been very happy with it. What I want to do is shrink the tab control's width by some amount to make room for a drop down combo box. In other words, to make a control out of CMDITabs (essentially a CTabCtrl) and a CComboBox.
What steps do I need to do? Should I use CMDITabs as a base, or use CWnd as a base and add both components. I frankly don't know where to start.
Thank you.
|
|
|
|