Function Reference


_WinAPI_SetCurrentProcessExplicitAppUserModelID

Specifies a unique application-defined Application User Model ID that identifies the current process to the taskbar

#include <WinAPIShellEx.au3>
_WinAPI_SetCurrentProcessExplicitAppUserModelID ( $sAppID )

Parameters

$sAppID The string that represents an Application User Model ID (AppUserModelID). This identifier allows an
application to group its associated processes and windows under a single taskbar button. An application
must provide its AppUserModelID in the following form and can have no more than 128 characters and
cannot contain spaces.

CompanyName.ProductName.SubProduct.VersionInformation
(See MSDN for more information)

Return Value

Success: 1.
Failure: 0 and sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

Remarks

This method must be called during an application's initial startup routine before the application presents any
UI or makes any manipulation of its Jump Lists.

This function requires Windows 7 or later.

See Also

Search SetCurrentProcessExplicitAppUserModelID in MSDN Library.

Example

#NoTrayIcon

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIShellEx.au3>
#include <WinAPISys.au3>

If Number(_WinAPI_GetVersion()) < 6.1 Then
        MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Error', 'Require Windows 7 or later.')
        Exit
EndIf

Local $sAppID = 'Yashied.WinAPIEx.UDF'

Local $sParam
If Not $CmdLine[0] Then
        For $i = 1 To 5
                Switch $i
                        Case 1 To 2
                                $sParam = $sAppID & '.' & $i
                        Case Else
                                $sParam = $sAppID & '.3'
                EndSwitch
                If Not @Compiled Then
                        Run(@AutoItExe & ' "' & @ScriptFullPath & '" ' & $sParam)
                Else
                        Run(@AutoItExe & ' ' & $sParam)
                EndIf
                Sleep(100)
        Next
        Exit
EndIf

_WinAPI_SetCurrentProcessExplicitAppUserModelID($CmdLine[1])

GUICreate($CmdLine[1], 400, 400)
GUISetState(@SW_SHOWMINIMIZED)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE