Tag Archive: api

Apr 01 2008

Problem – Retrieve all Sections from ini File

API Syntax : DWORD GetPrivateProfileSectionNames( LPCTSTR lpszReturnBuffer, DWORD nSize, LPCTSTR lpFileName ); Parameters : lpszReturnBuffer – [out] buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character nSize – [in] The size of the …

Continue reading »

Apr 01 2008

Reading a Specific Key String from ini File

The GetPrivateProfileString function Retrieves a string from the specified section in an initialization file. API Syntax : DWORD GetPrivateProfileString( LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpDefault, LPTSTR lpReturnedString, DWORD nSize, LPCTSTR lpFileName ); Parameters : lpAppName – [in] The name of the section containing the key name. If this parameter is Null, the GetPrivateProfileString function copies …

Continue reading »

Apr 01 2008

What is the Last Window Opened?

Sometimes applications display reports, when the window title depends on server, ip, date an time, report type etc. you can’t predict what will be the window title, only during runtime. I met this issue when an application display several reports types after selecting a menu item. my task is to verify that the window was …

Continue reading »

Apr 01 2008

Find a Window

The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search. API syntax : HWND FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName ); Parameters : lpClassName – [in] string that specifies the class …

Continue reading »

Apr 01 2008

Forcibly Close a Specified Window

The EndTask function is called to forcibly close a specified window. API syntax : BOOL EndTask( HWND hWnd, BOOL fShutDown, BOOL fForce ); Parameters : hWnd – [in] Handle to the window to be closed. fShutDown – [in] Ignored. Must be FALSE. fForce – [in] A TRUE for this parameter will force the destruction of …

Continue reading »

Apr 01 2008

Minimizing a Window

The CloseWindow function minimizes (but does not destroy) the specified window. API syntax : BOOL CloseWindow( HWND hWnd ); Parameters : hWnd – [in] Handle to the window to be minimized. Return Value : If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. Extern.Declare micInteger, “CloseWindow”, …

Continue reading »

Apr 01 2008

Switching Focus between Windows

The SwitchToThisWindow function is called to switch focus to a specified window and bring it to the foreground. API Syntax : VOID SwitchToThisWindow( HWND hWnd, BOOL fAltTab ); Parameters : hwnd – Handle to the window being switched to. fAltTab – A TRUE for this parameter indicates that the window is being switched to using …

Continue reading »

Apr 01 2008

Determine whether a Window is Maximized

The IsZoomed function determines whether a window is maximized. API Syntax : BOOL IsZoomed( HWND hWnd ); Parameters : hWnd – [in] Handle to the window to test. Return Value : If the window is zoomed, the return value is nonzero. If the window is not zoomed, the return value is zero. Extern.Declare micInteger, “IsZoomed”, …

Continue reading »

Apr 01 2008

Determine whether a Specified Window is Minimized

The IsIconic function determines whether the specified window is minimized (iconic). API Syntax : BOOL IsIconic( HWND hWnd ); Parameters : hWnd – [in] Handle to the window to test. Return Value : If the window is iconic, the return value is nonzero. If the window is not iconic, the return value is zero. Extern.Declare …

Continue reading »