|
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
What I would do is, loop through all of the running process and the search for the process name, once found, i'll get the pid of that specific process. Something like this:
HANDLE h_pro;
HANDLE h_sna;
PROCESSENTRY32 pe_sen = {0};
int result;
int returnValue;
int counter = 0;
char* ProcessNames = Name;
h_sna = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (h_sna == INVALID_HANDLE_VALUE){
returnValue = -2;
return (returnValue);
}
pe_sen.dwSize = sizeof(PROCESSENTRY32);
try{
if (Process32First(h_sna, &pe_sen))
{
do
{
h_pro = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pe_sen.th32ProcessID);
CloseHandle (h_pro);
if (pe_sen.th32ProcessID != 0)
{
result = strcmp (pe_sen.szExeFile,ProcessNames);
if(result > 0){
returnValue = 0;
}
else if (result < 0){
returnValue = 0;
}
else
{
globalVariable = pe_sen.th32ProcessID;
break;
}
}
} while (Process32Next(h_sna, &pe_sen));
}
}
catch(...)
{
GetLastError();
}
CloseHandle (h_sna);
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
But if he only has a thread ID, how is he going to know what name to look for?
Iain.
|
|
|
|
|
|
Can anybody tell me how to disable Or Grayed ToolBar Item..
Thanks...
There Is Nothing Right & Wrong
|
|
|
|
|
Are you using MFC?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I used Crystal Report Viewer to load Crystal Report in VC++
Problem is when i type page number in Page Navigator (ToolBar) and hit enter, the default function (IDOK) is called instead of calling "OnGoToPageNClickedCrviewer1" function.
How to achieve this.
Thanks in advance.
|
|
|
|
|
Is it possible to create a docking output pane with tabbed view (looks like VC++ editor's output window) in scintilla...
very urgent
thanx in advance for any help!!!!!
|
|
|
|
|
Hi,
what is the header file needed to include if i am using CString and my application is
simple win32 application type.
Regards
|
|
|
|
|
|
atlstr.h
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
I'm using Tapi to send data by telephone line. I connect successfully and disconnect too but when I want to reconnect it . It can't initialize successfully and connection fails and I should exit program and run it again.
Agh
|
|
|
|
|
|
Hi,
Hi am using CListCtrl to display the Device type of the PCB components alone. But if i place a cursor on an item in CListCtrl i have to display a tool tip containing some information about that particular item.. Suggestions please..
Thanks in advance,
With Regards,
Sangeetha.
|
|
|
|
|
Pleas refer here[^].
Regards,
Paresh.
|
|
|
|
|
Hi,
I referred and tried it. it works. but i want to display the tool tip with multi lines.
With Regards,
Sangeetha.
|
|
|
|
|
Hi all,
Have you try calling a vc++ dll function from javascipts? I've tried using MFC dll project type but it doesn't work properly. My javascipts always gives an error of " automation can't create object". Is there anything i need to add in my dll code?
|
|
|
|
|
You need automation support for your application. Please refer here[^] for more information.
Regards,
Paresh.
|
|
|
|
|
Hi, is it possible to check other applications that are running, for selected text, and how to get it?
For example when I select some text from MS Word, notepad, internet browser... and then get my app to handle that portion of text for e.g. displaying it in dialog?
If anybody know how this is possible point the way.
Thanks you guys!
|
|
|
|
|
You can ask word for the selected text via COM.
You can send any windows for which you know the handle any Message.
e.g. WM_GETTEXT to a EditControl.
By the way one of Windows most gaping security hole.
You can not get another program to call yours when some event happens.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
I would hot keyed my app when I select some text by myself.
On Select and HotKey-ing, my app would have to query that program (with selected text) for selection ?!
How this can be done?
How to get program's wnd handle?
Thanks for yours interest!
|
|
|
|
|
Can you use the clipboard?
Other application: Copy text to clipboard.
Hotkey to your application.
Your application: Insert text from clipboard.
With Word and Excel (Open-Office too?) you can use automation to query the selected text.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi again,
I have clipboard sorted out, my prime is dealing with selected text!
Thanks, I think I'll turn to Windows Accessibility.
|
|
|
|
|
Actually selecting text is simply a case of drawing it differently, and every application is likely to handle this differently. Heck, they may be including paragraphs, diagrams, all sorts.
But what you CAN do is to monitor the clipboard for copied / cut test. Do a search (here on CP) for clipboard monitor .
If you're just interested in word, then I imagine it does have some mechanism you can use for that.
On a final thought, well behaved applications may work witb the Accessibility API to help blind people know what they've selected, but that will only be with mainstream apps, not *every* one.
Iain.
|
|
|
|
|
Thanks,
I already have Clipboard functionality, I'm interest in what I can do with selected text, that is can I get it from various sources. I also noticed the Windows Accessibility, but before getting inside with it I decided to ask few questions.
Thanks for trying to help me!
|
|
|
|