Skip to main content

Posts

Showing posts with the label Windows API

Windows Media Player Transparent Seek Bar How To

If you are a Visual C++ programmer or you have learnt Visual C++, you might have seen and wondered how Windows Media Player Seek Bar is designed. Well, I have always wondered about it before today.. The Seek bar which Windows Media Player is a transparent seek bar. It uses a gradient fill from bottom to top. When you are playing some video in Windows Media Player, you can see the video running behind this seek bar. Many times I tried to design a control like this, where a control is transparent and the control which is placed behind this control should be visible. Although I never succeeded in this one, but I tried it a lot of times. Today when I was listening to songs using Windows Media Player(!!), I saw when I click on the area near to seek bar Windows Media Player's main window gets de-activated. The technique behind the transparent seek bar is to create a separate top level window. This second top level window should be a Layered Window , you can read more about Layer...

SingleWindow MutliProcess App

If you are using Google Chrome browser then you must have noticed that when you start Google Chrome, many chrome.exe processes appears in Windows Task Manager. Many people think that why there are so many chrome.exe processes are running when I have started only once Google Chrome browser, well that's because for every tab and every enabled  extension chrome creates a new process to give you seamless experience of browsing even if any one of the tab or extension hangs due to any reason. When I first noticed about the Single chrome window with multiple tabs running each process for every tab, I wondered and thought they must have wrote awesome code to achieve this and never thought it would be so easy in reality. ;) Here is how they might  have done this - Well that's very simple, you need to create a Main application window and then write your code in such a way that by any IPC technique when you get Handle for top most window you create new window as child window of ...

Dialog in C++

While helping out a colleague I recently came across this code where for creating a dialog box first a window was created using CreateWindow method and then for CreateDialog method HWND returned by CreateWindow method was used, also while calling CreateWindow method values for width and height were specified as literals(hard coded). Now the problem my colleague facing was with different resolutions this dialog was getting displayed differently, and on lower resolutions dialog was cropping the inner content of the dialog. Now the dialog resource template was set with type as Child. Solution here is that you should not create any parent window for dialog unless its required in some special cases. We can directly pass the dialog resource template id to CreateDialog or DialogBox method and the HWND that we pass to this method specifies the parent window for this dialog. For this type for Dialog in resource has to be overlapped window or popup window. When we call either of this meth...