|
Tomasz Sowinski wrote:
To kill a process, use TerminateProcess. TerminateProcess needs a process handle - you'll have to use CreateProcess or ShellExecuteEx
... or look it up using one of the MS API's (different for every platform and blah blah blah...).
There is however IIRC a library for this here at CP. Maybe you should browse around a bit.
|
|
|
|
|
Mike Nordell wrote:
... or look it up using one of the MS API's
What if there's more than one instance of 'filename.exe'?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Tomasz Sowinski wrote:
What if there's more than one instance of 'filename.exe'?
Then you're in trouble!
Do you know anything else about the app, like Window Class, Window name? Actually, what do you know about the process you want to kill?
|
|
|
|
|
I have no idea what's the Window Class. Maybe you should ask original poster about that?
Anyway, I think switching from system to CreateProcess/ShellExecuteEx is waaaay easier than firetrucking with enumerating processes.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
What kind of data structure would a control like this use...? What kind of loop would you use to iterate the entire array...? Assuming you use and array and not a linked list or something...?
In a very loosley typed lang would it look anything like this???
struct TREE_ITEM{
TREE_ITEM Parent;
TREE_ITEM Child;
CString Caption;
DWORD CommandID;
}
I'm not really interested in Treeview structures only it's more curiousity about how hierarchial structures work. So please don't mention how I may have missed a field inside the TREE_ITEM structure like CImageList or something...
Using the above structure makes iterating an array confusing as heck.
while(TREE_VIEW.Child){
}
The above seems (I'm almost positive i'm missing something) to trivial???
This would only intereate the top most parent items, but what about children of children and such...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
my experience of iterating CTreeCtrls has always been using recursive functions.
ie (pseudocode)
void ProcessTreeItem(HTREEITEM hti)
{
HTREEITEM htiChild = GetFirstChild(hti);
while (htiChild)
{
ProcessTreeItem(htiChild);
htiChild = GetNextChild(hti, htiChild);
}
}
|
|
|
|
|
Hi,
i have 2 questions about helpfile handling :
1 : How can i open a Help file from the Application ?
2 : How can i open a Help file with a specific topic ?
Thanks !
Marco
|
|
|
|
|
|
i need something like mutex that will not be destroyed by windows after the process terminates, so another process can see it later on. any help plz?
|
|
|
|
|
First of all I do not know sth about this, but I think this is bad design what You achieve with this. Think of many processes leaving their garbage in memory after they have terminated. This will lead to many problems. If You want to do sth like this You could create a new process where in its main it is only creating this mutex as You need it. The behaviour could be controlled by command line arguments.
|
|
|
|
|
You don't need a mutex replacement. Do it like MS, use the bloated ini-file-from-hell (the registry).
|
|
|
|
|
This is possible, in principle, using native NT API. Every kernel object that is represented by a handle has an internal "persistent" flag, that protects it from close (until next reboot) even if the last handle to it has been closed. Of course this makes only sense with named objects, because you have to find it later on.
However, this works only NT4 and above.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Something like the lockfiles with Linux?
|
|
|
|
|
I've written a class library in VC6 before, and now compiled to VC.NET now. It uses pointers to link with different classes within the library. Now, I want to use C# to develope the interface, but I need intensively use the class library. Can I do it ?
|
|
|
|
|
how can I get my IP address on the Internet when i am connected to internet via LAN (i am not talking about the static IP which we get using ipconfig command) i want to know the dynamic IP of my computer when i am connected via
LAN.
and plz one more thing...can netmeeting be done when two computers are on the internet but on two different locations behind the LAN network.
thnx
Rashmi
|
|
|
|
|
drmzunlimited wrote:
can netmeeting be done when two computers are on the internet but on two different locations behind the LAN network
Check here...
http://bbs.adslguide.org.uk/postlist.php?Cat=&Board=multiuser[^]
I believe it is not possible to run Netmeeting (or any other video chat except yahoo messenger) from behind a NAT router...
Blade[DMS]
|
|
|
|
|
I am trying to implement a CRC check in my program. I built my program and as a test I used a program that I found to check the CRC of my program. The program gave me the CRC as "708f0d1". With out making changes to any of my code, I rebuilt my program and ran the CRC check again. This time it said that the CRC was "94d40369" I wanted to put code in a dll that would check the CRC value of my program with the expected value, but if the CRC changes when you compile or build your program how is it possible to implement this type of check. If you can help me it would be appreciated.
Thanks.
|
|
|
|
|
Anonymous wrote:
how is it possible to implement this type of check
regenerate the code that tests the CRC each time you rebuild the EXE - make it a post-build step in your EXE project.
-c
Gourmet, n:
Anyone whom, when you fail to finish something strange or
revolting, remarks that it's an acquired taste and that you're
leaving the best part.
|
|
|
|
|
Ok, thanks, I will try it.
|
|
|
|
|
Hello again,
Please tell me What first message affter OnInitialDialog ?
I mean first message after dialog loaded ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Why ?
I'm not sure of the answer, but maybe the answer to your problem lies elsewhere....
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
The best way to find out what messages are coming to your window (and in what order) is to run Spy++ on the application.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
IIRC the first message any window get is WM_GETMINMAXINFO (or is it NC_CALCSIZE?).
Perhaps you should add some printf-debugging to your dialog main procedure and check for yourself?
|
|
|
|
|
The fact that you're asking the question suggests a problem with your design.
It is unwise to rely on any message order (except WM_NCDESTROY). The order of messages may vary from one OS to another or when other circumstances change.
As other posters have said it shouldn't be difficult to find out which message arrives first after WM_INITDIALOG but you should not depend on it always being the same.
Regards,
Phil
|
|
|
|
|
Is there an api that I can use to check if the current user is administrator.
Thank you
Orcun Colak
|
|
|
|