打开一个文件夹 我写了一个后台程序 我想得到当前打开文件夹的绝对路径
 
不知道可以么?

解决方案 »

  1.   

    The GetCurrentDirectory function retrieves the current directory for the current process
    这个估计得HOOK了,发现HOOK的程序转到前台了,就获取一下路径通知给你的后台程序
      

  2.   

    首先要获得当前打开的文件夹的句柄 然后用GetCurrentDirectory
      

  3.   

    CWnd   *handle; 
    handle=GetForegroundWindow();
                   TCHAR buf[512];
    handle->SendMessage(WM_GETTEXT,sizeof(buf)/sizeof(TCHAR),(LPARAM)(void*)buf);
      

  4.   

    HWND EditWnd;
    EditWnd=FindWindowEx((HWND)handle,0,"Edit",NULL);
    if(!EditWnd) return 0;
    handle=CWnd::FromHandle(EditWnd);
    楼上的方法只能得到窗口的名字 但我想调用如上方法得到编辑框可总是空的!