Trip to Prague Photo Album
In June 2009 I went to Prague for a city trip with a few friends. I already posted a few pictures on my blog in this post.
I finally uploaded a few more pictures to a photo album. See them here. Enjoy đ
In June 2009 I went to Prague for a city trip with a few friends. I already posted a few pictures on my blog in this post.
I finally uploaded a few more pictures to a photo album. See them here. Enjoy đ
Apparently the pre-order of Windows 7 went extremely well. According to Amazon UK, they sold more Windows 7 pre-orders in the first 8 hours of its release than Vista did during it’s entire pre-order period.
According to Brian McBride, Amazon UK MD:
“The launch of Windows 7 has superseded everyone’s expectations, storming ahead of Harry Potter and the Deathly Hallows as the biggest grossing pre-order product of all-time at Amazon.co.uk, and demand is still going strong. Over the past three months, only Dan Brown’s The Lost Symbol has sold more copies than Windows 7, which is an incredible achievement for a software product.”.
Tomorrow is the official launch date of Windows 7 đ
Visual Studio 2010 and .NET Framework 4 Beta 2Â are now available. The final version is scheduled for 22nd of March 2010. I’m looking forward to it đ
For Visual C++ developers there are lots of new things to look forward to, like parallel programming, MFC ribbon resource editor, easy application local deployment model etc etc…
When you use the .NET Framework you will apparently be able to have deployments with up to 81% reduction in the framework size by using the Client Profile.
According to the press release:
“The company also outlined a simplified product lineup and pricing options for Visual Studio 2010 as well as new benefits for MSDN subscribers, including the Ultimate Offer, available to all active MSDN Premium subscribers at the official product launch on March 22, 2010.”
The product lineup is simplified with the following versions:
I just came across an interesting blog post.
Apparently, Windows 7 comes with several regional themes which include wallpapers from Canada, Australia, South Africa, and Great Britain. You can easily activate those themes following the procedure in the following blog post.
It seems Microsoft will not release a Windows 7 E for the European Union after all. Windows 7 E was planned for the EU to be a Windows 7 version without Internet Explorer. Now, Microsoft will implement a ballot screen that will be shown the first time a user starts Internet Explorer. That ballot screen gives the user the option to select a different browser like Firefox, Safari, Chrome, Opera and so on.
In March 2009, my brother and me went to Miami on holiday.
I had already posted some pictures on my blog in the “Back from Miami, Steak and Whiskey” and “Holiday in Miami đ” posts.
We now have uploaded a lot more pictures. See them here. Enjoy đ
Finally, Wallpaper Cycler 3.6.0.180 has been released today đ
Wallpaper Cycler 3.6.0.180 has a lot of new features and bug-fixes. Some of the major new features include:
The following new features have been implemented in Wallpaper Cycler:
I made the following bug fixes for Wallpaper Cycler:
I’m also happy to announce that I’m currently working on updating the website and preparing for finally releasing the 3.6 release đ
I just stumbled upon the Windows API Code Pack for the Microsoft .NET Framework. It’s a code pack that allows .NET developers to take advantage of some of the new Windows 7 features.
Features supported by version 0.9 of the code pack are:
Requirements:
There are also a few short 2-minute videos available to show you how easy it is to use some of the above features.
On saturday 13th of June I gave a presentation on KulenDayz titled “What’s new in Visual C++ 2010?”. The presentation consisted of quite a few demos. This post contains links to the source code for all demos including articles giving some more details.
Visual C++ 2010 comes with a brand new library called the Parallel Pattern Library or PPL. It is a powerful library that makes writing parallel code easier which is getting more and more important with the current and upcoming multicore CPUs. This article will give an overview of the PPL. Read the rest of this entry »
Windows Vista introduced the restart manager. It is used to automatically restart an application after it crashes. It can also be used to restart application after a reboot by a Windows Installer or update. If you create a new MFC application using the project wizard in Visual C++ 2010, you will automatically get support for the restart manager. If you want to add support to an existing MFC application, you only need to add 1 line of code to the constructor of your CWinApp or CWinAppEx derived class. Read the rest of this entry »
Windows Vista introduced the concept of Task Dialogs. Those are a powerful replacement for the standard message boxes. Read the rest of this entry »
From 12th till 14th of June, the Microsoft Community Osijek (Croatia) is organizing the Kulendayz event. I will be giving a lecture titled “What is new in Visual C++ 2010?”. If you want to participate in the event, please register on the Kulendayz website.
The SafeInt library is a new addition to Visual C++ 2010. It allows you to safely perform arithmetic operations on integers ranging from 8-bit to 64-bit. The SafeInt library will automatically detect arithmetic overflow or divide by zero. Using the SafeInt library is pretty easy. The following piece of code uses the SafeInt library to safely calculate the addition of two 8-bit integers. Read the rest of this entry »
Starting with Visual C++ 2010, the ‘auto’ keyword has a different meaning. Auto is now used as a variable type and it instructs the compiler to figure out the exact type itself. This makes it much easier to define function pointers or to iterate over vectors for example. This post will give a brief overview of how to use the ‘auto’ keyword. Read the rest of this entry »
A new feature in Visual C++ 2010 is called Rvalue References. This is a feature from the C++0x standard. One thing that Rvalue References can be used for is to implement move semantics for objects. To add move semantics to a class, we need to implement a move constructor and a move assignment operator (optional). This article will briefly explain the benefits of move constructors and how to write them. Read the rest of this entry »
Microsoft has added two interesting new API’s to Windows 7: Direct2D and DirectWrite. Direct2D replaces GDI and GDI+. It can render more accurate results and has support for hardware acceleration on your graphics hardware. DirectWrite is a new API to render text. It makes it easy to render paragraphs of text that can contain different formatting, coloring, fonts etc. It supports horizontal and vertical alignments, even vertical centering of a paragraph with multiple lines which was not possible with the old text API, etc. This article will give an introduction to the new DirectWrite API. Read the rest of this entry »
In this post I will briefly explain how to use layered windows and specifically how to use UpdateLayeredWindow.
The first thing you need to do is add the WS_EX_LAYERED style to your window. This can for example be done with a call to CreateWindowEx:
hWnd = CreateWindowEx(WS_EX_LAYERED, szWindowClass, szTitle, 0,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
After your window is created we will load a PNG file with an alpha channel and use UpdateLayeredWindow to render the PNG on the window using the alpha channel of the PNG file as the transparency level for the window. This is done as follows:
// Load our PNG image
CImage img;
img.Load("circle.png");
// Get dimensions
int iWidth = img.GetWidth();
int iHeight = img.GetHeight();
// Make mem DC + mem bitmap
HDC hdcScreen = GetDC(NULL);
HDC hDC = CreateCompatibleDC(hdcScreen);
HBITMAP hBmp = CreateCompatibleBitmap(hdcScreen, iWidth, iHeight);
HBITMAP hBmpOld = (HBITMAP)SelectObject(hDC, hBmp);
// Draw image to memory DC
img.Draw(hDC, 0, 0, iWidth, iHeight, 0, 0, iWidth, iHeight);
// Call UpdateLayeredWindow
BLENDFUNCTION blend = {0};
blend.BlendOp = AC_SRC_OVER;
blend.SourceConstantAlpha = 255;
blend.AlphaFormat = AC_SRC_ALPHA;
POINT ptPos = {0, 0};
SIZE sizeWnd = {iWidth, iHeight};
POINT ptSrc = {0, 0};
UpdateLayeredWindow(hWnd, hdcScreen, &ptPos, &sizeWnd, hDC, &ptSrc, 0, &blend, ULW_ALPHA);
SelectObject(hDC, hBmpOld);
DeleteObject(hBmp);
DeleteDC(hDC);
ReleaseDC(NULL, hdcScreen);
Because I’m using CImage, you need to include the atlimage.h header.
That’s all that is required for the basics of UpdateLayeredWindow.
NOTE: The example above does not include any error checking. That is left for the reader as an excercise.