WindowsPhone应用程序创建后生成的MainPage里有一个“/Images/appbar_button1.png”,这文件在哪?

作者&投稿:古轻 (若有异议请与网页底部的电邮联系)
求 SHAppBarMessage 这个API的用法~

这个函数很简单,关键是自己处理消息:
这样用:

function TAppBar.SendAppBarMsg(Msg: DWORD): UINT;
begin
Result := SHAppBarMessage(Msg, FABD);//FABD: TAppBarData;
end;

/////下面是消息处理:
procedure TAppBar.WndProc(var M: TMessage);
var
State: UINT;
begin
if M.Msg = AppBarMsg then
begin
case M.WParam of
// Sent when always on top or autohide state has changed.
ABN_STATECHANGE:
begin
// Check to see whether the access bar is still ABS_ALWAYSONTOP.
State := SendAppBarMsg(ABM_GETSTATE);
if ABS_ALWAYSONTOP and State = 0 then
SetTopMost(False)
else
SetTopMost(True);
end;
// A full screen application has started, or the last
// full-screen application has closed.
ABN_FULLSCREENAPP:
begin
// Set the access bar's z-order appropriately.
State := SendAppBarMsg(ABM_GETSTATE);
if M.lParam 0 then begin
if ABS_ALWAYSONTOP and State = 0 then
SetTopMost(False)
else
SetTopMost(True);
end
else
if State and ABS_ALWAYSONTOP 0 then
SetTopMost(True);
end;
// Sent when something happened which may effect the AppBar position.
ABN_POSCHANGED:
begin
// The taskbar or another access bar
// has changed its size or position.
SetAppBarPos(FABD.uEdge);
end;
end;
end
else
inherited WndProc(M);
end;



这里给出本单元完整代码:
unit AppBars;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ShellAPI, StdCtrls, Buttons, ExtCtrls, Menus;

type
TAppBarEdge = (abeTop, abeBottom, abeLeft, abeRight);

EAppBarError = class(Exception);

TAppBar = class(TForm)
PopupMenu1: TPopupMenu;
Top1: TMenuItem;
Bottom1: TMenuItem;
Left1: TMenuItem;
Right1: TMenuItem;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
OpenDialog1: TOpenDialog;
N1: TMenuItem;
Exit1: TMenuItem;
procedure Top1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure MoveButtons;
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
private
FABD: TAppBarData;
FEdge: TAppBarEdge;
FTopMost: Boolean;
FLastChecked: TMenuItem;
procedure WMActivate(var M: TMessage); message WM_ACTIVATE;
procedure WMWindowPosChanged(var M: TMessage); message WM_WINDOWPOSCHANGED;
function SendAppBarMsg(Msg: DWORD): UINT;
procedure SetAppBarPos(Edge: UINT);
procedure SetAppBarEdge(Value: TAppBarEdge);
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure SetTopMost(TopMost: Boolean);
procedure WndProc(var M: TMessage); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Edge: TAppBarEdge read FEdge write SetAppBarEdge;
property TopMost: Boolean read FTopMost write SetTopMost default True;
end;

var
AppBar: TAppBar;

implementation

{$R *.DFM}

uses Main;

const
DEF_APPBAR_WIDTH = 40;
DEF_APPBAR_HEIGHT = 35;

var
AppBarMsg: UINT = 0;

constructor TAppBar.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
// set up the TAppBarData record
with FABD do
begin
cbSize := SizeOf(FABD);
hWnd := Handle;
uCallbackMessage := AppBarMsg;
end;
// Inform the shell of the new AppBar
if SendAppBarMsg(ABM_NEW) = 0 then
raise EAppBarError.Create('Failed to create AppBar');
// Initialize the position
SetAppBarPos(ABE_TOP);
FTopMost := True;
FLastChecked := Top1;
end;

destructor TAppBar.Destroy;
begin
// Must inform shell that the AppBar is going away
SendAppBarMsg(ABM_REMOVE);
inherited Destroy;
end;

procedure TAppBar.WMWindowPosChanged(var M: TMessage);
begin
inherited;
// Must inform shell that the AppBar position has changed
SendAppBarMsg(ABM_WINDOWPOSCHANGED);
end;

procedure TAppBar.WMActivate(var M: TMessage);
begin
inherited;
// Must inform shell that the AppBar window was activated
SendAppBarMsg(ABM_ACTIVATE);
end;

