UC Browser

Tuesday, 4 November 2014

Internet Explorer Metro Tile Missing from Windows 8 Start Screen or Metro IE Doesn’t Start


Lots of Windows 8 users have complained about a weird problem. Suddenly Internet Explorer metro tile disappears from Windows 8 Start Screen. A few other Windows 8 users have complained that when they try to launch Metro IE by clicking on its tile in Start Screen, it doesn't open, actually nothing happens.
Both of these problems occur when you install another web browser such as Mozilla Firefox, Google Chrome, Opera, etc in Windows 8 and you set the new browser as default or it automatically sets itself as default web browser in Windows 8. As soon as a new browser is set as default, Windows 8 replaces Internet Explorer metro tile with the Desktop version of IE and IE metro tile disappears from Start Screen.
To fix this problem, simply set Internet Explorer as the default web browser again using following steps:
1. First if you are at Start Screen, go to Windows Desktop by clicking on Desktop tile or pressing WIN key.
2. Now launch Internet Explorer and select Tools -> Internet Options. Go to "Programs" tab and click on "Set associations" button.
3. Now check "Select all" option and click on Save button. At last click on OK button and it'll fix the problem.
If the above mentioned method doesn't work for you, set IE as default web browser using Control Panel -> Default Programs -> Set program access and computer defaults.
So you have to simply set Internet Explorer as default web browser in Windows and the metro tile of Internet Explorer will come back on Start Screen.
PS: Also keep in mind that the Metro version of IE only works when your screen resolution is set to at least 1024x768. So double check your screen resolution if IE doesn't open when you click on its tile in Start Screen.

If you have any issues with the information provided, feel free to mail me at manigandasuresh@gmail.com

Convert String to LPWSTR C++

C++ Code:

wstring stringToWstring(const string &inputString)
{
// Make room for characters
std::wstring destinationString(inputString.length(), L' ');

// Copy string to wstring.
std::copy(inputString.begin(), inputString.end(), destinationString.begin());
return destinationString;
}


If you have any issues with the information provided, feel free to mail me at manigandasuresh@gmail.com

Tuesday, 28 May 2013

Read all values inside a Registry Key C++

Code:

#include "stdafx.h"
#include <windows.h>

#define MAX_KEY_LENGTH 255
#define MAX_VALUE_NAME 16383

void QueryKey(HKEY hKey) 
 { 
 TCHAR    achKey[MAX_KEY_LENGTH];   // buffer for subkey name
 DWORD    cbName;                   // size of name string 
 TCHAR    achClass[MAX_PATH] = TEXT("");  // buffer for class name 
 DWORD    cchClassName = MAX_PATH;  // size of class string 
 DWORD    cSubKeys=0;               // number of subkeys 
 DWORD    cbMaxSubKey;              // longest subkey size 
 DWORD    cchMaxClass;              // longest class string 
 DWORD    cValues;              // number of values for key 
 DWORD    cchMaxValue;          // longest value name 
 DWORD    cbMaxValueData;       // longest value data 
 DWORD    cbSecurityDescriptor; // size of security descriptor 
 FILETIME ftLastWriteTime;      // last write time 

 DWORD i, retCode; 

 TCHAR  achValue[MAX_VALUE_NAME]; 
 DWORD cchValue = MAX_VALUE_NAME; 

 // Get the class name and the value count. 
 retCode = RegQueryInfoKey(
  hKey,                    // key handle 
  achClass,                // buffer for class name 
  &cchClassName,           // size of class string 
  NULL,                    // reserved 
  &cSubKeys,               // number of subkeys 
  &cbMaxSubKey,            // longest subkey size 
  &cchMaxClass,            // longest class string 
  &cValues,                // number of values for this key 
  &cchMaxValue,            // longest value name 
  &cbMaxValueData,         // longest value data 
  &cbSecurityDescriptor,   // security descriptor 
  &ftLastWriteTime);       // last write time 

 // Enumerate the subkeys, until RegEnumKeyEx fails.

 if (cSubKeys)
  {
  printf( "\nNumber of subkeys: %d\n", cSubKeys);

  for (i=0; i<cSubKeys; i++) 
   { 
   cbName = MAX_KEY_LENGTH;
   retCode = RegEnumKeyEx(hKey, i,
    achKey, 
    &cbName, 
    NULL, 
    NULL, 
    NULL, 
    &ftLastWriteTime); 
   if (retCode == ERROR_SUCCESS) 
    {
    _tprintf(TEXT("(%d) %s\n"), i+1, achKey);
    }
   }
  } 

 // Enumerate the key values. 

 BYTE* buffer = new BYTE[cbMaxValueData];
 ZeroMemory(buffer, cbMaxValueData);

 if (cValues) 
  {
  printf( "\nNumber of values: %d\n", cValues);

  for (i=0, retCode = ERROR_SUCCESS; i<cValues; i++) 
   { 
   cchValue = MAX_VALUE_NAME; 
   achValue[0] = '\0'; 
   retCode = RegEnumValue(hKey, i, 
    achValue, 
    &cchValue, 
    NULL, 
    NULL,
    NULL,
    NULL);

   if (retCode == ERROR_SUCCESS ) 
    { 
    
    DWORD lpData = cbMaxValueData;
    buffer[0] = '\0';
    LONG dwRes = RegQueryValueEx(hKey, achValue, 0, NULL, buffer, &lpData);
    _tprintf(TEXT("(%d) %s : %s\n"), i+1, achValue, buffer); 
    } 
   }
  }
 delete [] buffer;
 }


int _tmain(int argc, _TCHAR* argv[])
{
HKEY hKey;
LONG dwRegOPenKey = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\"), 0, KEY_READ, &hKey);
if(dwRegOPenKey == ERROR_SUCCESS){
 printf("RegOpenKeyEx succeeded, error code %d\n", GetLastError());
 QueryKey(hKey);

 } else {
  printf("RegOpenKeyEx failed, error code %d\n", dwRegOPenKey);
 }
 RegCloseKey(hKey);
return 0;
}
If you have any issues with the information provided, feel free to mail me at manigandasuresh@gmail.com

Monday, 4 February 2013

Blocking an Application in Windows



          If you a computer administrator and you do not want user run a few program in the computer such as game, browser, etc. you can block the application from running using registry. You can block the program just add a few entry to your registry setting. I think this tips is useful trick to System Administrator or the for the people who have a PC and don't want other user (friend or family) running a few program in their PC.

          Usually the program can be blocked on the PC to prevent other user change setting in the computer such as regedit.exe, cmd.exe, etc. Other benefit, with this tricks you can block windows application from running without windows application blocker software. To do this tips is easy you can change some registry setting on your Windows PC. I have tested this tips in my computer and it work.

Here comes the way to Block Specific Program from Running in Windows:

  • Open your registry editor (Click Start-Run then type regedit), then find the following key:
    HKEY_CURRENT_USER / Software / Microsoft / Windows / CurrentVersion / Policies / Explorer
  • If you have found the key, add new DWORD Value and rename it to be DisallowRun.
  • Double click the value and set data value to be 1.
  • Create new key under Explorer key and rename it to be DisallowRun, so the complete key will be like this:
    HKEY_CURRENT_USER / Software / Microsoft / Windows / CurrentVersion / Policies / Explorer / DisallowRun
  • On DisallowRun key, create new String Value, and rename it as anything you like(example: application1). Double click the value and set the data value by application that you want to block. (Example winamp.exe, cmd.exe, or regedit.exe)
  • Close your registry editor.
  • Logout or restart PC for changes to take effect.
        This method will work in Windows starting from XP.


If you have any issues with the information provided, feel free to mail me at manigandasuresh@gmail.com

Thursday, 10 January 2013

Convert LPWSTR to string

C++ Code:

bool LPWSTR2String(std::string& outString, const LPWSTR inLPWSTR, UINT codepage = CP_ACP)
{
    bool retCode = false;
    char* temp = 0;
    int bytesRequired;
    bytesRequired = WideCharToMultiByte(codepage, 0, inLPWSTR, -1, 0, 0, 0, 0);
    if (bytesRequired > 0)
    {
        temp = new char[bytesRequired];
        int rc = WideCharToMultiByte(codepage, 0, inLPWSTR, -1, temp, bytesRequired, 0, 0);
        if (rc != 0)
        {
            temp[bytesRequired-1] = 0;
            outString = temp;
            retCode = true;
        }
    }
    delete [] temp;
    return retCode;
}