Scared to use GetWindowText!!

Well GetWindowText has got some problem with it that if you invoke this API on a window that is hung, you application also get’s hung! Well what to do? Microsoft has provided an undocumented API which they say is deprecated, but I find it irresistible… InternalGetWindowText 😀 The documentation says this ( http://msdn2.microsoft.com/en-us/library/ms633523.aspx )… This function […]
Continue reading…

 

Restored size of window while maximized!

Use this function… [sourcecode language=’cpp’]CRect GetRestoredSizeOfWindow( HWND hWindow_i ) {     WINDOWPLACEMENT wpPlacement = { 0 };     wpPlacement.length = sizeof( wpPlacement );     GetWindowPlacement( hWindow_i, &wpPlacement );     return wpPlacement.rcNormalPosition; }[/sourcecode] Note: The rectangle returned is relative to your workarea, i.e. desktop area minus any application bars like task bar.
Continue reading…

 

Wanna know the limits of native types?

Use stl class numeric_limits. Wonderful class. It helps you in listing out the Maximum and minimum value for a native type The number of bits taken by a native type Whether a type is signed or unsigned Whether a type can represent a NaN Whether a type can represent positive infinity… etc.. Check out the class […]
Continue reading…