wtl

Custom draw CProgressBarCtrl win32

旧时模样 提交于 2019-12-11 11:14:47
问题 I want to have a custom progress bar control, for example showing some moving oblique lines or like this or drawing an image inside the progress bar control. I 've searched the web and some examples of custom drawing for listviews and dynamic subclassing but the code doesn't call the painting methods: public: BOOL SubclassWindow(HWND hWnd) { ATLASSERT(m_hWnd==NULL); ATLASSERT(::IsWindow(hWnd)); BOOL bRet = CWindowImpl<CMyProgressControl, CProgressBarCtrl>::SubclassWindow(hWnd); return bRet; }

WTL Child window event handling

孤人 提交于 2019-12-11 01:47:53
问题 I am developing window application in that I am having 2 child windows on left and right side. I want to handle input events for both windows separately. How to achieve it? My code: class EditorWindow : public DxWindow { public: CSplitterWindow m_vSplit; CPaneContainer m_lPane; CPaneContainer m_rPane; PropertyDialog m_propertyWnd; DECLARE_WND_CLASS(_T("Specific_Class_Name")) BEGIN_MSG_MAP(EditorWindow) MESSAGE_HANDLER(WM_CREATE, OnCreate) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER

CAppModule vs CAtlExeModuleT , getting the application message loop

你。 提交于 2019-12-11 00:53:29
问题 I am trying to get the message loop from a ATL::CAppModule in my project, there seems to be none, so: I've tried defining CAppModule, with extern CAppModule _Module; in "stdafx.h" and CAppModule _Module; in my .cpp file , it compiles, linkes and at the perform registration step I get an assertion in atlbase.h here ATLASSERT(_pAtlModule == NULL); which means that the CAppModule has already been declared. But I can't seem to find another CAppModule instantiation, instead I see a CAtlExeModuleT

Detect clicking inside listview and show context menu

孤街浪徒 提交于 2019-12-09 18:51:18
问题 I have a listview created as a resource and loaded on a dialog window. I want to detect and show a context menu only when items within the listview have been clicked. MESSAGE_HANDLER(WM_CONTEXTMENU,OnContextMenu) LRESULT OnContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { int iSelected = -1; int iFocusGroup = -1; iSelected = SendMessage((HWND)wParam, LVM_GETNEXTITEM, -1,LVNI_SELECTED); iFocusGroup = ListView_GetFocusedGroup((HWND)wParam); if( iSelected != -1 &&

How to detect a selection change in my WTL::CListViewCtrl, and not in the parent?

狂风中的少年 提交于 2019-12-09 03:25:39
问题 I have my own WTL derived listcontrol. CPopupList : public CWindowImpl<CPopupList, WTL::CListViewCtrl>, It works fine, except one thing: I want to catch the notification when selection changes. Not in the parent window (like this: How to detect a CListCtrl selection change?) , but in the CPopupList itself, and then do some things. Actually I want a small hint window next to the currently selected item to appear, as an additional info of the current item. Just like VS does during autocomplete,

Pre-registering an ATL window class

强颜欢笑 提交于 2019-12-07 14:32:17
问题 I am using a combination of the ATL and WTL for a project and have derived my own class from CWindowImpl , which looks something like this: class CMyControl : public CWindowImpl<CMyControl> { public: DECLARE_WND_CLASS(_T("MyClassName")) ... BEGIN_MSG_MAP(CMyControl) ... END_MSG_MAP() }; This is all good, and if I use CMyControl::Create to create an instance of the control, then it works fine as under the hood, the CWindowImpl::Create function will register the Win32 class (in this case called

How to create a splitter in ATL/WTL?

随声附和 提交于 2019-12-06 13:51:56
I want to place the elements of my (resizable) dialog in one of two panes. How do I create a splitter for the panes, using WTL? I found CSplitterImpl and CSplitterWindowImpl , but I can't figure out how to use them with my dialogs. WTLExplorer sample from WTL should get you the idea, see \Samples\WTLExplorer. If you'd like more, there's a lot around, e.g. http://www.viksoe.dk/code/splitterbar.htm 来源: https://stackoverflow.com/questions/7324153/how-to-create-a-splitter-in-atl-wtl

What is Microsoft using as the data type for Unicode Strings?

旧城冷巷雨未停 提交于 2019-12-06 03:17:36
问题 I am in the process of learning C++ and came across an article on the MSDN here: http://msdn.microsoft.com/en-us/magazine/dd861344.aspx In the first code example the one line of code which my question relates to is the following: VERIFY(SetWindowText(L"Direct2D Sample")); More specifically that L prefix. I had a little read up, and correct me if I am wrong :-), but this is to allow for unicode strings, i.e. to prep for a long character set. Now in during my read up on this I came across

Pre-registering an ATL window class

╄→尐↘猪︶ㄣ 提交于 2019-12-05 19:08:38
I am using a combination of the ATL and WTL for a project and have derived my own class from CWindowImpl , which looks something like this: class CMyControl : public CWindowImpl<CMyControl> { public: DECLARE_WND_CLASS(_T("MyClassName")) ... BEGIN_MSG_MAP(CMyControl) ... END_MSG_MAP() }; This is all good, and if I use CMyControl::Create to create an instance of the control, then it works fine as under the hood, the CWindowImpl::Create function will register the Win32 class (in this case called MyClassName ). However, it is this behaviour - the Win32 class being registered when an instance is

Does ATL/WTL still require the use of a global _Module variable?

北城以北 提交于 2019-12-05 17:01:52
I'm just starting up a new ATL/WTL project and I was wondering if the global _Module variable is still required? Back a few years when I started working with WTL it was required (at least for ATL 3.0) that you define a global variable such as: CAppModule _Module; To get ATL to work correctly. But recently I've read somewhere that this may not be required anymore (yet the wizard generated code still uses it). Also I did a search through the Visual C++ include directories and it only picked up _Module in a few places - most notably the ATL COM registry stuff. So do I still need to define a