9.0

239
vbMinimizedFocus 2 Minimized Window (default)
vbMaximizedFocus 3 Maximized Window
vbNormalNoFocus 4, 8 Normal Deactivated Window
vbMinimizedNoFocus 6, 7 Minimized Deactivated Window
See Also: AppActivate, SendKeys.
Example
Sub Main
X = Shell("Calc") ' run the calc program
AppActivate
X
SendKeys
"% R" ' restore calc's main window
SendKeys
"30*2{+}10=",1 '70
End
Sub
ShowPopupMenu Function
Syntax
ShowPopupMenu(StrArray$( )[, PopupStyle][, XPos, YPos])
Group
User Input
Description
Show a popup menu and return the number of the item selected. The item number is the index of the StrArray
selected minus LBound(StrArray). The value -1 is returned in no menu item is selected.
Parameter Description
StrArray$( ) This one-dimensional array of strings establishes the list of choices. All the
non-null elements of the array are used.
PopupMenuStyle This controls how the popup menu is aligned. Any combination of styles may
used together. See the table below.
XPos When the menu is
p
ut u
p
the ali
g
nment will be at this window
p
osition. If this is
omitted then the current mouse position is used.
YPos When the menu is
p
ut u
p
the ali
g
nment will be at this window
p
osition. If this is
omitted then the current mouse position is used.
PopupStyle Value Effect
vbPopupLeftTopAlign 0 Align menu left edge at XPos and top at YPos. (default)
vbPopupUseLeftButton 1 User can select menu choices with the left mouse button onl
y
.
vbPopupUseRightButton 2 User can select menu choices with the left or right mouse
button.
vbPopupRightAlign 4 Align menu with right edge at the XPos.
vbPopupCenterAlign 8 Align menu center at the XPos.
vbPopupVCenterAlign 16 Align menu center at the YPos.
vbPopupBottomAlign 32 Align menu bottom at the YPos.
Example
Sub Main
Dim
Items(0 To 2) As String
Items(0) = "Item &1"