procedure TAppBar.WndProc(var M: TMessage);
var
State: UINT;
begin
if M.Msg = AppBarMsg then
begin
case M.WParam of
// Sent when always on top or autohide state has changed.
ABN_STATECHANGE:
begin
// Check to see whether the access bar is still ABS_ALWAYSONTOP.
State := SendAppBarMsg(ABM_GETSTATE);
if ABS_ALWAYSONTOP and State = 0 then
SetTopMost(False)
else
SetTopMost(True);
end;
// A full screen application has started, or the last
// full-screen application has closed.
ABN_FULLSCREENAPP:
begin
// Set the access bar's z-order appropriately.
State := SendAppBarMsg(ABM_GETSTATE);
if M.lParam 0 then begin
if ABS_ALWAYSONTOP and State = 0 then
SetTopMost(False)
else
SetTopMost(True);
end
else
if State and ABS_ALWAYSONTOP 0 then
SetTopMost(True);
end;
// Sent when something happened which may effect the AppBar position.
ABN_POSCHANGED:
begin
// The taskbar or another access bar
// has changed its size or position.
SetAppBarPos(FABD.uEdge);
end;
end;
end
else
inherited WndProc(M);
end;

function TAppBar.SendAppBarMsg(Msg: DWORD): UINT;
begin
Result := SHAppBarMessage(Msg, FABD);
end;

procedure TAppBar.SetAppBarPos(Edge: UINT);
begin
FABD.uEdge := Edge; // set edage
with FABD.rc do
begin
// set coordinates to full-scren
Top := 0;
Left := 0;
Right := Screen.Width;
Bottom := Screen.Height;
// Send ABM_QUERYPOS to obtain proper rect on edge
SendAppBarMsg(ABM_QUERYPOS);
// re-adjust rect based on that modified by ABM_QUERYPOS
case Edge of
ABE_LEFT: Right := Left + DEF_APPBAR_WIDTH;
ABE_RIGHT: Left := Right - DEF_APPBAR_WIDTH;
ABE_TOP: Bottom := Top + DEF_APPBAR_HEIGHT;
ABE_BOTTOM: Top := Bottom - DEF_APPBAR_HEIGHT;
end;
// Set the app bar position.
SendAppBarMsg(ABM_SETPOS);
end;
// Set the BoundsRect property so that it conforms to the
// bounding rectangle passed to the system.
BoundsRect := FABD.rc;
end;

procedure TAppBar.SetTopMost(TopMost: Boolean);
const
WndPosArray: array[Boolean] of HWND = (HWND_BOTTOM, HWND_TOPMOST);
begin
SetWindowPos(Handle, WndPosArray[TopMost], 0, 0, 0, 0, SWP_NOMOVE or
SWP_NOSIZE or SWP_NOACTIVATE);
end;

procedure TAppBar.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST;
Params.Style := WS_VISIBLE or WS_POPUP or WS_THICKFRAME or WS_CLIPCHILDREN;
end;

procedure TAppBar.SetAppBarEdge(Value: TAppBarEdge);
const
EdgeArray: array[TAppBarEdge] of UINT = (ABE_TOP, ABE_BOTTOM, ABE_LEFT,
ABE_RIGHT);
begin
if Value FEdge then
begin
SetAppBarPos(EdgeArray[Value]);
FEdge := Value;
MoveButtons;
end;
end;

procedure TAppBar.Top1Click(Sender: TObject);
begin
FLastChecked.Checked := False;
(Sender as TMenuItem).Checked := True;
case TMenuItem(Sender).Caption[2] of
'T': Edge := abeTop;
'B': Edge := abeBottom;
'L': Edge := abeLeft;
'R': Edge := abeRight;
end;
FLastChecked := TMenuItem(Sender);
end;

