CCommonDlg在哪里是我的adittional功能的正确位置 [英] CCommonDlg where's the right place for my adittional functions

查看:80
本文介绍了CCommonDlg在哪里是我的adittional功能的正确位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hey Guys,



这里是关于CCOmmonDlg的另一个问题。

我有CCommonDlg并将其用作FileOpen或FileSave对话框。

在DoModal中,我将OPENFILENAME-Structure传递给:: GetOpenFileName()/ :: GetSaveFileName()函数。



现在我有一个钩子,所以我可以在窗口内玩一些控件。

我想选择OPENFILENAME Structure传递的文件作为初始文件名。 br />
我的想法是通过FindWindowEx获取Controll-Handley,如下所示:

Hey Guys,

here is an other question about the CCOmmonDlg.
I have a CCommonDlg and use it as FileOpen or FileSave Dialog.
In DoModal i pass a OPENFILENAME-Structure to the ::GetOpenFileName()/::GetSaveFileName() Function.

Now i have an hook , so i'm able to play a little bit with the controlls inside the window.
I want to select the file wich is passed by the OPENFILENAME Structure as the initial file name.
My idea was to get the Controll-Handley by FindWindowEx like this:

HWND hwndParentDlg = ::GetParent( this->m_hWnd );											
HWND hwndShellDllDefView = ::FindWindowEx( hwndParentDlg, NULL, "SHELLDLL_DefView", NULL );		
HWND hwndSysListView = ::FindWindowEx( hwndShellDllDefView, NULL, "SysListView32", NULL );



然后调用


And then calling

ListView_SetSelectionMark( hwndSysListView, nIdx );



选择nIdx-Pos的项目。



实际上我在WM_NOTIFY内的CDN_FOLDERCHANGE消息中执行此操作。

但似乎这里没有SysListView32。

我可以放置我的代码吗?

非常感谢您的回答!



祝你好运,

c3d1


to select the Item at nIdx-Pos.

actually i do this in the CDN_FOLDERCHANGE Message inside WM_NOTIFY.
But it seems like the SysListView32 is not present here.
Where i could place my code?
Thanks a lot for your answers!

Best regards,
c3d1

推荐答案

您应该使用CFileDialog:

http://msdn.microsoft.com/en-us/library/dk77e5e7.aspx [ ^ ]



你可以做你自己的事通过将适当的参数传递给构造函数来尝试:

http:/ /msdn.microsoft.com/en-us/library/wh5hz49d.aspx [ ^ ]
You should probably be using CFileDialog:
http://msdn.microsoft.com/en-us/library/dk77e5e7.aspx[^]

You can do what you're trying to do by passing the appropriate arguments to the constructor:
http://msdn.microsoft.com/en-us/library/wh5hz49d.aspx[^]


这篇关于CCommonDlg在哪里是我的adittional功能的正确位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