|
-
May 1st, 2010, 12:57 PM
#1
trying to convert char* to LPCWSTR
I'm trying to use the following function:
DWORD test = GetTargetProcessIdFromWindow("Untitled - Notepad");
DWORD GetTargetProcessIdFromWindow(char * WindowName)
{
HWND targetWnd;
targetWnd = FindWindow(NULL,(LPCWSTR)WindowName);
DWORD procID = GetWindowThreadProcessId(targetWnd, NULL);
return procID;
}
but targetWnd always returns 00000. Does anyone know how to properly convert from a string to LPCWSTR ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|