|
I don't think there is an easy way to track an application. The Handle returned by ShellExecute() is not a handle, but a value.
There are other ways you can track an application like: Events , Mutexes etc.
this is this.
|
|
|
|
|
zahid_ash wrote: Hi,
I have lauchned an application B from my application A using ShellExecute() , it will return a Handle.
How can I track in application A that application B is closed at certain stage?
You may keep track of process by enumrating the running processes in specific time stamp.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
if u r application happens to be an .exe then u can get Processid.Using it u can track application B in Application A.This might help u.
never say die
|
|
|
|
|
Process32First and Process32Next to get the Processid:->
never say die
|
|
|
|
|
In order to see that a process was closed, you need its "handle". Please compare ShellExecuteEx and CreateProcess in order to see which is more suitable to obtain the handle. Then use the handle in the following mode:
if(::WaitForSingleObject(handle, 0) == WAIT_OBJECT_0)
{
}
else
{
}
If you want to wait until the process is closed, then specify a timeout value in WaitForSingleObject . See this function for more details.
|
|
|
|
|
Use SHELLEXECUTEINFO with ShellExecuteEx() and the structure has a member "hProcess" this is the handle to newly created process.
suhredayan There is no place like 127.0.0.1
|
|
|
|
|
HI.
I am running my application using command prompt.
like C:\> D:\App.exe
after launching this Application the command prompt come back to prompt again
like C:\>
does it means that application has been ended . but the appliccation is still running
then how can I come to know that application is still running using command prompt
thanks
Regards.
|
|
|
|
|
when you type : c:\ D:\App.exe and comes back to c:\
it will happen ...Here you are not changing the drive to access but just specifying the path of your exe.
Your exe will start as a new process ....so you have to eplicitly terminate your application
Cheers
"Peace of mind through Technology"
|
|
|
|
|
OK, Thanks.
But I have one more question that when we run Format command or some other command on Comand prompt, then why these comand are not run as new process. they usualy run in same command prompt and will not free the prompt until the command execution ends
Regards.
|
|
|
|
|
zahid_ash wrote: Format command or some other command on Comand prompt
That is because those are Command-line applications. Back in the days of DOS, all applications were Command-line.
this is this.
|
|
|
|
|
zahid_ash wrote: HI.
I am running my application using command prompt.
like C:\> D:\App.exe
after launching this Application the command prompt come back to prompt again
like C:\>
does it means that application has been ended . but the appliccation is still running
then how can I come to know that application is still running using command prompt
if the application is Command prompt based then it runs fine...
but if it is windows based then application chooses the windows platform to run and application's info enters into windows enviornment not into DOS environment even it run from command prompt.
if you want to check the application running state then you have to check into running processes by enumarating processes or any other way.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
CAN SOMEBODY HELP ME PLZ
iam using mfc with mysql
how can i fetch only single row from mysql table from vc++(MFC)
when i write
mysql_query(myDB,"SELECT * FROM empinfo4 e,proinfo4 p");
(" WHERE empid = \'" + f + "\' and e.gid = p.gid ");
res=mysql_store_result(myDB);
if (!res)
{
MessageBox("Could not run query");
}
row = mysql_fetch_row(res);
this will give the first row from the mysql table only
it will not give other rows
how can i fetch other row when i give id on form at run time and it will fetch the row which matched in the mysql table
so id is recieved by:
GetDlgItemText(IDC_EMPID,id);
here id is value which i enter in the edit control
and i want that whenever i enter id value it display only that row which matchee in the mysql table row
plz help me in this regards
hi
-- modified at 1:02 Tuesday 6th June, 2006
|
|
|
|
|
Hi all,
I'd like to know, whether itz possible to send "Integers" and "arrays" through a RS-232 interface??is there any way to do it??
Thanks in advance,
rajeev
-- modified at 0:40 Tuesday 6th June, 2006
|
|
|
|
|
The RS232 interface is just that, a simple interface. How you send data depends on your protocol.
The tigress is here
|
|
|
|
|
I believe it is possible, but you would have to send them over byte by byte, and then decoding them back to the original form at the other end. Actually much of the time, you would create an array of some data, either ASCII or Binary, but it takes the same way to send.
this is this.
|
|
|
|
|
rajeev82 wrote: I'd like to know, whether itz possible to send "Integers" and "arrays" through a RS-232 interface??is there any way to do it??
Rs232 only understand Bytes.. so you have to interpret your Sending and receiving data!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
On MouseMove event, how to capture a particular listitem? Basically, want to change the cursor on mouseMove on a specific column of the list control. Need to put a hand cursor on mousemove event. If the mouse is moved on a specific list item. only parameter in OnMouseMove is CPoint. Unable to get the subitem name.
Any clues please.
Thanks
Raji
|
|
|
|
|
Use the CListCtrl::SubItemHitTest() method to determine which item and subitem the mouse is over
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I used the following code. But it does not take the correct column.
The part of code is in OnMouseMove event:
void CListt::OnMouseMove(UINT nFlags, CPoint point)
{
CPoint pt(point);
ScreenToClient(&pt);
LVHITTESTINFO hitInfo;
hitInfo.pt = point;
int nItem = -1;
nItem = m_list.SubItemHitTest(&hitInfo);
if (nItem >= 0)
{
m_list.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED);
}
if (nItem >= 0 && hitInfo.iSubItem > 0)
{
int m_nSubItemHit = hitInfo.iSubItem;
if ( hitInfo.iSubItem == 8)
SetCursor(hCursor);
}
}
I need to change the cursor if subitem is "8". But even if move the mouse on the 8th subitem, the value of hitInfo.iSubItem is some thing else. moreover nItem is always -1.
Any clues please
Thanks
Raji
|
|
|
|
|
You don't need to call ScreenToClient() as the point is already in client coordinates when your message handler receives it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
if I known the CLSID={986A04A31-C417-432F-A4EA-3243D7B681CFF0}
how could I load this component without a file name?
if there is also a filename with the CLSID,such as 'test.dll',
how to load this componet then?
Thank you.
|
|
|
|
|
For a registered COM object the normal way to instantiate it is by using the CLSID via the CoCreateInstance API.
Steve
|
|
|
|
|
CString sguid =_T("{8FA04A31-C417-432F-A4EA-63D7B681CFF0}");
CLSID clsid;
USES_CONVERSION;
if (SUCCEEDED(CLSIDFromString(T2OLE((LPCTSTR)sguid),&clsid)))
AfxMessageBox("We have got CLSID");
CoCreateInstance(clsid,NULL,0,??,NULL);
But,How to set the fourth param? And If I also got the filename,how to use it?
thank you!
|
|
|
|
|
Using ATL I'd use code something like this:
CComPtr<IUnknown> spUnk;
spUnk.CoCreateInstance(clsid);
Note however that it's very strange to create a COM component and not to know which interface you want from it.
Steve
|
|
|
|
|
[General]
;This is the name displayed in Myie2 which indicate your plugin
Name=PowerBand
Author=AWater
Version=1.0
ModuleType=COM
Comments=PowerBand
Type=M2Plugin_SideBar
FileName=PowerBand.dll
CLSID={8FA04A31-C417-432F-A4EA-63D7B681CFF0}
HotIcon=pb.ico
Icon=pb.ico
This is a pluin.ini of PowerBand for myie.
I want to known how to run this plugin in code.
I tried but failed. Could you give me a help?
Much thanks.
Alick
|
|
|
|