procedure TAppBar.MoveButtons;
// This method looks complicated, but it really just arranges the buttons
// properly depending on what side the AppBar is docked.
var
DeltaCenter, NewPos: Integer;
begin
if (FEdge = abeTop) or (FEdge = abeBottom) then
begin
DeltaCenter := (ClientHeight - SpeedButton1.Height) div 2;
SpeedButton1.SetBounds(10, DeltaCenter, SpeedButton1.Width, SpeedButton1.Height);
NewPos := SpeedButton1.Width + 20;
SpeedButton2.SetBounds(NewPos, DeltaCenter, SpeedButton1.Width, SpeedButton1.Height);
NewPos := NewPos + SpeedButton1.Width + 10;
SpeedButton3.SetBounds(NewPos, DeltaCenter, SpeedButton1.Width, SpeedButton1.Height);
NewPos := NewPos + SpeedButton1.Width + 10;
SpeedButton4.SetBounds(NewPos, DeltaCenter, SpeedButton1.Width, SpeedButton1.Height);
NewPos := NewPos + SpeedButton1.Width + 10;
SpeedButton5.SetBounds(NewPos, DeltaCenter, SpeedButton1.Width, SpeedButton1.Height);
end;
if (FEdge = abeLeft) or (FEdge = abeRight) then
begin
DeltaCenter := (ClientWidth - SpeedButton1.Width) div 2;
SpeedButton1.SetBounds(DeltaCenter, 10, SpeedButton1.Width, SpeedButton1.Height);
NewPos := SpeedButton1.Height + 20;
SpeedButton2.SetBounds(DeltaCenter, NewPos, SpeedButton1.Width, SpeedButton1.Height);
NewPos := NewPos + SpeedButton1.Height + 10;
SpeedButton3.SetBounds(DeltaCenter, NewPos, SpeedButton1.Width, SpeedButton1.Height);
NewPos := NewPos + SpeedButton1.Height + 10;
SpeedButton4.SetBounds(DeltaCenter, NewPos, SpeedButton1.Width, SpeedButton1.Height);
NewPos := NewPos + SpeedButton1.Height + 10;
SpeedButton5.SetBounds(DeltaCenter, NewPos, SpeedButton1.Width, SpeedButton1.Height);
end;
end;

procedure TAppBar.SpeedButton1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
MainForm.FileName := OpenDialog1.FileName;
end;

procedure TAppBar.SpeedButton2Click(Sender: TObject);
begin
MainForm.memEditor.Lines.SaveToFile(MainForm.FileName);
end;

procedure TAppBar.SpeedButton3Click(Sender: TObject);
begin
MainForm.memEditor.CutToClipboard;
end;

procedure TAppBar.SpeedButton4Click(Sender: TObject);
begin
MainForm.memEditor.CopyToClipboard;
end;

procedure TAppBar.SpeedButton5Click(Sender: TObject);
begin
MainForm.memEditor.PasteFromClipboard;
end;

procedure TAppBar.Exit1Click(Sender: TObject);
begin
Application.Terminate;
end;

initialization
AppBarMsg := RegisterWindowMessage('DDG AppBar Message');
end.

  本主题介绍如何创建可以在应用程序的多个页面上重用的全局应用程序栏。通常,您是在要使用应用程序栏的页面上创建应用程序栏,并将该应用程序栏只应用于该页面。出于本示例的目的,您使用 XAML 在 App.xaml 中创建一个全局应用程序栏。在您的应用程序中,还可以通过使用 App.xaml 代码隐藏文件中的唯一代码创建全局应用程序栏。有关更多信息,请参见 Windows Phone 的应用栏。注意:由于Pivot“页面”实际上是单个页面上的单个控件,因此不同的 Pivot“页面”自动使用相同的应用程序栏。有关更多信息,请参见如何在 Windows Phone 的单个 Pivot 控件中使用不同的应用栏。创建可以在多个页面上重用的全局应用程序栏的步骤在“解决方案资源管理器”中,双击 App.xaml 以在设计器中打开它。在Application.Resources 元素中,添加以下代码。该代码创建一个具有两个按钮和两个菜单项的应用程序栏。该代码为该应用程序栏指定键 GlobalAppBar,但您可以为它指定您喜欢的任何键。XAML在“解决方案资源管理器”中,右键单击 App.xaml,然后单击“查看代码”以打开代码隐藏文件。在App 类中,添加以下代码。这些是单击事件的处理程序。C#VBprivatevoid Button1_Click(object sender, EventArgs e) { MessageBox.Show("Button 1 works!"); //Do work for your application here. } privatevoid Button2_Click(object sender, EventArgs e) { MessageBox.Show("Button 2 works!"); //Do work for your application here. } privatevoid MenuItem1_Click(object sender, EventArgs e) { MessageBox.Show("Menu item 1 works!"); //Do work for your application here. } privatevoid MenuItem2_Click(object sender, EventArgs e) { MessageBox.Show("Menu item 2 works!"); //Do work for your application here. } 在页面上使用全局应用程序栏的步骤在“解决方案资源管理器”中,双击您要向其中添加应用程序栏的任何页面。

