Application Desktop Toolbars 桌面工具栏
生活随笔
收集整理的這篇文章主要介紹了
Application Desktop Toolbars 桌面工具栏
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Application Desktop Toolbars 桌面工具欄(1)
An application desktop toolbar (also called an appbar) is a window that is similar to the Microsoft Windows taskbar. It is anchored to an edge of the screen, and it typically contains buttons that give the user quick access to other applications and windows. The system prevents other applications from using the desktop area occupied by an appbar. Any number of appbars can exist on the desktop at any given time.
? ? 桌面工具欄(也稱作appbar)是類似微軟視窗系統(tǒng)的任務(wù)條的窗口。它緊靠屏幕邊緣,典型的桌面工具欄包括快速訪問其他應(yīng)用程序和窗口的按鈕。系統(tǒng)會防止其他應(yīng)用程序使用被appbar占用的區(qū)域。在任何時刻桌面都可以同時共存多個appbar。
?
About Application Desktop Toolbars
桌面工具欄簡介
?
Windows provides an application programming interface (API) that lets you take advantage of appbar services provided by the system. The services help ensure that application-defined appbars operate smoothly with one another and with the taskbar. The system maintains information about each appbar and sends the appbars messages to notify them about events that can affect their size, position, and appearance.
? ? 微軟視窗提供了一個應(yīng)用編程接口(API)以方便你利用appbar service的特長。這些服務(wù)可以確保應(yīng)用程序定義的appbar和其他appbar或任務(wù)欄之間進行協(xié)調(diào)工作。系統(tǒng)會維護每一個taskbar的信息,并且在有影響taskbar尺寸、位置和外觀等事件發(fā)生時,系統(tǒng)會通知他們。
?
Sending Messages
發(fā)送消息
?
An application uses a special set of messages, called appbar messages, to add or remove an appbar, set an appbar's size and position, and retrieve information about the size, position, and state of the taskbar. To send an appbar message, an application must use the SHAppBarMessage function. The function's parameters include a message identifier, such as ABM_NEW, and the address of an APPBARDATA structure. The structure members contain information that the system needs to process the given message.
? ? 應(yīng)用程序使用一組特殊稱作appbar messages的消息集合,利用這些消息,可以增加、刪除appbar應(yīng)用,設(shè)置appbar的尺寸、位置,接收有關(guān)appbar的尺寸、位置消息以及任務(wù)欄的狀態(tài)信息。應(yīng)用程序使用SHAppBarMessage函數(shù)發(fā)送appbar message,這個函數(shù)包含兩個參數(shù),一個是消息標識符(如:ABM_NEW),另一個是結(jié)構(gòu)體APPBARDATA的地址。結(jié)
構(gòu)體參數(shù)包括系統(tǒng)需要處理的消息的信息。
?
For any given appbar message, the system uses some members of the APPBARDATA structure and ignores the others. However, the system always uses the cbSize and hWnd members, so an application must fill these members for every appbar message. The cbSize member specifies the size of the structure, and the hWnd member is the handle to the appbar's window.
? ? 對任何給定的appbar message,系統(tǒng)只是采用結(jié)構(gòu)體APPBARDATA的部分參數(shù)而忽略其他參數(shù),但是cbSize和hWnd這兩個參數(shù)總是要使用的,因此應(yīng)用程序要為每個appbar message填充這兩個參數(shù)。CbSize參數(shù)指明結(jié)構(gòu)體的大小,hWnd代表appbar的窗口句柄。
?
Some appbar messages request information from the system. When processing these messages, the system copies the requested information into the APPBARDATA structure.
? ? 有一些appbar message可以從系統(tǒng)獲取信息,在處理這些消息的時候,系統(tǒng)會將需要的信息拷貝到結(jié)構(gòu)體APPBARDATA中去。
Application Desktop Toolbars 桌面工具欄(2)
?
注釋:
? ? SHAppBarMessage
WINSHELLAPI UINT APIENTRY SHAppBarMessage(
? ? ? ? ? ? ? ? ? ? ? ? DWORD dwMessage,
? ? ? ? ? ? ? ? ? ? ? ? PAPPBARDATA pData
);
? ?
Sends an appbar message to the system.
向系統(tǒng)發(fā)送appbar message。
?
l ? ? ? ? Returns a message-dependent value. For more information, see the Microsoft Platform SDK documentation for the appbar message sent.
返回值由消息決定,不同的消息返回不同的值。如果需要了解更多的信息,可以參看Microsoft Platform SDK文檔的appbar message sent部分。
?
dwMessage
參數(shù)一:dwMessage
Appbar message value to send. This parameter can be one of the following values:
將要發(fā)送的消息值,這個參數(shù)可以是下面列表中的任一個:
?
ABM_ACTIVATE ? ? Notifies the system that an appbar has been activated.
? ? ? ? ? ? ? ? ? ? 激活一個appbar。
ABM_GETAUTOHIDEBAR ? ?Retrieves the handle to the autohide appbar associated with
? a particular edge of the screen.?
獲得和屏幕邊緣關(guān)聯(lián)的一個自動隱藏appbar的句柄。
ABM_GETSTATE ? ? ? ? Retrieves the autohide and always-on-top states of the
Windows taskbar.
獲得任務(wù)條的自動隱藏、總在最上面屬性的狀態(tài)。
ABM_GETTASKBARPOS ? ? ?Retrieves the bounding rectangle of the Windows taskbar.
獲得任務(wù)條的尺寸。
ABM_NEW ? ? ? ? ? ? ?Registers a new appbar and specifies the message identifier
that the system should use to send notification messages
to the appbar.?
注冊一個appbar并指定消息標識符(給appbar發(fā)送通知用)。
ABM_QUERYPOS ? ? ? ? Requests a size and screen position for an appbar.?
取得appbar的尺寸和appbar在屏幕中的位置。
ABM_REMOVE ? ? ?Unregisters an appbar, removing the bar from the system's
internal list.
注銷appbar并從系統(tǒng)內(nèi)部列表中移除該appbar。
ABM_SETAUTOHIDEBAR ? ? Registers or unregisters an autohide appbar for an edge of
the screen.?
給屏幕的一個邊緣注冊/注銷一個自動隱藏的appbar。
ABM_SETPOS ? ? ?Sets the size and screen position of an appbar.?
? ? ? ? ? ? ? ? ? ? 設(shè)置appbar的尺寸和appbar在屏幕中的位置。
ABM_WINDOWPOSCHANGED ? ? Notifies the system when an appbar's position has
changed.?
通知系統(tǒng)一個appbar的位置已經(jīng)改變。
?
pData
參數(shù)二:pData
Address of an APPBARDATA structure. The content of the structure depends on the value set in the dwMessage parameter.
結(jié)構(gòu)體APPBARDATA的地址。結(jié)構(gòu)體的內(nèi)容依賴于dwMessage參數(shù)的設(shè)置。
?
? ??
Application Desktop Toolbars 桌面工具欄(3)
?
APPBARDATA
typedef struct _AppBarData {
? ? DWORD ?cbSize;
? ? HWND ? hWnd;
? ? UINT ? uCallbackMessage;
? ? UINT ? uEdge;
? ? RECT ? rc;
? ? LPARAM lParam;
} APPBARDATA, *PAPPBARDATA;
?
Contains information about a system appbar message. This structure is used with the SHAppBarMessage function.
? ? appbar message所包含的信息。這個結(jié)構(gòu)體供函數(shù)SHAppBarMessage使用。
?
cbSize: ? ? ? ? ? ?Contains the size of the structure, in bytes.
以字節(jié)形式表示結(jié)構(gòu)體大小。
? ? hWnd: ? ? ? ? ? ? ?Contains the handle to the appbar window.
? ? ? ? ? ? ? ? ? ? ? ? appbar 窗口句柄。
uCallbackMessage: ? ?Application-defined message identifier. The application
uses the specified identifier for notification messages
that it sends to the appbar identified by the hWnd member.
This member is used when sending the ABM_NEW message.
應(yīng)用程序定義的消息標識符。應(yīng)用程序使用該標志符發(fā)送通知消
息到由hWnd指定的appbar。
uEdge: ? ? ? ? ? ? Value that specifies an edge of the screen. This member can
be one of the following values:
指定的屏幕邊緣。這個參數(shù)可以是下列值中的任一個:
ABE_BOTTOM ?Bottom edge.
ABE_LEFT Left edge.
ABE_RIGHT Right edge.?
ABE_TOP Top edge.?
This member is used when sending the ABM_GETAUTOHIDEBAR,
ABM_QUERYPOS, ABM_SETAUTOHIDEBAR, and ABM_SETPOS
messages.?
該參數(shù)只有在發(fā)送ABM_GETAUTOHIDEBAR、ABM_QUERYPOS、
ABM_SETAUTOHIDEBAR和ABM_SETPOS消息時使用。
rc: RECT structure to contain the bounding rectangle, in screen
coordinates, of an appbar or the Windows taskbar. This
member is used when sending the ABM_GETTASKBARPOS,
ABM_QUERYPOS, and ABM_SETPOS messages.?
結(jié)構(gòu)體RECT指定appbar或視窗任務(wù)欄的區(qū)域。該參數(shù)只有在發(fā)
送ABM_GETTASKBARPOS、ABM_QUERYPOS、ABM_SETPOS時使用。
lParam: ? ? Message-dependent value. This member is used with the
ABM_SETAUTOHIDEBAR message.
一個依賴于消息的值。該參數(shù)只有在發(fā)送ABM_SETAUTOHIDEBAR
時使用。
? ?
An application desktop toolbar (also called an appbar) is a window that is similar to the Microsoft Windows taskbar. It is anchored to an edge of the screen, and it typically contains buttons that give the user quick access to other applications and windows. The system prevents other applications from using the desktop area occupied by an appbar. Any number of appbars can exist on the desktop at any given time.
? ? 桌面工具欄(也稱作appbar)是類似微軟視窗系統(tǒng)的任務(wù)條的窗口。它緊靠屏幕邊緣,典型的桌面工具欄包括快速訪問其他應(yīng)用程序和窗口的按鈕。系統(tǒng)會防止其他應(yīng)用程序使用被appbar占用的區(qū)域。在任何時刻桌面都可以同時共存多個appbar。
?
About Application Desktop Toolbars
桌面工具欄簡介
?
Windows provides an application programming interface (API) that lets you take advantage of appbar services provided by the system. The services help ensure that application-defined appbars operate smoothly with one another and with the taskbar. The system maintains information about each appbar and sends the appbars messages to notify them about events that can affect their size, position, and appearance.
? ? 微軟視窗提供了一個應(yīng)用編程接口(API)以方便你利用appbar service的特長。這些服務(wù)可以確保應(yīng)用程序定義的appbar和其他appbar或任務(wù)欄之間進行協(xié)調(diào)工作。系統(tǒng)會維護每一個taskbar的信息,并且在有影響taskbar尺寸、位置和外觀等事件發(fā)生時,系統(tǒng)會通知他們。
?
Sending Messages
發(fā)送消息
?
An application uses a special set of messages, called appbar messages, to add or remove an appbar, set an appbar's size and position, and retrieve information about the size, position, and state of the taskbar. To send an appbar message, an application must use the SHAppBarMessage function. The function's parameters include a message identifier, such as ABM_NEW, and the address of an APPBARDATA structure. The structure members contain information that the system needs to process the given message.
? ? 應(yīng)用程序使用一組特殊稱作appbar messages的消息集合,利用這些消息,可以增加、刪除appbar應(yīng)用,設(shè)置appbar的尺寸、位置,接收有關(guān)appbar的尺寸、位置消息以及任務(wù)欄的狀態(tài)信息。應(yīng)用程序使用SHAppBarMessage函數(shù)發(fā)送appbar message,這個函數(shù)包含兩個參數(shù),一個是消息標識符(如:ABM_NEW),另一個是結(jié)構(gòu)體APPBARDATA的地址。結(jié)
構(gòu)體參數(shù)包括系統(tǒng)需要處理的消息的信息。
?
For any given appbar message, the system uses some members of the APPBARDATA structure and ignores the others. However, the system always uses the cbSize and hWnd members, so an application must fill these members for every appbar message. The cbSize member specifies the size of the structure, and the hWnd member is the handle to the appbar's window.
? ? 對任何給定的appbar message,系統(tǒng)只是采用結(jié)構(gòu)體APPBARDATA的部分參數(shù)而忽略其他參數(shù),但是cbSize和hWnd這兩個參數(shù)總是要使用的,因此應(yīng)用程序要為每個appbar message填充這兩個參數(shù)。CbSize參數(shù)指明結(jié)構(gòu)體的大小,hWnd代表appbar的窗口句柄。
?
Some appbar messages request information from the system. When processing these messages, the system copies the requested information into the APPBARDATA structure.
? ? 有一些appbar message可以從系統(tǒng)獲取信息,在處理這些消息的時候,系統(tǒng)會將需要的信息拷貝到結(jié)構(gòu)體APPBARDATA中去。
Application Desktop Toolbars 桌面工具欄(2)
?
注釋:
? ? SHAppBarMessage
WINSHELLAPI UINT APIENTRY SHAppBarMessage(
? ? ? ? ? ? ? ? ? ? ? ? DWORD dwMessage,
? ? ? ? ? ? ? ? ? ? ? ? PAPPBARDATA pData
);
? ?
Sends an appbar message to the system.
向系統(tǒng)發(fā)送appbar message。
?
l ? ? ? ? Returns a message-dependent value. For more information, see the Microsoft Platform SDK documentation for the appbar message sent.
返回值由消息決定,不同的消息返回不同的值。如果需要了解更多的信息,可以參看Microsoft Platform SDK文檔的appbar message sent部分。
?
dwMessage
參數(shù)一:dwMessage
Appbar message value to send. This parameter can be one of the following values:
將要發(fā)送的消息值,這個參數(shù)可以是下面列表中的任一個:
?
ABM_ACTIVATE ? ? Notifies the system that an appbar has been activated.
? ? ? ? ? ? ? ? ? ? 激活一個appbar。
ABM_GETAUTOHIDEBAR ? ?Retrieves the handle to the autohide appbar associated with
? a particular edge of the screen.?
獲得和屏幕邊緣關(guān)聯(lián)的一個自動隱藏appbar的句柄。
ABM_GETSTATE ? ? ? ? Retrieves the autohide and always-on-top states of the
Windows taskbar.
獲得任務(wù)條的自動隱藏、總在最上面屬性的狀態(tài)。
ABM_GETTASKBARPOS ? ? ?Retrieves the bounding rectangle of the Windows taskbar.
獲得任務(wù)條的尺寸。
ABM_NEW ? ? ? ? ? ? ?Registers a new appbar and specifies the message identifier
that the system should use to send notification messages
to the appbar.?
注冊一個appbar并指定消息標識符(給appbar發(fā)送通知用)。
ABM_QUERYPOS ? ? ? ? Requests a size and screen position for an appbar.?
取得appbar的尺寸和appbar在屏幕中的位置。
ABM_REMOVE ? ? ?Unregisters an appbar, removing the bar from the system's
internal list.
注銷appbar并從系統(tǒng)內(nèi)部列表中移除該appbar。
ABM_SETAUTOHIDEBAR ? ? Registers or unregisters an autohide appbar for an edge of
the screen.?
給屏幕的一個邊緣注冊/注銷一個自動隱藏的appbar。
ABM_SETPOS ? ? ?Sets the size and screen position of an appbar.?
? ? ? ? ? ? ? ? ? ? 設(shè)置appbar的尺寸和appbar在屏幕中的位置。
ABM_WINDOWPOSCHANGED ? ? Notifies the system when an appbar's position has
changed.?
通知系統(tǒng)一個appbar的位置已經(jīng)改變。
?
pData
參數(shù)二:pData
Address of an APPBARDATA structure. The content of the structure depends on the value set in the dwMessage parameter.
結(jié)構(gòu)體APPBARDATA的地址。結(jié)構(gòu)體的內(nèi)容依賴于dwMessage參數(shù)的設(shè)置。
?
? ??
Application Desktop Toolbars 桌面工具欄(3)
?
APPBARDATA
typedef struct _AppBarData {
? ? DWORD ?cbSize;
? ? HWND ? hWnd;
? ? UINT ? uCallbackMessage;
? ? UINT ? uEdge;
? ? RECT ? rc;
? ? LPARAM lParam;
} APPBARDATA, *PAPPBARDATA;
?
Contains information about a system appbar message. This structure is used with the SHAppBarMessage function.
? ? appbar message所包含的信息。這個結(jié)構(gòu)體供函數(shù)SHAppBarMessage使用。
?
cbSize: ? ? ? ? ? ?Contains the size of the structure, in bytes.
以字節(jié)形式表示結(jié)構(gòu)體大小。
? ? hWnd: ? ? ? ? ? ? ?Contains the handle to the appbar window.
? ? ? ? ? ? ? ? ? ? ? ? appbar 窗口句柄。
uCallbackMessage: ? ?Application-defined message identifier. The application
uses the specified identifier for notification messages
that it sends to the appbar identified by the hWnd member.
This member is used when sending the ABM_NEW message.
應(yīng)用程序定義的消息標識符。應(yīng)用程序使用該標志符發(fā)送通知消
息到由hWnd指定的appbar。
uEdge: ? ? ? ? ? ? Value that specifies an edge of the screen. This member can
be one of the following values:
指定的屏幕邊緣。這個參數(shù)可以是下列值中的任一個:
ABE_BOTTOM ?Bottom edge.
ABE_LEFT Left edge.
ABE_RIGHT Right edge.?
ABE_TOP Top edge.?
This member is used when sending the ABM_GETAUTOHIDEBAR,
ABM_QUERYPOS, ABM_SETAUTOHIDEBAR, and ABM_SETPOS
messages.?
該參數(shù)只有在發(fā)送ABM_GETAUTOHIDEBAR、ABM_QUERYPOS、
ABM_SETAUTOHIDEBAR和ABM_SETPOS消息時使用。
rc: RECT structure to contain the bounding rectangle, in screen
coordinates, of an appbar or the Windows taskbar. This
member is used when sending the ABM_GETTASKBARPOS,
ABM_QUERYPOS, and ABM_SETPOS messages.?
結(jié)構(gòu)體RECT指定appbar或視窗任務(wù)欄的區(qū)域。該參數(shù)只有在發(fā)
送ABM_GETTASKBARPOS、ABM_QUERYPOS、ABM_SETPOS時使用。
lParam: ? ? Message-dependent value. This member is used with the
ABM_SETAUTOHIDEBAR message.
一個依賴于消息的值。該參數(shù)只有在發(fā)送ABM_SETAUTOHIDEBAR
時使用。
? ?
總結(jié)
以上是生活随笔為你收集整理的Application Desktop Toolbars 桌面工具栏的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 实用:Google Chrome 键盘快
- 下一篇: chrome Native Client