I'm making a program and in one of the part of the program there is this button and for it to do main function it needs to check if the notepad is running. So how can i check if the process is running?
emreozpalamutcu 0 Junior Poster in Training
Recommended Answers
Jump to PostIf you're using Windows...
Research some Windows API functions. If memory serves me, you'll want to enumerate the processes then it may be required that you get the path to the executable.
Jump to PostYou can use the Windows API with C++/CLI normally, unless you intend to consume functions/classes that are purely native code with other .NET languages, in which case you will need a managed wrapper around the pure native functions/classes to use them with other .NET languages.
If your project will …
Jump to Postkk
Would this code work?
I done it! Yes! i Have used if to only 2 lines of code and you was asking me to pay you lol!
Still thanks.
actually i realised now it don't work
Fixed it now i need to add couple more features then done!
Thanks …
Jump to Postint isRunning(char *pProcessName) { HANDLE hSnap = INVALID_HANDLE_VALUE; HANDLE hProcess = INVALID_HANDLE_VALUE; PROCESSENTRY32 ProcessStruct; ProcessStruct.dwSize = sizeof(PROCESSENTRY32); hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if(hSnap == INVALID_HANDLE_VALUE) return -1; if(Process32First(hSnap, &ProcessStruct) == FALSE) return -1; do { if(stricmp(strupr(ProcessStruct.szExeFile), pProcessName)==0) { CloseHandle( hSnap ); return ProcessStruct.th32ProcessID; break; } } while( Process32Next( …
Jump to PostI think this should work...
HWND hwnd=FindWindow("notepad",NULL);
All 26 Replies
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
pseudorandom21 166 Practically a Posting Shark
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
pseudorandom21 166 Practically a Posting Shark
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
emreozpalamutcu 0 Junior Poster in Training
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
emreozpalamutcu 0 Junior Poster in Training
triumphost 120 Posting Whiz
cool_zephyr 7 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.