Free Source Code and Program Tips
Archive for March, 2007
How to check whether the window is in minimise or Maximise mode
Mar 21st
CWnd::IsIconic BOOL IsIconic( ) const; Return Value Nonzero if CWnd is minimized; otherwise 0. Remarks Specifies whether CWnd is minimized (iconic). Example // This code, normally emitted by the AppWizard for a dialog-based // project for the dialog’s WM_PAINT handler, runs only if the // window is iconic. The window erase the icon’s area, then
sscanf with CString
Mar 20th
Problem: In the C time, we used to use sscanf to read data from string as following: char strUserName[20], strPassword[20]; // if the content of m_recvBuff is “Microsoft Bill”. sscanf((const char *)m_recvBuff, “%s %s”, strUserName, strPassword); And when you first get CString in sight, you may write the similar code: CString strUserName, strPassword; // if the
How to launch an Application with Admin privileges in VISTA
Mar 8th
When you develop some admin utility, which will need the administrator privilege to configures some H/W connected ove LAN, etc. And you will found that the application is running propertyly in XP just by a double click of the mouse, where as in VISTA if you run it as Administrator then only running. So, how