1
I'm trying to open a new folder in the same window that is already opened. This is the code:
if (DirectoryExists(myfolder)) {
HWND currenthwnd,hwnd;
hwnd=NULL;
currenthwnd=GetForegroundWindow();
if (currenthwnd!=hwnd)
{
hwnd=currenthwnd;
if (hwnd!=NULL)
{
ShellExecute(hwnd, "open", myfolder, NULL, NULL, SW_SHOW);
}
}
}
但它每次都會打開一個新窗口。我怎樣才能做到這一點?C++在已打開的窗口中執行「打開」