Desktop Functions: Smart Device Functions:
|
Search Results for "Command" in [All]Interfaces
void CommandStateChange(int Command, [MarshalAs(UnmanagedType.VariantBool)] bool Enable);
Sub CommandStateChange(ByVal Command As Integer, <MarshalAs(UnmanagedType.VariantBool)> ByVal Enable As Boolean)
void InvokeCommand(IntPtr pici);
void GetCommandString(int idcmd, uint uflags, int reserved, StringBuilder commandstring, int cch); 3: IDeskBand ''' Specifies Style of the band object, its Name(displayed in explorer menu) and HelpText(displayed in status bar when menu command selected). 4: IDeskBand2 ''' Specifies Style of the band object, its Name(displayed in explorer menu) and HelpText(displayed in status bar when menu command selected).
uint uCommand, uint dwData,
Function ShowHelp(ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal pszHelpFile As String, ByVal uCommand As Integer, ByVal dwData As Integer, ByVal ptMouse As tagPoint, <MarshalAs(UnmanagedType.IDispatch)> ByVal pDispatchObjectHit As Object) As Integer public interface IOleCommandTarget
//IOleCommandTarget interface from your application, it would
Interface IOleCommandTarget
public interface IOleCommandTarget
//IOleCommandTarget interface from your application, it would Here is some complete code for the two classes that are required to fully utilize the IOleCommandTarget COM interface as referenced on http://msdn.microsoft.com/en-us/library/office/aa701079(v=office.12).aspx#infopath2007hostinginfopathforms_notavailable . I am posting this becasue we all know how MS likes to make links and pages disappear from time to time. While they are still valid, you can get example projects at: http://www.microsoft.com/en-us/download/details.aspx?id=21356 InfoPath2007UsingIOLECommands.exe and InfoPath2007UsingIOLECommandsCOM.exe. Happy InfoPathing! If there is such a thing. The happy part that is...
/// This class' methods wrap the IOLE commands.
/// for using IOLE Commands.
public class NativeCommands
private string lastCommandExecuted;
/// returns the last command that was executed.
public string LastCommandExecuted
return lastCommandExecuted;
/// This structure holds the command to be queried and the result of the query
/// Command to be queried
/// Gets or sets the command to be queried.
//import the IOLECommandTarget interface to perform IOLE commands
//IOLECommandTarget is registered in the registry
private interface IOleCommandTarget
/// Checks to see if a given command can be executed
/// <param name="pguidCmdGroup">Unique identifier of the command group, NULL to specify the standard group</param>
/// <param name="cCmds">The number of commands in the prgCmds array</param>
/// <param name="prgCmds">Array of OLECMD structures that indicate the commands status information is required</param>
/// <param name="pCmdText">Pointer to name or status of command, NULL indicates this is not necessary</param>
/// Executes a specified command
/// <param name="pguidCmdGroup">Command group</param>
/// <param name="nCmdID">Identifier of command to execute</param>
/// <param name="nCmdExecOpt">Options for executing the command</param>
/// <param name="pvaOut">Command output</param>
/// Designates the type of support provided by an object for the specified command
/// The command is supported by this object
/// The command is available and enabled
/// The command is an on-off toggle and is currently on
/// Queries whether or not a command can be executed
/// <param name="commandID">ID number of the command to query</param>
/// <returns>True if command can be performed and false if it cannot</returns>
public bool QueryCommandStatus(FormControlCommandIds.CommandIds commandId)
OLECMD[] commands = new OLECMD[1];
commands[0].CmdId = Convert.ToUInt16(commandId,CultureInfo.CurrentCulture);
commands[0].CmdF = 0;
QueryCommandStatus(commands);
//if command is supported and enabled command can be executed
return (((commands[0].CmdF & (uint)OleCmdf.Supported) != 0) && ((commands[0].CmdF & (uint)OleCmdf.Enabled) != 0));
/// Queries whether or not a command can be executed
/// <param name="commands">Group of commands to be queried</param>
public void QueryCommandStatus(OLECMD[] commands)
//Get a IOLECommandTarget object form the ActiveX control
IOleCommandTarget commandTarget = _infoPathControl.GetOcx() as IOleCommandTarget;
commandTarget.QueryStatus(ref FormControlCommandIds.CommandGroup, Convert.ToUInt16(commands.Length), commands, IntPtr.Zero);
throw new HostedException("An error occurred while attempting to query commands", ex);
#region Command Execution
/// Checks whether or not the specified command is on or off
/// <param name="commandID">Command to be executed</param>
/// <returns>True if command is activated or False if not</returns>
public bool IsCommandOn(FormControlCommandIds.CommandIds commandId)
OLECMD[] commands = new OLECMD[1];
commands[0].CmdId = Convert.ToUInt16(commandId,CultureInfo.CurrentCulture);
commands[0].CmdF = 0;
QueryCommandStatus(commands);
return (((commands[0].CmdF & (uint)OleCmdf.Supported) != 0) && ((commands[0].CmdF & (uint)OleCmdf.Enabled) != 0) &&
((commands[0].CmdF & (uint)OleCmdf.Latched) != 0));
/// Executes a given command
/// <param name="CommandID">Command to be executed</param>
/// <returns>Results of executing a command</returns>
public object ExecuteCommand(FormControlCommandIds.CommandIds commandId)
return ExecuteCommand(commandId, null);
/// Executes a given command with specified parameters
/// <param name="CommandID">Command to be executed</param>
/// <returns>Results of executing the command</returns>
public object ExecuteCommand(FormControlCommandIds.CommandIds commandId, object vaIn)
//remember the last command executed
lastCommandExecuted = commandId.ToString();
//make sure the command can be executed first
if (!QueryCommandStatus(commandId))
// Get the commandTarget from the control
IOleCommandTarget commandTarget = _infoPathControl.GetOcx() as IOleCommandTarget;
commandTarget.Exec(ref FormControlCommandIds.CommandGroup, Convert.ToUInt16(commandId,CultureInfo.CurrentCulture),
throw new HostedException("An error occurred while executing command " + commandId.ToString(), ex);
/// The class makes calls to perform commands against the form control
/// Class is designed to be a central point for executing commands against a form control
public class FormController : NativeCommands
/// Commands
/// Uses the supported InfoPath IOLECommand
/// Makes sure the command was executed properly
/// <param name="commandResult">The result from executing the command</param>
/// <returns>The result from executing the command</returns>
private object ChkResult(object commandResult)
if ((commandResult !=null) && (commandResult.GetType().Equals(typeof(int))))
int result = (int)commandResult;
throw new NonApplicableCommandException("The command could not be executed at this time because it is not applicable. Command: " +
LastCommandExecuted);
return commandResult;
/// Makes sure the command was executed properly
/// <param name="commandResult">The result from executing the command</param>
/// <param name="expectedReturnType">The type of object the command was expected to return</param>
/// <returns>The result from executing the command</returns>
private object ChkResult(object commandResult, Type expectedReturnType)
commandResult = ChkResult(commandResult);
if ((commandResult!=null) && (!commandResult.GetType().Equals(expectedReturnType)))
" but received " + commandResult.GetType().ToString() + "\nCommand: " + LastCommandExecuted);
return commandResult;
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Save));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SaveAs));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Close));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingBold));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingItalic));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingUnderline));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingStrikethrough));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingSuperscript));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingSubscript));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IncreaseFontSizeBy2));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DecreaseFontSizeBy2));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ClearFontFormatting));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingHeading1));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingHeading2));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingHeading3));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingHeading4));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingHeading5));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingHeading6));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFontFormattingNormal));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFontsAvailableCount), typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFontAvailableByIndex, index), typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedTextFont),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedTextFont, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFontSizesAvailableCount),typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFontSizeAvailableByIndex, index), typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedTextFontSize), typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedTextFontSize, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedTextFontColor), typeof(int)), CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedTextFontColor, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetDefaultFontColor), typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedTextHighlightColor), typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedTextHighlightColor, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetDefaultHighlightColor), typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.AlignTextLeft));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.AlignTextCenter));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.AlignTextRight));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.AlignTextJustify));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IncreaseIndent));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DecreaseIndent));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSingleLineSpacing));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetDoubleLineSpacing));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Set15LineSpacing));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedTextBackgroundColor)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedTextBackgroundColor, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Undo));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Redo));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Cut));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Copy));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Paste));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectAll));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.FormatPainterCopyFormatting));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.FormatPainterApplyFormatting));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.FormatPainterCopyFormattingPersistent));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.FormatPainterApplyFormattingPersistent));
return IsCommandOn(FormControlCommandIds.CommandIds.SetFindReplaceOptionUseWildcards);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFindReplaceOptionUseWildcards, value));
return IsCommandOn(FormControlCommandIds.CommandIds.SetFindReplaceOptionMatchCase);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFindReplaceOptionMatchCase, value));
return IsCommandOn(FormControlCommandIds.CommandIds.SetFindReplaceOptionWholeWordOnly);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFindReplaceOptionWholeWordOnly, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFindReplaceOptionSearchDirection),typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFindReplaceOptionSearchDirection, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFindReplaceState),typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFindString),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFindString, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetReplaceWithString),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetReplaceWithString, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.FindReplaceFindNext));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Replace));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ReplaceAll));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ClearBulletedList));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ClearNumberedList));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertNumberedList));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertBulletedList));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertNumberedListDecimal));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertNumberedListRomanUppercase));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertNumberedListRomanLowercase));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertNumberedListAlphaUppercase));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertNumberedListAlphaLowercase));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertBulletedList));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertBulletedListEmptyCircle));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertBulletedListSolidSquare));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DrawTable));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.EraseTable));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertTable, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DeleteSelectedTable));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectTable));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertColumnLeft));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertColumnRight));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertRowAbove));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertRowBelow));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DeleteSelectedColumns));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DeleteSelectedRows));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectColumns));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectPreviousColumn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectNextColumn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectRows));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectPreviousRow));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectNextRow));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectCell));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.MergeCells));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SplitCells, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedCellAlignmentTop));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedCellAlignmentMiddle));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedCellAlignmentBottom));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedCellVerticalAlignment),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedCellPadding, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedCellTopPadding),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedCellRightPadding),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedCellBottomPadding),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedCellLeftPadding),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetTableHorizontalAlignment),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTableHorizontalAlignment, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetTableDirection),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTableDirection, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedRowHeight),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedRowHeight, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSelectedColumnWidth),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedColumnWidth, value));
return IsCommandOn(FormControlCommandIds.CommandIds.SelectNextRow);
return IsCommandOn(FormControlCommandIds.CommandIds.SelectPreviousRow);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectNextRow));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectPreviousRow));
return IsCommandOn(FormControlCommandIds.CommandIds.SelectNextColumn);
return IsCommandOn(FormControlCommandIds.CommandIds.SelectPreviousColumn);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectNextColumn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectPreviousColumn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.FindNextMisspelledWord),typeof(bool)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSpellingSuggestionsCount),typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSpellingSuggestion, index), typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetCurrentMisspelledWord),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IgnoreMisspelledWord, misspelled));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IgnoreAllOfMisspelledWord, misspelled));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.CorrectMisspelledWord, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.CorrectAllOfMisspelledWord, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.AddWordToDictionary, misspelled));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.DeleteMisspelledWord, misspelled));
return IsCommandOn(FormControlCommandIds.CommandIds.SetSpellingOptionCheckAsYouType);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSpellingOptionCheckAsYouType, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetPictureInlineWithText));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetPictureToLeftOfText));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetPictureToRightOfText));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetPictureHeight),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetPictureWidth, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetPictureWidth),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetPictureWidth, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetPictureAlternativeText),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetPictureAlternativeText, value));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetPictureTextWrapping),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowInsertSymbolDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertImage, filePath));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertPictureFromFile));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertHorizontalLine));
return IsCommandOn(FormControlCommandIds.CommandIds.SelectHyperlink);
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetHyperlinkAddress),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetHyperlinkDisplayText),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SelectHyperlink));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.InsertHyperlink, vaIn));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.RemoveHyperlink));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GotoFirstErrorOnView));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GotoNextErrorOnView));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowCurrentErrorMessage));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.WorkOffline));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IsFormDirectionLeftToRight),typeof(uint)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IsFormDirectionRightToLeft),typeof(uint)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTextDirectionDefault));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTextDirectionLeftToRight));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTextDirectionRightToLeft));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.Submit));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetSubmitButtonCaption),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowBordersShadingDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowDigitalSignaturesDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowSetLanguageDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowMergeFormDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowImportFormDataDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowExportToWebDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowExportToPDFXPSDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ShowExportToExcelDialog));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetAutoSpaceBetweenAsianTextAndNumbers));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetAutoSpaceBetweenAsianAndLatinText));
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.ClearAutoSpace)); 7: IShellLinkA
/// <summary>Retrieves the command-line arguments associated with a Shell link object</summary>
/// <summary>Sets the command-line arguments for a Shell link object</summary>
/// <summary>Retrieves the show command for a Shell link object</summary>
/// <summary>Sets the show command for a Shell link object. The show command sets the initial show state of the window.</summary>
'[helpstring("Retrieves the shell link command-line arguments")]
'[helpstring("Sets the shell link command-line arguments")]
'[propget, helpstring("Retrieves or sets the shell link show command")]
'[propput, helpstring("Retrieves or sets the shell link show command")] 8: IShellLinkW
/// <summary>Retrieves the command-line arguments associated with a Shell link object</summary>
/// <summary>Sets the command-line arguments for a Shell link object</summary>
/// <summary>Retrieves the show command for a Shell link object</summary>
/// <summary>Sets the show command for a Shell link object. The show command sets the initial show state of the window.</summary>
''' <summary>Retrieves the command-line arguments associated with a Shell link object</summary>
''' <summary>Sets the command-line arguments for a Shell link object</summary>
''' <summary>Retrieves the show command for a Shell link object</summary>
''' <summary>Sets the show command for a Shell link object. The show command sets the initial show state of the window.</summary>
// Command creation callback
HRESULT OnCreateUICommand(UInt32 commandId,
UI_CommandType typeID,
[Out, MarshalAs(UnmanagedType.Interface)] out IUICommandHandler commandHandler);
// Command destroy callback
HRESULT OnDestroyUICommand(UInt32 commandId,
UI_CommandType typeID,
[MarshalAs(UnmanagedType.Interface)] IUICommandHandler commandHandler);
// Command handler interface
public interface IUICommandHandler
HRESULT Execute(UInt32 commandId, // the command that has been executed
[MarshalAs(UnmanagedType.Interface)] IUISimplePropertySet commandExecutionProperties); // additional data for this execution
HRESULT UpdateProperty(UInt32 commandId, 11: IUIFramework
// Loads and instantiates the views and commands specified in markup
HRESULT GetUICommandProperty(UInt32 commandId, [In] ref PropertyKey key, out PropVariant value);
HRESULT SetUICommandProperty(UInt32 commandId, [In] ref PropertyKey key, [In] ref PropVariant value);
HRESULT InvalidateUICommand(UInt32 commandId, UI_Invalidations flags, [In] ref PropertyKey key);
// Flush all the pending UI command updates 12: IWiaDevMgr
[In, MarshalAs(UnmanagedType.BStr)] string strCommandline, 13: IWiaItem
void DeviceCommand( dhcpsapi
SqlCommand selCommand = new SqlCommand(strSQL, sqlConnection1);
selCommand.CommandType = CommandType.Text;
SqlDataReader rowReader = selCommand.ExecuteReader(); gsapi
// execute this command, to convert pdf to tiff coredll16: AppendMenu
uint MF_BYCOMMAND = 0x00000000; 17: CreateProcess
string lpCommandLine, 18: EnableMenuItem
uint MF_BYCOMMAND = 0x00000000; Use MF_BYCOMMAND to specify the item ID on [itemId] parameter or use MF_BYPOSITION to specify the zero-based index of the item, if neither MF_BYCOMMAND nor MF_BYPOSITION is specified the item ID is used.
EnableMenuItem(hMenu, 1002, MF_BYCOMMAND | MF_GRAYED); 19: NOTIFYICONDATA
uint WM_COMMAND = 0x0111; 20: ShowWindow nCmdShow is an integer type parameter specifying how the window is to be shown. See ShowWindowCommand wininet21: FtpCommand
public static extern bool FtpCommandA
[MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszCommand,
IntPtr phFtpCommand);
Declare Function FtpCommandA Lib "wininet.dll" _
ByVal lpszCommand As String, _
ByVal phFtpCommand As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean lpszCommand (in) A pointer to a string that contains the command to send to the FTP server. phFtpCommand (out) A pointer to a handle that is created if a valid data socket is opened. The fExpectResponse parameter must be set to TRUE for phFtpCommand to be filled.
Dim ret As Boolean = FTPCommandA(ConnectionHandle, False, 0, sCommand, IntPtr.Zero, IntPtr.Zero) msi22: MsiApplyPatch
static extern UInt32 MsiApplyPatch(string patchPackage, string installPackage, INSTALLTYPE installType, string commandLine);
commandLine
Specifies command line property settings
static extern UInt32 MsiInstallProduct(string packagePath, string commandLine);
Declare Function MsiInstallProduct Lib "msi.dll" (packagePath As String, commandLine As String) As UInt32 szCommandLine A null-terminated string that specifies the command line property settings. This should be a list of the format Property=Setting Property=Setting. For more information, see About Properties. To perform an administrative installation, include ACTION=ADMIN in szCommandLine. For more information, see the ACTION property. You can completely remove a product by setting REMOVE=ALL in szCommandLine.
// The sql command. Note the "?" placeholder for the value.
// Open a view to use to apply the change. Here's where you specify your sql command. userenvTo build: run the following commands at bash command prompt, after copying an icon file, say bfe.ico, to the cwd: Structures
public struct CMINVOKECOMMANDINFOEX {
public int cbSize; // Marshal.SizeOf(CMINVOKECOMMANDINFO)
public int dwHotKey; // Optional hot key to assign to any application activated by the command. If the fMask member does not specify CMIC_MASK_HOTKEY, this member is ignored.
public IntPtr hIcon; // Icon to use for any application activated by the command. If the fMask member does not specify CMIC_MASK_ICON, this member is ignored.
public string lpVerbW; // Unicode verb, for those commands that can use it.
public string lpParametersW; // Unicode parameters, for those commands that can use it.
public string lpDirectoryW; // Unicode directory, for those commands that can use it.
public POINT ptInvoke; // Point where the command is invoked. This member is not valid prior to Microsoft Internet Explorer 4.0.
Structure CMINVOKECOMMANDINFOEX
public static extern bool CreateProcessWithTokenW(IntPtr hToken, LogonFlags dwLogonFlags, string lpApplicationName, string lpCommandLine, CreationFlags dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
Public Shared Function CreateProcessWithTokenW(hToken As IntPtr, dwLogonFlags As Integer, lpApplicationName As String, lpCommandLine As String, dwCreationFlags As Integer, lpEnvironment As IntPtr, lpCurrentDirectory As IntPtr, ByRef lpStartupInfo As STARTUPINFO, ByRef lpProcessInformation As PROCESS_INFORMATION) As Boolean 29: LANA_ENUM
public uint dwCommandId; 31: NAME_BUFFER 32: NCB
byte ncb_command;
Dim ncb_command As Byte
UCHAR ncb_command; /* command code */
/* state when an ASYNCH command */
public ushort Command; 34: ScsiPassThrough
/// Wrapper for the ScsiPassThrough command
/// Constructor for the command to send to the robot
public string lpCommand;
Public lpCommand As String
public int CurrentCommands;
public bool CommandQueueing; 38: TBBUTTON
public int idCommand;
Public idCommand As Int32 39: TBBUTTONINFO
public int idCommand; 40: WINDOWPLACEMENT
public ShowWindowCommands ShowCmd;
Public showCmd As ShowWindowCommand user3241: CancelShutdown 42: CreatePopupMenu
void IContextMenu.GetCommandString(int idCmd, uint uFlags, int pwReserved, StringBuilder commandString, int cchMax)
commandString = new StringBuilder("...");
commandString = new StringBuilder("...");
void IContextMenu.InvokeCommand (IntPtr pici)
Type typINVOKECOMMANDINFO = Type.GetType("ShellExt.INVOKECOMMANDINFO");
INVOKECOMMANDINFO ici = (INVOKECOMMANDINFO)Marshal.PtrToStructure(pici, typINVOKECOMMANDINFO); 43: CreateWindowEx
Win32.ShowWindow(hwnd, ShowWindowCommands.Normal );
enum DeferWindowPosCommands :uint {
Public Enum DeferWindowPosCommands As UInteger
Public Enum DeferWindowPosCommands 45: DeleteMenu
internal const UInt32 MF_BYCOMMAND =0x00000000; 46: EnableMenuItem
internal const UInt32 MF_BYCOMMAND =0x00000000;
Main(System.Environment.GetCommandLineArgs()) 48: GetLastInputInfo Compile at bash command line with: gcc -Wall idle.c 49: GetMenu internal const UInt32 MF_BYCOMMAND =0x00000000; MF_BYCOMMAND Indicates that uIDItem gives the identifier of the menu item. If neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified, the MF_BYCOMMAND flag is the default flag. 50: GetMenuItemID
Sendmessage(hwndMain, WM_COMMAND, intMID, 0) 'Click the MenuItem! 51: GetMenuString internal const UInt32 MF_BYCOMMAND =0x00000000; MF_BYCOMMAND Indicates that uIDItem gives the identifier of the menu item. If neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified, the MF_BYCOMMAND flag is the default flag. 52: GetRawInputData
/// <param name="uiCommand">Command to issue when retrieving data.</param>
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RAWINPUT pData, ref int pcbSize, int cbSizeHeader);
/// <param name="uiCommand">Command to issue when retrieving data.</param>
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, byte[] pData, ref int pcbSize, int cbSizeHeader);
outSize = Win32API.GetRawInputData(m.LParam, RawInputCommand.Input, out input, ref size, Marshal.SizeOf(typeof(RAWINPUTHEADER)));
public static extern uint GetRawInputDeviceInfo(int deviceHandle, uint command, ref DeviceInfo data, ref uint dataSize);
static extern uint GetRawInputDeviceInfo(IntPtr hDevice, uint uiCommand, IntPtr pData, ref uint pcbSize);
Declare Function GetRawInputDeviceInfo Lib "user32.dll" Alias "GetRawInputDeviceInfoW" (ByVal hDevice As IntPtr, ByVal uiCommand As DeviceInfoTypes, ByVal pData As IntPtr, ByRef pcbSize As UInteger) As Integer 55: GetSubMenu
Sendmessage(hwndMain, WM_COMMAND, intMID, 0) 'Click the MenuItem! 56: MB_GetString 57: mouse_event This code assumes a form called frmMain with a command button called cmdClick a picture box called picClicker and a text box called txtResults Note Twips are no more. Also, I stripped the FOR loop of delta moves from the command button click to the middle of the picture box. 58: ReleaseCapture
private const int WM_SYSCOMMAND = 0x112;
SendMessage(ctrl.Handle, WM_SYSCOMMAND, MOUSE_MOVE, ref nul); 59: SetParent
const int WM_SYSCOMMAND = 274;
SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0); 60: ShowWindow
Public Shared Function ShowWindowAsync(hWnd As IntPtr, <MarshalAs(UnmanagedType.I4)>nCmdShow As ShowWindowCommands) As <MarshalAs(UnmanagedType.Bool)> Boolean Cut off search results after 60. Please refine your search. |