Monday, December 12, 2011

Microsoft Picture Fax Viewer problem

With picasa and a host of other picture viewing programs, the default image viewer Microsoft's Picture and Fax Viewer kind of went into oblivion for me. One fine day, I wanted to use it for viewing images (out of pure nostalgia) and found out that it was not getting listed at all in my "Open with" menu. I also was not able to find it through any program. After googling, I found out that it is actually a DLL, shimgvw.dll and needs to be launched with rundll32.exe. So, I tried that. I typed

rundll32 shimgvw.dll,ImageView_Fullscreen

both in "Run" prompt as well as from the command line. Both gave me an error. "Missing entry ImageView_Fullscreen". None of the forums seem to have given a solution to fix this issue. After some more unlucky searches, I ended up with this command to be run. In the command line, run "regsvr32 /i shimgvw.dll" (without the quotes). It should say "registered successfully". Voila, my problem was solved. The viewer started appearing in my right click menu. I still do not know how it vanished in the first place. But, atleast I know how to bring it back.

Friday, May 27, 2011

Disappeared Window Manager

I use Ubuntu 10.04 at home. I am a GNOME guy since the days of RHL 9. One day, suddenly, all of a sudden, the maximize, minimize and close icons on all my windows just disappeared. Just like that. Didnt know what hit me. I had to go to the menu item, and close it. Then Googling, I found out that there is this guy called "metacity", a window manager, who is incharge of these kinds of stuff in the GUI for GNOME. From this link, I found out how to give it a boot, and bring back my lifesavers.

All you had to do is:

1. Check if its already running
ps aux | grep metacity


2. Then, if its not (even if its running), just load it.
sudo metacity


3. If it gives an error like "Window manager warning: Screen 0 on display ":0.0" already has a window manager;", then just force it

 sudo metacity --replace


There is a catch here. this will occupy a terminal window. So, I'd suggest, you give the system a restart, if you arent into anything utterly serious.

I expertly went ahead and killed that process, and my whole GUI went for a toss. Nothing worked (except the mouse). So, I had to run to my second login screen, do a
kill -9 METACITY-PID
of the metacity manager, and restart it with
sudo metacity --display=:0.0 --replace


And then, after I had saved my documents, I restarted the system. All is well, that restarted well.


Source link

Friday, September 17, 2010

Disable Autorun for USB Pen drives and CD Drives

Disabling autorun for USB drives prevents a lot of virus from jumping into the system as most of the "small" guys use the AutoRun feature to trigger themselves. There is a way to disable it completely.

Click "Start / Run" and type "gpedit.msc". It should open a windows like the one below

(Click on it to open a bigger image).


In that go to the branch on the left hand side frame following the below path

"Local Computer Policy / Computer Configuration / Administrative Templates / System"

Clicking on "System" will list lots of items on the right window. One of them is "Turn Off Autoplay".

Double click on that, make sure to select "Enabled" radio button and on the list box below, select "All Drives".

This should disable Autorun in all usb and cd/dvd drives on the system.

Rebooting Mac

Mac has the uncanny habit of screwing itself up (atleast mine does) and then not telling the user what happened. Let me explain. All of a sudden, the initial grey screen comes up with the loading "rotator" thingy. And thats about it. Nothing more happens. And when I force shutdown and restart, it does not actually start from the beginning, meaning it does not do a "CHUNNNGGG" chime sound when restarting.

And again, the cloud was the Good Samaritan (who else is there). Pressing the keyboard combination of "Command(Apple)-Option-P-R" and holding it like that (NB: it needs some skill to hold this key combination) until the chime sounds twice should resolve the issue. But, my machine seems to be a bit more adamant than that. Even though I have "CHUNNNG"ed it, it still stops are the rotator screen. :-( Will update the post as and when I find a solution.

Source: TUAW

Thursday, April 29, 2010

Control characters in source file after ftp

<p align="justify">My friend had a problem with a Linux file. he had ftp'd a file from windows into Linux. Now, every line in that file has a ^M at its end. He wanted a way to avoid it, and/or remove the control characters from such files.

Browsing thru the web, there were multiple answers provided.

1. While uploading via ftp, use the ASCII mode, not the binary mode. This will translate the line ends properly. Binary mode is to be used for programs and archive files only (like zip, tar, etc..)
2. dos2unix (and its complementary unix2dos utility)
3. cat file | tr -d "\r" > newfile
4. sed 's/.$//' infile.txt > outfile.txt
5. col -bx < oldfile > newfile

Disclaimer: I have not tried this in any of the ways mentioned. I am just listing it for easy access only.</p>

Saturday, November 14, 2009

xp disk defragmenter does not analyze or defrag

My system (as usual) was starting too sluggishly for my liking to start the defragmentation. But, when I clicked "Analyze" or "Defrag", nothing happened. I mean, absolutely nothing. No error messages. Not even a warning. Something in the lines of "hey moron, you are doing something wrong here" would have been more appropriate. Well, like any dumb user, I entered the realm of Google, and ended up triggering the defrag.exe from the command prompt. There, I got something. "Windows cannot connect to the Disk Defragmenter engine". Now, if only I KNEW where and how the hell I kick start that damn engine. Once again Larry ewing's nerds helped me from yonder. It seemed that the "DCOM Server Process Launcher" was not running. It had to be kick started for the defragger to skate board on. So, I clicked "Start/Run" and typed in "services.msc" and opened the services window. (the more normal way would be to go to My Computer, right click on it, Manage, and click services, bah, am a lazy guy). Kick started it, (but it acutally didnt. I had to set the mode to "Automatic" and restart the system). Then, I launched our guy, and voila, we are up and running.... Okay, he is working RIGHT NOW. Off I go. Tata

Thursday, August 06, 2009

Mouse scroll in VB6 IDE

VB6 had the dubious distinction of the only IDE without a supported mouse scroll in the code window. Fortunately, in true Microsoft style, they have given workarounds and patches to overcome this disability. Check this Microsoft's link on how to enable/activate mouse scrolling in the VB IDE

Friday, June 19, 2009

How to Enable Tooltip for Dialog Controls

Lets get things straight. You want the user to be more dumb and want him/her to get an idea of what he wants to do with all the controls on his screen without reading the help file? Then dive right in. Else, Ciao. Have a good day.



Step 1: Enable the tooltip command using the command EnableToolTips (TRUE). Ideal location to include this line would be in your class' init routine CYourClass::InitDialog.

Step 2: Windows sends the tooltip related controls in TTN_NEEDTEXT message. We need to handle this. Add the following code to enable your handler in the MessageMap function

BEGIN_MESSAGE_MAP(CMyClassDlg, CDialog)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT, 0, 0xFFFF, OnToolTipNotify)
END_MESSAGE_MAP()


Step 3: Declare the handler function in your header.
afx_msg bool OnToolTipNotify( UINT id, NMHDR* pNMHDR, 
LRESULT* pResult );


Step 4: We are near. Just add then handler code in your cpp. Below is a sample of the same

bool CMyClassDlg::OnToolTipNotify( 
UINT id, NMHDR* pNMHDR, LRESULT* pResult )
{
// Get the tooltip structure.
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;

// Actually the idFrom holds Control's handle.
UINT CtrlHandle = pNMHDR->idFrom;

// Check once again that the
// idFrom holds handle itself.
if (pTTT->uFlags & TTF_IDISHWND)
{
// Get the control's ID.
UINT nID = ::GetDlgCtrlID( HWND( CtrlHandle ));

// Now you have the ID. depends on control,
// set your tooltip message.
switch( nID )
{
case ID_BUTTON1:
// Set the tooltip text.
pTTT->lpszText = _T("First Button");
break;

case ID_EDIT1:
// Set the tooltip text.
pTTT->lpszText = _T("First Edit Box");
break;

default:
// Set the tooltip text.
pTTT->lpszText = _T("Tooltips everywhere!!!");
break;
}

return TRUE;
}

// Not handled.
return FALSE;
}