Click here to Skip to main content
15,887,683 members
Everything / Desktop Programming / WTL

WTL

WTL

Great Reads

by Tim Smith
Color picker control for WTL applications including optional support for XP themes
by Ernest Laurentin
Full-fledged ATL Windowless ActiveX Container. Ideal for hosting Windows Media Player, Transparent Flash and Silverlight Animations.
by Michael Dunn
How to use power status notifications to make your applications conserve power when necessary.
by Michael Dunn
Create custom tasks in your app's jump list on Windows 7

Latest Articles

by Clifford Nelson
Shows how to set DataContext of View to itself using XAML and discusses the advantages of INotifyPropertyChanged to DependencyProperty
by Taehoon Kim 1004
Capture program using GDI
by Suarte
A hands on example of domain driven design - Part 3
by Timo Kunze
Use undocumented parts of the Windows Vista list view API to enhance your application.

All Articles

Sort by Updated

WTL 

19 Mar 2024 by Rick York
I recommend starting from a solution that has already been made for a WTL project and adapting it for your project. This site has a good number of articles about WTL so I am sure something useful can be found : Code Project Search WTL[^]. By...
18 Mar 2024 by Member 14105155
It is rather strange situation, guys. I have a WTL template and compiler has no objections, compiling it. Excellent. Then I create an empty project and move files from the old project- one file by one. Same files, same include files and so on....
9 Apr 2018 by Clifford Nelson
Shows how to set DataContext of View to itself using XAML and discusses the advantages of INotifyPropertyChanged to DependencyProperty
29 Mar 2017 by Taehoon Kim 1004
Capture program using GDI
11 Jun 2016 by harishkharvi
i want to know how to concatenate two string (Eg: str1 & str2)
20 Apr 2016 by Suarte
A hands on example of domain driven design - Part 3
21 Mar 2016 by farhad Najib
Floppy = CreateFile("\\\\.\\A:", GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, NULL );if( hFloppy != INVALID_HANDLE_VALUE ){ bRes = DeviceIoControl( hFloppy, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &dummy, NULL ); if(...
21 Mar 2016 by ameyakoshti
Hello I am doing computer engineering and i needed some guidanceregarding my project.1st of all i want to know whether it is possible to disable usb portsand CD rom "POWER" through VC++.If yes then could you please guide me on it?Thanks
30 Sep 2015 by Timo Kunze
Use undocumented parts of the Windows Vista list view API to enhance your application.
8 Sep 2015 by chetanvihite
In this post I am going to talk about Onion Architecture. There are several traditional architectures that exists in web world and each one of the architecture comes with its pros and cons. But most of the traditional architectures raises … Continue reading →
13 Aug 2015 by Reader Man San
I wanted to further read about Plugin Architecture, which I made a list for reading about it, in this article: “C# Plug-In Architecture Articles“, so added more reading for Layered Software Architecture, and found the following very interesting presentations: .
27 Jun 2015 by Member 11794279
CQRS – Simple Architecture
3 Jun 2015 by john morrison leon
An alternative approach in which dialogs are entirely specified as C++ code that requires neither IDE support to be written nor IDE generated resources to be executed. Powered by the C++ type system.
8 Apr 2015 by RajaPratap
I got stuck with an issue in property sheet .I want to load different cursor when the mouse position is within the client area and load another when moves out of the client area.In the porpetysheet I added four page. In the first page when I click next I am loading cursor of IDC_WAIT type...
8 Feb 2015 by tkontos
A WTL based, XML driven shortcut replacement
4 Jul 2014 by dverma05
Thanks Richard for your solution. But I have tried all the possible combination one by one. Even I have tried creating this listview only with LVS_REPORT and this was also failing.
4 Jul 2014 by Richard MacCutchan
The style tag TVS_TRACKSELECT is 0x0200 which equates to LVS_EX_REGIONAL as described in http://msdn.microsoft.com/en-gb/library/windows/desktop/bb774732(v=vs.85).aspx[^].
4 Jul 2014 by dverma05
I am creating a listview control using WTL as belowhwnd = CWindowImpl::Create(0, rcDefault, _T("Parameters"), WS_VISIBLE|LVS_REPORT|LVS_SHOWSELALWAYS|TVS_TRACKSELECT, WS_EX_TOOLWINDOW);Background: I am having one MFC executable application containing...
6 May 2014 by KarstenK
An easy way is using URLDownloadToFile.At the first step download an info-file into the Temp and check for the update and proceed if an update is available. Dont ferget to delete the downloaded files after you are done. ;-)
1 May 2014 by Singh, Yashpal
Hi,I am working on an help viewer kinda app that is developed and maintained using ATL/ WTL library. The application uses some help content in form of XHTML pages that is installed separately in the system independent of the help viewer itself. Now we are planning to put the content on some...
14 Apr 2014 by john morrison leon
A smart pointer system for safe application development in C++.
16 Jan 2014 by Richard MacCutchan
See the remarks section under CDC::Rectangle[^], particularly The interior of the rectangle is filled using the current brush.. So you need to add the text as the very last action.
16 Jan 2014 by Singh, Yashpal
Hi,I design a custom TreeView control that wraps the text string of a tree item when the tree is resized, and to achieve that I draw the tree items in OnPaint() handler, I use CDC::DrawText() to draw the text strings and CDC::FillRect() on the same rectangle to draw a selected tree item. In...
11 Dec 2013 by Steve S
I am trying to implement "copy to"/"copy from" functionality in an application. The idea is that certain files will be copied to (or from) an Android device (usually a Samsung S3, Note II or Tab 2.0, but not necessarily) under program control.I have "copy from" the device working, as I can...
22 Oct 2013 by Pablo Aliskevicius
I think you should start a survey, not ask a question.A few years ago, I used MFC a couple of times, until I stumbled upon WTL (in 2002 or 2003). I started to use WTL exclusively, and never looked back. In those early days, WTL looked much better (e.g., icons in the menus), and performed...
22 Oct 2013 by Codexzy
I am familiar with the Win32 API and MFC (mostly Win32 API). I have never tried WTL nor ALT and I've heard that WTL is created using ATL.For creating a GUI which is the best ? The good-old MFC or the new WTL library ?Have you ever used WTL, if so what are your experiences ?If you are...
5 Oct 2013 by Raymund Macaalay
How to use a Sybase with S#arp architecture and nHibernate
10 Sep 2013 by Pablo Aliskevicius
A mix-in class to change the appearance of a dialog, by handling WM_CTLCOLOR* messages, with five lines of code.
6 Sep 2013 by ThatsAlok
Free component for parsing HTML, .NET version of EfTidyCom
3 Sep 2013 by Nikolay Ananenko
Avoid horizontal scroll and effectivelly use whole horizontal control width: resize all columns except one to their content and this one to all remaining space.
2 Sep 2013 by lin98666521
I am making a atl control in which I can show image in richedit. To support copy & paste I implemented :public IPersistStreamInitImpl,public IPersistStorageImpland overrideHRESULT IPersistStreamInit_Load(LPSTREAM pStm, const ATL_PROPMAP_ENTRY* pMap);HRESULT...
26 Aug 2013 by findewayz
Hi all, I'm using WTL and COM, I tried to implement refreshing my webpage after reconnect to the internet. I have a thread monitering the net status who will call SendMessage to notify main thread to reload the webpage using Navigate2. Unfortunately,I ran into an odd occurrence.After...
5 Aug 2013 by Julijan Sribar
A simple WTL edit control that can display content in arbitrary color even when it is disabled
31 Jul 2013 by KarstenK
consider asking at the right place: http://sourceforge.net/projects/wtl/[^]you can try to switch the UAC off for testing.
30 Jul 2013 by mxz_qljs
win8 and vs2010 and wtl81_12085,but in the wizard of wtl a js error display,(cann't upload photoes?) url:file:///C:/wtl81_12085/AppWiz/Files/HTML/1033/default.htm, how to deal this?
28 Jul 2013 by joney_ling
How to change WTL's cprogressbarctrl's background color,i want ro set it transparent or white
23 Jul 2013 by KarstenK
look at this WTL for MFC Programmers, Part IX - GDI Classes, Common Dialogs, and Utility Classes[^]For a preview print in a menory DC and bitblt to an window in onpaint.
21 Jul 2013 by mxz_qljs
I have not find samples about print in wtl, who can help me? Mainly use atlprint.h to print, maybe multipage, and show the preview print window. Please code a demo, thanks.[This is a repost of another wanna-be-question which was probably automatically removed due to abuse reports (not a...
14 May 2013 by lin98666521
hi, I'm looking for an open source library similar to picostorage, who can recommend a few? I've been using picostorage,but recently i found that the File is very easy to damage. so i want to look for an open source library. If the file is damaged,I can not get the data...
7 May 2013 by S Leistikow
Four tier IOC application.
1 May 2013 by Richard MacCutchan
Your question is really far from clear, but perhaps you are talking about WM_USER[^].
1 May 2013 by Style-7
see:WTL for MFC Programmers, Part I - ATL GUI Classes[^]
1 May 2013 by MCGRADYV5
Your answer will be highly appreciated.
11 Apr 2013 by MCGRADYV5
The debug tools in vc6.0 cannot be used when you write wtl program
8 Apr 2013 by Kumar Anitesh
I think you have missed the message mapping for OnTimer() function.In BEGIN_MSG_MAP section please add "MSG_WM_TIMER(OnTimer)", and try if it is working.
8 Apr 2013 by MCGRADYV5
class CMyListBox : public CWindowImpl, public COwnerDraw{public: BEGIN_MSG_MAP(CMyListBox) MSG_WM_MOUSEMOVE(OnMouseMove) CHAIN_MSG_MAP_ALT(COwnerDraw, 1) DEFAULT_REFLECTION_HANDLER() ...
7 Apr 2013 by Member 9972250
dear: How Can I make the subWindows fullfill the whole Client area of the mainWindow,even if the subWindow was draged to another position to dock . ..? waiting for your respose! thank you! (my english is poor,so beg for your pardon if their exist something wrong words.) (I...
7 Apr 2013 by MCGRADYV5
void CMyListBox::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) {CDC* pDC = GetDC();}error C2440: 'initializing' : cannot convert from 'struct HDC__ *' to 'class WTL::CDCT *'I write this code in VC6.0, how to get the dc of a control?
11 Mar 2013 by Manfred Rudolf Bihy
Well I don't know which article you read, but I just skimmed over the beginning of part one in his series and found this:This is the stuff I want you to read first, before proceeding on or posting messages to this article's discussion board.This series of articles originally covered WTL...
11 Mar 2013 by MCGRADYV5
There are many errors when I compile those programs with VC6.0, the article that the author writes is "WTL for MFC Programmers"?
8 Mar 2013 by Sergey Alexandrovich Kryukov
For now, I can only answer your follow-up question on WTL documentation. WTL is not a Microsoft product anymore. This is open-source. Please see:http://en.wikipedia.org/wiki/WTL[^],http://sourceforge.net/projects/wtl/[^],http://wtl.sourceforge.net/[^].As to you main question, right...
8 Mar 2013 by MCGRADYV5
Thanks for answering me, I am looking forward to your reply.
6 Mar 2013 by lan yuan
This problem has been solved, the reason is No call to InitializeCriticalSection(...);for I used the loadlibrary(*.dll),which leave the global variables(_AtlWinModule,_AtlBaseModule,_AtlComModule which is used by ATL components later) uninitialized. So in this situation, Adding _CRT_INIT to the...
26 Feb 2013 by lin98666521
hi,My English is not good, if the problem can not be Bunderstood please reply to me.I ran into a problem.I insert a picture into my richedit,than Scroll bars are displayed.I move the scroll bar until Image the lower half of the display,than i call the function...
22 Feb 2013 by lin98666521
i want to use the control named windowlessrechedit.i will call the function "CTxtWinHost::SetClientRect" When the window size changes,than the Caret always flickers.the code //it will be called,When the window size changes.//OnSize will call it.void CxRichEdit::CxSetRect(RECT...
6 Feb 2013 by lan yuan
The start reason is that I want to change a WTL exe project to dll project so that I could use it as plugin in another project. Those code worked well in the exe, but got exception in the DLL. I tracked it down, initialization is fine, when it goes to the CWindowImpl::create->...
7 Jan 2013 by lin98666521
hi Recently, I have a question.i want to do something when i click a ole in a richedit,but i find that i can not get the accurate position of ole.Now,one way to get the position like this.the "rcLastUpdate" is the i am using.sometimes,it is not accurate,when the ole is not...
5 Dec 2012 by lin98666521
i have Solve the problem by myself.i find that,the color and size of the bullets are the same to the last "\r",so i remeber the position ,and find the first "\r" from the position to set it color and...
28 Nov 2012 by lin98666521
hi,i want to change the color and size of the bullets in a richedit,and do not change the text.i do not get a effective method to do it.I found that ,i can change the font ,color and size of bullets in word,and i want to get the effect look like the word.who can help me? ...
26 Nov 2012 by chaau
Set pf2.cbSize = sizeof(PARAFORMAT2) after you ZeroMemory the pf2 and it should all work
25 Nov 2012 by lin98666521
hello everyone.i have a problem,i can not find the Solutions. PARAFORMAT2 pf2; ZeroMemory(&pf2, sizeof(PARAFORMAT2)); pf2.dwMask = PFM_LINESPACING; pf2.bLineSpacingRule = 4; pf2.dyLineSpacing = 300; SetSel(iBPos,iEPos); SetParaFormat(pf2);when i expand the line...
4 Nov 2012 by Julijan Sribar
A WTL control to display quality rate
2 Oct 2012 by Shahriar Iqbal Chowdhury/Galib
Define Principle Single Responsibility Principle (SRP) states that there should never be more than one reason for class to change.
17 Sep 2012 by Adam Wojnar
A complete log viewer written in C++/WTL.
4 Sep 2012 by Zac Gery
The Gestalt Principles are based on the observation that people actively and subconsciously organize things into patterns and objects.  These principles are organized into Proximity, Similarity, Closure, Good Continuation, Common Fate, and Good Form.  They can be applied to all avenues of life.
30 Aug 2012 by Zac Gery
The Gestalt Principles are based on the observation that people actively and subconsciously organize things into patterns and objects.  These principles are organized into Proximity, Similarity, Closure, Good Continuation, Common Fate, and Good Form.  They can be applied to all avenues of life.
29 Aug 2012 by Michael Haephrati
This question is not answered. Windows Explorer (explorer.exe) is indeed responsible, but how can one call it problematically as if the user double clicked an application's icon?
14 Aug 2012 by Richard MacCutchan
The default for a List View is to allow multiple selections, so unless you specifiy LVS_SINGLESEL when you create it it is already set up to do it.
14 Aug 2012 by Abhinav S
The listview has a multiselect property that you can turn on - http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.multiselect.aspx[^].
14 Aug 2012 by eschenhe
how to choose multiple line in listview
5 Aug 2012 by armagedescu
As suggestions. If you return bool then you have to return false/true instead of FALSE/TRUE, because you are not using BOOL. Second, don't name the class Handle. Instead of CConnectionHandle use CConnection name, or even better CDatabase. Instead ir CStatementHandle use CStatement or CQuery, and...
5 Aug 2012 by Anna-Jayne Metcalfe
Theme support in Visual Studio 2012
3 Aug 2012 by JackDingler
My advice is to test the code yourself first, to see if it solves the problem you are addressing.I've had little need in the last decade, to do much with the ODBC layer. Using Wizard generated code such as MFC generated classes based on CRecordset, save a lot of time, and perform well enough...
3 Aug 2012 by v3nOm_
I do appreciate your feedback and understand I am missing a lot :) I think it's better to get advice early then to late and have a lot of rewriting :) thanks for the advice and your time
2 Aug 2012 by v3nOm_
In order to further explore ODBC and increase my programming experience i was going to put together my own ODBC wrapper classes. Below are the wrapper classes i have made so far and i'm curious on any problems anyone happens to see with it :) thanks for the help and cheerstemplate
9 Jul 2012 by armagedescu
First you need to open the right theme from the current skin:hThm = OpenThemeData(hWnd, L"WINDOW");After that you may draw the needed thing with DrawThemeBackground,DrawThemeBackground( hThm, hDC, WP_CAPTION, CS_ACTIVE, &rc, 0 );
8 Jul 2012 by lin98666521
hello!i have a problem.My window that don't have the style "WS_CAPTION",i want it have the shadow of aero,how can i To achieve that effect.i want to provide a picture,but this don't Support.the effect i want look like the shadow of system window,my Operating system is window...
22 Apr 2012 by mrbll
Thanks to several people on several forums who supplied helpful answers to this and several spawned questions. The real problem as all too often was something completely different.See comments for additions needed.Gotcha #1 was & operator does not work on WTL classesGotcha #2, is never...
22 Apr 2012 by mrbll
Answer is the & operator was overloaded to return a different type.from stackoverflow.com.Also, since the & operator did not produce the address of the object, a workaround:CLASSfoo foo[1];CLOSSfoo *pfoo = foo; //since C still treats arrays as pointer to first element.
21 Apr 2012 by mrbll
I inherited some C++ code and it has me stumped.Have a class declared like so.class CIENavigator : public CWTLAxControl{public:...Instance like soCIENavigator CIE;CIENavigator * pCIE = &CIE;Gets this compile error1>.\IENavigator.cpp(446)...
20 Apr 2012 by Sergey Alexandrovich Kryukov
Please take a look at this CodeProject article:A WTL Game Loop[^].—SA
20 Apr 2012 by mrbll
Ok, I tried this no doubt naive attempt to create a new thread with a new window and message loop. I have a function that must open a window & process its messages, and must run in environments where it may be called from application with no existing message loop (and no other windows) or...
19 Apr 2012 by mrbll
I have a library function (that does not know anything about the application its linked to) that sometimes opens a window.If the application's main window is closed while the library window is open, the process gets into a weird state that wont exit, even after the library function widow is...
18 Apr 2012 by Albert Holguin
You should be able to call AfxGetMainWnd() from the exported function and get the top-level window from the thread calling the exported function (may return NULL if there's no window associated with the thread).See...
18 Apr 2012 by nv3
You can use the system call EnumWindows to find all of your top-level windows. After your application has closed all its own windows, no other window should remain. If EnumWindows detects anything, then it's probably the additional window that your function has created.If you know the window...
30 Jan 2012 by Yuri Granovsky
How to implement flat combobox on the toolbar for IE using WTL ?
13 Jan 2012 by perry.p
U can add minimize/maximize button on top of the dialog box from the property of the dialog box.
19 Dec 2011 by Chuck O'Toole
Just because the API definition of select() takes its timeout value in microseconds, that doesn't mean that every operating system that supports the Socket API has to provide microsecond resultion on their timers. In fact, almost no operating system does.As Rajesh said, Windows (Unix,...
19 Dec 2011 by Prashant Srivastava LKO
HiSystem.Thre...
4 Nov 2011 by Richard MacCutchan
See here[^].
4 Nov 2011 by naaryan
Hi All,As I am using shellexecute function to open one feedback form in the default browser and it work fine but the issue, when we un-install our application from add removed program. "add removed program" windows hanged until feedback form is closed because add removed program wait for all...
19 Sep 2011 by Yvan Rodrigues
How to install the WTL Wizard for Visual Studio 2010.
19 Sep 2011 by isemenov
11 Sep 2011 by Michael Dunn
This article demonstrates new button and menu features of the Ribbon
7 Sep 2011 by Arun Parthasarathy
Plesase go to the Tools->Options menu.Options dialog opens.Choose projects and solutions.Choose VC++ directories.In "show directories for : ", choose "Include Files".Here add the directory path where your file exits.and give ok.Now try to build your project.
8 Aug 2011 by Esteban Alvarez
Low cost design of useful utility classes
7 Aug 2011 by forest.house
This article illustrates the application of ATL/WTL by building a simple text editor based on the WTL objects
6 Aug 2011 by mj0008
{\rtf {\field{\*\fldinst HYPERLINK "http://vk.com/"}{\fldrslt Click me!}}}
18 Jul 2011 by Michael Dunn
This article shows how to control various Ribbon and command properties at runtime
15 Jul 2011 by OlegKrivtsov
I've read about Model-View-Controller pattern, and I plan to use it for my WTL-based project. For example, I would like to write a calculator application.First of all, I write CCalculator class that performs actual calculations. This is the model in terms of MVC.Then I create a dialog...