Windows 8: TopMost window


I am working on my next ambitious project “MouseTouch” which is multi touch simulator application for windows 8 platform and intended to increase the productivity if you are running windows 8 on non-touch device.

This will bring the touch feature of windows 8 to life even if you are using mouse pad.

The first challenge is how to render something on top of metro start menu items?

So if you want to create a true topmost window which can float even on top of windows 8 metro apps here are the simple steps..

  1. Create WPF visual studio application (or any other window app )
  2. Set TopMost=True for MainWindow
  3. Right-click on your project in the Solution Explorer
  4. Select “Add New Item” from the context menu.
  5. Choose “Application Manifest File” from the list of options in the dialog box that appears.
  6. Right-click on your project in the Solution Explorer and click “Properties” (or double-click on the “Properties” item under your project).
  7. Under the first tab (“Application”),select your app.manifest file from the drop-down box labeled “Manifest”.
  8. Set the, <requestedExecutionLevel level=”asInvoker” uiAccess=”true” />

The next part is to create a certificate and install it in trusted root authorities.

  1. Create certificate 
    1. makecert -r -pe -ss PrivateCertStore-n “” topmost.cer
  2. Import certificate to (Local Machine) trusted root certification authorities using mmc.exe.

Now sign your executable using the certificate, either by using the command, or using visual studio (check the delay sign flag).

  1. Signtool sign /v /s PrivateCertStore /n /t TopMost.exe

Now copy the TopMost.exe to trusted location like c:Windows or program files and execute the TopMost.exe..

Still struggling ..

Ok if , executable is not signed or certificate is not installed properly, you see following exception









To avoid this exception, open mmc.exe, add certificates snap-in>Select Computer account>Local Computer>

Go to trusted root certification authorities>certificates>right click > tasks and import the certificate ..


Face Detector

Face detection from given picture has many applications including camera’s, scanners and other consumer application. The technique can be applied to improve the effectiveness of application like driving licence, passport generation, data entry applications etc. Recently one of my friends who is running his data entry business asked for solution for data entry of typical forms which consists candidate picture and relevant data. In tradition application usually one has to spent considerable amount of time in scanning, trimming picture. There is no such scanner or device available to do their job automatically and reduce the time spent in processing or increase the productivity. In this article i have written small .net based application which can be used in wide range of application and is based on open cv haar face detection to recognize front face from input picture.

The application is just proof-off concept off-course fully working to detect face from camera. The application also implements motion detection from input picture and it will capture the picture only when motion is stabilized. Imaging if this could be integrated with-in scanner having auto feed tray. The application could be programmed to take pictures based of business specific parameters for e.g. for passports there is different specification as compared to driving licence photo’s. The concept could be integrated with Photo-Me (automatic photo machines) machines where current users has to position him self or move the camera using controller keys.
The application will first wait for any motion if motion is detected and is stabilised for few seconds, it will capture the frame from camera and will be processed by application to detect face from picture and cut the face according to pre-set specification, Say if it detects two faces it will generate two pictures into strip. The concept can be further extended to automatically create data entry into some database with initial picture. The rest of the data will be manually entered by DTP operators. This process will improve the DTP eefficiency at least by 20 % and if it will be incorporated with scanner it may further improve the efficiency by 40 %.

I have recently upgraded my OS to Windows 7 64 bit and the source code of this application is not working on this os.will publish the code once i have mannaged to fix the issue.

.Net Script Editor (C#, Mini IDE)

Complete Visual Studio IDE (source code included) in single user contol that can be used in your windows application to provide scripting feature in languages like c# abd have features like code intellisence,reference to .Net assemblies,COM libraries & web services.The code editor supports lot coloring for languages like c,c++ c#,,sql etc..Refrectoring features like converting c# code to code in single click.

Add scripting functionality to your application,features of MS Script control (Functions like AddObject) and some features of VSA/Visual Studio editor like intellisence, code completion etc. Mini .Net IDE in single winform control.

The source code / article published here is to provide features of MS Script control (Functions like AddObject) and some features of VSA/Visual Studio editor like intellisence, code completion etc. The control supports C# and language however can be easily modified to support any .net language. You can use COM references, .Net references & Web References. The control supports Visual studio IDE features like bookmark, highlighting interpreter errors & compiler errors, adding multiple classes and interfaces. You can imagine visual studio IDE build in single control with feature like AddObject from MS Script Control. To use this control you just need to drag and drop it to your winforms and add few lines of code to add instance of object which you want to access in the scripts.

Source code at :

SNMP Trap Listener

Simple Network Management Protocol (SNMP) is an “Internet-standard protocol for managing devices on IP networks. Devices that typically support SNMP include routers, switches, Servers, workstations, printers, modem tracks etc. It is used mostly in network management systems to monitor network-attached devices for conditions that warrant administrative attention.

SNMP exposes management data in the form of variables on the managed systems, which describe the system configuration. These variables can then be queried (and sometimes set) by managing applications.

The code attached in this article is .net based windows service to trap SNMP messages (SNMP v2) and process them accordingly. The service is capable to handle thousands of messages per second by using .net threads. One thread listens for incoming messages and pump them in message queue while another thread will extract and process the messages from another end of the queue.

The SNMP service in this article depends on windows “SNMP Trap Service”.

The source code also includes project “(SNMPSendTrap)” to send test SNMP v2 traps. 

Download source code for SNMP Listener (Vs2010)