Skip to main content

Posts

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 ...

Beware of Android FREE Apps

Android platform is an open source platform to develop applications. From Android Market you can get plenty of free apps for your android smartphone. Recently I downloaded a free game from android market which was developed by a very good company, I played this game and I liked it. The game is awesome but after 2 days I faced problem while connecting my device to my pc, my smartphone was unable to detect that it has been connected to pc??? Now after searching for problem I found that the most latest change I did in my phone was installing this app(game) from a very good company... Then I went through the permissions which were requested by this game and I found it was requesting so many unnecessary permissions. When I uninstalled this app my phone immediately detected pc connection... So while installing FREE apps from Android market please check which are the permissions requested by these applications, and please go through the reviews even if these applications are d...

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...

Explorer Context Menu in your App

As I am currently working on C++ project, I learn lots of new things daily. In our project we needed to provide Explorer's Context Menu for our custom built explorer. This requires COM, many C++ programmers know that COM is one of the tough topics from C++ Windows Development. Anyways, this post describes about how to use Explorer's Context Menu in C++ application. This requires understanding of COM, COM related objects which you can find here . Following is the code snippet which shows how this can be done. IShellFolder *psfDesktop; SHGetDesktopFolder(&psfDesktop); // Retrieve Desktop's Shell Folder handle if(psfDesktop) {  LPITEMIDLIST pidl;  BSTR strMyFolderPath = ::SysAllocString(L"C:\\myfolder");  psfDesktop->ParseDisplayName(hWnd, 0, strMyFolderPath, NULL, &pidl, NULL);  ::SysFreeString(strMyFolderPath);

DefineDosDevice Virtual Drives!!

I started my career as Java developer in NIC. After working for 1 year and 3 months I switched to Uniken Systems. After 5 months in Uniken working on Java, I got chance to work on C++. Now I develop applications using C++, where I learn loads of new things. Yesterday itself I came to know about a new thing, not a new thing but a new API from C++ with the help of which we can create a virtual drive which actually points to a folder..  Well some people might say so whats great in that! But for some people it can be a very great thing if you can mount your movies folder, songs folder and docs folder as drive. It can be very handy coz when you open your 'My Computer' folder you can see your virtually mounted drives.. API call -       DefineDosDevice How to use it? Here is an example -      DefineDosDevice(0, _T("T:"), _T("F:\\Songs")); And when you no longer require this drive you can remove it simply by using following call   ...

Manipulating excel files in Java

We many times come across this situation where we want to create or edit excel files in java, although there are many open source libraries available out there which allows us to create or edit excel files in java but the most stable among them which I think is Apache Poi. Apache Poi library allows creation and editing of excel files. This library supports traditional 2003 format and 2007 format also. Apache Poi library supports excel macros, cell customization(cell color, text color, cell background color) and much more. Although Poi supports both xls and xlsx files, xls files are manipulated smoothly but xlsx file manipulating requires much more RAM and time for processing than that of xls. Poi has two classes HSSFWorkbook for xls files and XSSFWorkbook for xlsx files, both implements to Workbook interface. You can create multiple workbook sheets. In next post I will show how to use Apache Poi API to manipulate excel files.

No new posts :-(

Well this blog is not dead, actually I am busy due to office work and not getting time to post new posts on blog. But as soon I will get free time I will post new things which I came to know and want to share them... :-)