Export (0) Print
Expand All
Expand Minimize

HELPWININFO structure

Contains the size and position of either a primary or secondary Help window. An application can set this information by calling the WinHelp function with the HELP_SETWINPOS value.

Syntax


typedef struct tagHELPWININFO {
  int   wStructSize;
  int   x;
  int   y;
  int   dx;
  int   dy;
  int   wMax;
  TCHAR rgchMember[2];
} HELPWININFO, *PHELPWININFO, *LPHELPWININFO;

Members

wStructSize

Type: int

The size of this structure, in bytes.

x

Type: int

X-coordinate of the upper-left corner of the window, in screen coordinates.

y

Type: int

Y-coordinate of the upper-left corner of the window, in screen coordinates.

dx

Type: int

The width of the window, in pixels.

dy

Type: int

The height of the window, in pixels.

wMax

Type: int

Options for display of the window. Several values also determine the activation (focus) state of the window or other windows. This member must be one of the following values.

SW_HIDE

Hides the window and passes activation to another window.

SW_MINIMIZE

Minimizes the specified window and activates the top-level window in the z-order.

SW_RESTORE

Same as SW_SHOWNORMAL.

SW_SHOW

Activates a window and displays it in its current size and position.

SW_SHOWMAXIMIZED

Activates the window and displays it as a maximized window.

SW_SHOWMINIMIZED

Activates the window and displays it as an icon.

SW_SHOWMINNOACTIVE

Displays the window as an icon. The window that is currently active remains active.

SW_SHOWNA

Displays the window in its current state. The window that is currently active remains active.

SW_SHOWNOACTIVATE

Displays a window in its most recent size and position. The window that is currently active remains active.

SW_SHOWNORMAL

Activates and displays the window. Whether the window is minimized or maximized, Windows restores it to its original size and position.

rgchMember

Type: TCHAR[2]

The name of the window.

Remarks

Windows Help divides the display into 1024 units in both the X and Y directions. To create a secondary window that fills the upper-left quadrant of the display, for example, an application would specify zero for the x and y members and 512 for the dx and dy members.

To calculate wStructSize properly, the actual size of the string to be stored at rgchMember must be known. Since sizeof(HELPWININFO) includes two TCHARs by definition, they must be taken into account in the final total. The following example shows the proper calculation of an instance of wStructSize.


WORD wSize;
TCHAR *szWndName = TEXT("wnd_menu"); 
size_t NameLength;  
HRESULT hr;
HELPWININFO hwi;

// StringCbLength returns the length of the string without 
// the terminating null character.
hr = StringCbLength(szWndName, STRSAFE_MAX_CCH * sizeof(TCHAR), &NameLength);
    
if (SUCCEEDED(hr))
{
    // Add bytes to account for the name string's terminating null character.
    NameLength + sizeof(TCHAR);
    
    // Determine the size of HELPWININFO without the TCHAR array.
    wSize = sizeof(HELPWININFO) - (2 * sizeof(TCHAR));
    
    // Determine the total size of the final HELPWININFO structure.
    hwi.wStructSize = wSize + NameLength;
}

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h

 

 

Community Additions

ADD
Show:
© 2014 Microsoft