Many Thanks, BrowserUk
! Returning a variable on stack is a fundamental mistake indeed. I change
TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>");
TCHAR * szProcessName = (TCHAR*) malloc( MAX_PATH * sizeof(TCHAR) );
it looks like working well now. but sequenced question is, how free this memory I allocate in C?
That said. I wonder why you aren't using Win32::Process::Info?
I don't using Wi32::Process::Info is because it's running a bit slowly. it uses variable way to get Process info and return too large info to me. In my case, I just want to check process name.
I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction