|
Hi,
From within my application i need to wait for an external process to complete before proceeding. But all i have is the external process's name. Is there any API that returns the process id or handle given the process name ?? I tried using CreateToolhelp32Snapshot but it does not seem to work in VC41 in which my application is built. It works fine in VC6 though.
Thanks for ur help.
|
|
|
|
|
You can not to get the Handle of the process from the process name, you need to do the contrary. You must to enum the process handles or Ids and the get the process name
You need to use the psapi.dll library.
You must to use the EnumProcessModules function and then the GetModuleFileNameEx function to get the filename of each process.
Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
Thanks a lot. That works.
|
|
|
|
|
hi all,
i am facing a problem with the setwindowrgn ,It works fine on Winnt but in the case of WIN98/ME the function always RETURNS 0..which indicates that it is a failure.
can anyone suggest me anything regarding this .
thnx in advance .
regards
udaykumar
|
|
|
|
|
Can somebody tell me how to get all file path name in a specified folder? Thanks.
|
|
|
|
|
CString theFileNamePath;
CString extension("*.txt");
CString filePath("C://");
CString completeFilePath;
HANDLE handleToFind;
WIN32_FIND_DATA FindInfo;
WIN32_FIND_DATA *FindInfoPoint = &FindInfo;
completeFilePath.SetString(filePath+ extension);
handleToFind = FindFirstFile(completeFilePath,FindInfoPoint);
while(handleToFind != NULL)
{
theFileNamePath = completeFilePath+ FindInfo.cFileName;
//....SOMETHING....
if (FindNextFile(handleToFind,FindInfoPoint) == 0)
break;
}//while
FindClose(handleToFind);
hope that'll do
|
|
|
|
|
Hi MASTERs,
I am using CDC::TextOut() to display lines in the screen. Imagine that I want to display the following line:
1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789, [Put a double byte kanji character]
1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789, [Put a double byte kanji character]
1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,
If you run in Windows 2003 Japanese, you will see that the 3rd line is aligned properly on the screen but it is NOT aligned properly when you do printing or print preview (no matter which font you are using, the alignment always wrong).
Now, if I remove the comma, both printing and displaying works fine (aligned the line properly).
1234678912346789123467891234678912346789123467891234678912346789 [Put a double byte kanji character]
1234678912346789123467891234678912346789123467891234678912346789 [Put a double byte kanji character]
1234678912346789123467891234678912346789123467891234678912346789
It is only happening in Windows 2003 Japanese and Windows XP Japanese (I haven't check Chinese version yet, but I think it will have the same problem).
Any idea? Please help...
Thanks...
|
|
|
|
|
No one ever encounter this problem? Please help...
|
|
|
|
|
Is it possible to invoke a .exe file into the code of VC++?
If possible then how is it done?
|
|
|
|
|
Have a look at how ShellExecute() works...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
In which class does it belong to?
Actually , I am a newB in VC++.
|
|
|
|
|
This Is Example for using the ShellExecute.let you want to open the Notepad.exe. so ShellExecute will be used this way....
::ShellExecute(NULL,
"open",
"notepad.exe",
"",
NULL,
SW_SHOWNORMAL);
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Use ::CreateProcess function
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
Is it possible to invoke any class written in java within VC++?
I know, the vice versa is possible by "native " keyword and compiling with javah.exe and so on...
|
|
|
|
|
Anyone know of a pixel perfect correct way to determine the width/height of various control parts, thqat takes into account the current font used for the control?
For example, what are the correct dimensions of the a standard check box or radio button?
What about the proper height for a combo box or push button?
GetSystemMetrics() only covers certain general things. Any other solutions? I have tried to create a function that works out the pixels given a value in dialog units and a font, but this doesn't seem quite right.
For example, if you wanted to create a custom control that gets used as a header, how would you accurately determine the default header height so it matches to what the header in the ListView control has?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
|
toxcct wrote:
GetWindowPos()
There is no such method in the Win32 API...
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"
|
|
|
|
|
Hi guys, i'm writing an intros but it drives me crazy when someone says:
"Hey it says that i have no msvcrt/d.dll"
Is there any chanse to link those dlls so their copying into the intro dir wouldn't be needed?
Grtz.
|
|
|
|
|
You have two options.
1. Don't use the c run time - use C++ functions.
2. Distribute the msvcrt dll
Also, NEVER distribute a debug build, so that no-one ever asks you for a debug DLL again.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi!
I'm writing a program which needs to recieve a lot of data though a socket. Another application sends a lot of small portions (like 50 byte) of data (measurement data) to it over the network, like 1000 messages per second.
Which socket communication is the best/fastest? Right now I testet a blocking CSocket in its own thread, but that really slows down the machine. But how should I do instead? Any tip? Should I use CAsyncSocket instead, and how? Blocking or non blocking?
Thankful for any suggestion!!
|
|
|
|
|
|
I used
SetWindowPos(NULL, 0, 0, 100, 100, SWP_NOZORDER);
in OnInitDiaolog() (msvsC++6,.NET, dialog based project)
and as a result window appeared in the middle of the screen.
Then I try SetWindowPlacment(), it works, but only if window not hidden at startup.
How can I move window to (0,0) in OnInitDiaolog()?
(at present I use SetWindowPos(NULL, -1, 0,...)
|
|
|
|
|
Perhaps you need to clear the dialog style's DS_CENTER bit?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
No. With DS_CENTER all ok (it's not set). Function works correctly if you set any position except (0, 0). If you move window in (0,0) window appears in the center that's my problem.
|
|
|
|
|
hi all ,
help me how to get the current system name in the program..
|
|
|
|
|