0
저는 C++/CLI를 사용하여 달리 네이티브 DLL 용 WPF 인터페이스를 만들고 있습니다.WindowInteropHelper가 C++/CLI에서 생성되지 않습니다.
닫히지 않고 최소화 할 수있는 창을 만들고 싶습니다. 필자는 검색 한 결과 WIN32 호출 만 수행 할 수있는 유일한 방법이라는 것을 알았습니다. 그래서 다음 코드를 사용하고 있습니다.
// window_ is a Window^initialized from XAML and checked against nullptr
// its WindowStyle is SingleBorderWindow
System::Windows::Interop::WindowInteropHelper helper(window_);
IntPtr winhandle = helper.Handle;
void * winhandleptr = winhandle.ToPointer();
HWND hWnd = static_cast<HWND>(winhandleptr);
SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~WS_SYSMENU);
하지만 winhandle
는 0
의 값을 가져옵니다. SetWindowLong()
호출이 잘못된 핸들로 실패합니다.
내가 뭘 잘못하고 있니?