Windows 8: TopMost window

TopMost

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 “CN=TopMost.com” 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 TopMost.com /t http://timestamp.verisign.com/scripts/timestamp.dll 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

referralError

 

 

 

 

 

 

 

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

CertInstall

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#,Vb.net 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 vb.net.IDE 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#,vb.net,sql etc..Refrectoring features like converting c# code to vb.net 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 VB.net 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)

PngSkin – Per Pixel Forms Skin


VB 6.0
PngSkin is an ActiveX control written in Vb6 that can be used to apply per pixel alpha transparent PNG skin to any application (VB6 and .NET). You can ask your designer (Corel Draw) to create eye catching designs for your application. The control can be used for win2000 and upper operation systems. The non client area of any window can be designed in professional drawing software.The best part of this control is that to use it in your application you need not code or configure it heavily. For VB6 Windows application, you need not write even a single line of code. For .NET Windows forms, you need to write just 2 lines of codes.The Activex Control uses updatelayeredwindow (ULW) and setlayeredwindowattributes (SLWA) APIs to create a semi-transparent form capable of “hosting” controls. The word “hosting” is not correct. This example shows one way of creating a host form for controls and overlaying it on the semitransparent background.

Source Code at Code Project :
http://www.codeproject.com/KB/vbscript/PngSkin_-_Per_Pixel_Forms.aspx