你是不知道图片的访问路径应该怎么写吗?
先从简单的入手的话 新建一个项目时,在项目中新建一个文件夹如Images,就可以了,
至于路径,只举两个简单应用
在Images中你放入两张图片,叫A.png ,B.png

A的属性 BuildAction 设置为Content Copy 设置为Copy if newer

B的属性 BuildAction 设置为Resource Copy 设置为not
在Xaml页面中你创建一个Image对象
你可以通过路径 /Images/A.png 或 Images/A.png 或 ./Images/A.png 都可以访问到A.B
不过如果对象是ApplicationBar上的IconUri 则可以通过路径/Images/A.png ,B为资源不会显示
建议再多学习一下。这只是未跨程序集的情况。


为什么微软放弃了Windows Phone?
是因为Windows Phone糟糕的用户体验和应用数量上的短板,以及销量不断萎缩,营收下滑,最终不得不放弃。1990年起,微软就启动了和手持式便携设备相关的研究项目,并于1996年发布了Windows CE 1.0,也就是微软最早的移动操作系统。因是美国前总统奥巴马专用手机而出名的Sectera Edge、国内小有名气的魅族M8等...

windows8 pho文件怎么usd安装
你想问的是用U盘安装吧?1、到网上下载并安装U盘制作软件“一键U盘装系统”,并将U盘插入电脑中,建议插入台式机后置USB接口;2、然后启动“一键U盘装系统”软件,软件启动后首先会检测插入的U盘,检测到后会显示出来:3、直接点击“一键制作USB启动盘”按钮即可,稍等一会即弹出成功的提示信息(注意,...

windows phone是什么意思
Windows Phone [词典]由微软制作并发行的触控操作模式行动操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中,它的前身是Windows Mobile系统,但却与之完全不同。;[网络]微软; 微软系统; 手机操作系统;[例句]Last month, Windows Phone 8 launched with Nokia lumia 920 ...

Windows Phone 8来电铃声设置步骤
Windows Phone 8来电铃声设置步骤如下:1. 打开“设置”应用。2. 进入“声音+通知”选项。3. 选择“来电铃声”进行铃声选择或自定义。首先,打开Windows Phone 8设备上的“设置”应用,通常这个应用会有一个齿轮状的图标,位于主屏幕上或者应用列表中。在&...

诺基亚1010智能机电脑注册微软账户后如何登陆手机
诺基亚rm1010是windowsphone系统:1、windowsphone8的系统的手机都需要注册微软的账户。2、用手机注册方法为:设置-邮箱与账户-创建账户。3、账户名都是邮箱,这个是自己设置的,如果你不选择邮箱后缀的话,那么一般是自动生成outlook的邮箱,然后设置账户密码,即可。4、windowsphone系统的手机,必须有微软...

WINDOWS系列的所有操作系统有那些?
98、Windows ME、Windows 2000、Windows 2003。Windows XP、Windows Vista、Windows 7、Windows 8、Windows 8.1、Windows 10。现在最新的正式版本是Windows 10。服务器版:WindowsServer2003、WindowsServer2008、WindowsServer2012、WindowsServer2016 。移动版:WindowsMobile、WindowsPhone、Windows10Mobile。

windowphone的手机软件如何下载?
一、用windowsphone手机助手下载软件 windwosphone专门有个用来下载wp手机软件的手机应用市场,就和苹果的app store一样。只要在百度搜索WP手机助手官方下载下载安装到手机即可 ,如下图所示。二、使用windowsphone官方中文网 1、首先说下,在电脑端下载windowsphone软件的方法。首先,打开浏览器,百度搜索...

诺基亚500是Windows Pho手机吗?
不是,WP的目前只有:610710800900四个,

win10各版本区别
Win10教育版中的功能与Win10企业版几乎相同,但是它并不具备LongTermServicingBranch更新选项。用户可以自Win10家庭版直接升级至Win10教育版。五、Win10移动版 如果你使用WindowsPhone或者是运行Windows8.1的小尺寸平板电脑,那么你们将可以升级到Win10移动版。5英寸、6英寸智能手机或7英寸平板电脑之间的差异...

诺基亚的最后一款windows手机:
全球著名的手机品牌诺基亚,是不少人的手机记忆中的一部分。可是,自从诺基亚选择Windows Phone作为其智能手机的操作系统后,其市场份额一路下滑。而2014年,微软公司收购了诺基亚移动电话业务,并且敲定最后一款Windows Phone诺基亚手机。2014年,诺基亚公司发布了它的第一款基于Windows Phone系统的手机——诺基...

泊头市13020877710: 如何为 Windows Phone 创建第一个 Silverlight 应用程序 -
仲全胃友: 第一, 创建新项目创建 Windows Phone Silverlight 应用程序的第一步是创建新项目.创建新项目的步骤从 Windows“开始”菜单启动 Microsoft Visual Studio 2010.通过选择“文件 | 新建项目”菜单命令来创建一个新项目.将显示“新建...

泊头市13020877710: windows的手机系统怎么在桌面添加应用程序 -
仲全胃友: 如果你是指Windows Phone,在开始屏幕向左滑动叫出所有应用的列表,找到你要添加的应用,长按,选择“固定到开始屏幕”.

泊头市13020877710: 如何安装用于windows桌面的windows phone应用 -
仲全胃友: 1、按键盘上的“Windows”按键,或者点击桌面左下角的“Windows”图标进入Metro界面.2、右击要放置到桌面的应用图标,从弹出的右键菜单中选择“打开文件位置”.3、接着右击相应的应用程序图标,从弹出的右键菜单中选择“发送到”->“桌面快捷方式”项.4、然后按“Windows+D”返回桌面,就会发现应用程序图标被“移动”到桌面啦.

泊头市13020877710: Windows Phone 7应用程序是用什么语言开发? -
仲全胃友: 微软的东西都一样啦 跟aspx一样 用的是.net 框架 语言的话应该是vb c#都可以吧 反正到.net会处理的 推荐c#毕竟是MS自己的东西 没有基础的话 买本c#.net的书开始看 先学做win form开发或者web开发 同时学习下wp7的工具以及接口神马的 等你弄熟悉c#.net的语法和函数再想个小项目开发wp7 APP试试

泊头市13020877710: 如何动态更改 Windows Phone 的应用栏图标按钮和菜单项 -
仲全胃友: 本主题介绍如何在运行时动态更改应用程序栏上的图标按钮和菜单项.应用程序不支持某些常见的控件功能,例如,数据绑定.这意味着您不能通过使用采用 XAML 设置的名称属性来更改图标按钮和菜单项文本.如果您想在运行时更改它们,...

泊头市13020877710: APP用什么开发 -
仲全胃友: 1、iOS平台开发语言为Objective-C,开发者一般使用苹果公司开发的ios sdk 搭建开发环境, iOS SDK是开发iPhone和iPad 应用程序过程中必不可少的软件开发包,提供了从创建程序,到编译,调试,运行,测试等一些列开发过程中所需要的...

泊头市13020877710: 如何部署和运行 Windows Phone 8 的应用 -
仲全胃友: 关于在 Windows Phone 模拟器中调试和运行应用 当您首次在 Windows Phone 模拟器中运行 Windows Phone 应用时,将发生以下事件:模拟器将会启动.模拟器将加载 Windows Phone 操作系统.模拟器将显示 Windows Phone“开始”屏幕...

泊头市13020877710: 作为初学者,怎样学习windows phone app编程 -
仲全胃友: ,2、结合相关的程序练习最后,编程不是一朝一夕能写好的,C++入门的宝典、推荐本书《C++Primerplus》经典中的经典,可惜一直被被人借走了.3,部分技巧掌握,刚刚开始学的时候老师就让我妈去图书馆借这个的中文版、读完这本书,多写才能提高,基本语法过关

泊头市13020877710: WindowsPhone8如何创建应用内产品
仲全胃友: http://msdn.microsoft.com/zh-CN/library/windowsphone/develop/jj206949(v=vs.105).aspx

泊头市13020877710: window phone系统应用程序文件后缀名是什么?window phone和window10系 -
仲全胃友: windows phone应用的后缀名是xap exe是x86架构的运行程序,手机是不可以运行的 windows10手机系统和电脑系统也是不一样的 手机是windows RT版专为平板或手机设计的 电脑是正常的windows系统

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网