GetWindowSize – Get a window’s dimension in pixels
Private Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Declare Function GetWindowRect Lib “user32” (ByVal hWnd As Long, _ lpRect As RECT) As
Private Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Declare Function GetWindowRect Lib “user32” (ByVal hWnd As Long, _ lpRect As RECT) As
Sometimes, sprintf() is unavoidable. For example, when compatibility with C is paramount, Sprintf() has a safer version called snprintf(), which doesn’t write past its buffer’s limits. However, because snprintf() was
ASSERT is a very helpful macro for debugging, because it helps root out false assumptions. However, many programmers make the mistake of putting actual assignments inside the macro. Consider the
If you want to convert from a const to a nonconst or from a volatile to a nonvolatile, you can use const_cast. This is the only conversion allowed with const_cast.
In pre-standard C, I/O operations were based on the Unix APIs. Instead of FILE pointers and functions such as fopen(), fread(), and fclose() that are defined in the header, Unix
The Standard Library doesn’t have a function for rounding floating point variables. However, you can easily round numbers as follows: double d=42.666;int rounded=d+0.5; // rounded = 43d=rounded; // d is
Tool tips are handy for providing explanations for buttons and other fixed components in a panel. Sometimes, it
In Web based programming, we usually check querystring parameters in middle tier java objects and do tedious, if not long, checks via if/else, to perform appropriate action or instantiate classes.
The secret lies in the Runtime class. Runtime contains the methodexec, which takes the basic form of: Process exec(String command) orProcess exec(String[] comdarray) orProcess exec(String[] cmdarray, String[] envp, File dir)