人生是一场不能存盘的RPG,我只能尽量多搞几个Screenshot

June 4, 2007

Working with Vista .net 3.0

Filed under: .NET, Windows platform

1.Virtual Studio
Vista只支持 vb6和vs2005, 使用vs2005
需要VS2005 sp1 和 vs2005 sp1 update for vista

2.sql server
Microsoft SQL Server 2005 requires SP2 to run on Windows Vista.

3.IIS
http://blogs.msdn.com/webdevtools/archive/2006/09/18/761206.aspx
Developing Web Applications on Windows Vista with Visual Studio 2005
Select Web Management Tools->IIS6 Management Compatibility->IIS Metabase and IIS6 configuration compatiblity
Select WWW service->ASP.ET
Run Visual Studio 2005 in the context of an administrator account

4..NET framework
Microsoft .NET Framework 3.0 Deployment Guide
http://msdn2.microsoft.com/en-us/library/aa480173.aspx

SDK for vista and .net framework 3.0
Visual Studio 2005 extensions for .NET Framework 3.0

Visual Studio 2005 Extensions for WwF
Visual Studio 2005 Extensions for WCF, WPF 。

May 28, 2007

深入研究Windows内部原理系列讲座

http://www.microsoft.com/china/technet/webcasts/class/windowsserver1.mspx
可以作为Windows internals 4e的参考.

1.Windows的昨天,今天和明天

Windows Operating System Internals Curriculum Resource Kit (CRK)
http://www.academicresourcecenter.net/curriculum/pfv.aspx?id=6191

Windows Vista Kernel Changes
http://www.microsoft.com/emea/itsshowtime/sessionh.aspx?videoid=340
http://en.wikipedia.org/wiki/Mark_Russinovich

December 21, 2006

WPF之窗体模型

Filed under: Windows platform

编程
1. MyApp.xaml
Define Start up window(StartupUri) for the application
<Application StartupUri = “MyWindow.xaml”/>

2.MyWindow.xaml

<Window x:Class=”MyWindow” Width=”300″ Height=”200″ Title=”">
<Button Click=”ButtonClick”>
</Button>
</Window>

3.MyWindow.cs

4.myProj.csproj

5.msbuild myProj.csproj

编译过程:
Layout,Control的设定被转化为 BAML(Binary App Markup Language), 再嵌入到resources中
BAML+ C# -> exe

实验1: 查看obj目录,包含编译的中间结果:
MyWindow.cs
MyWindow.g.cs
MyWindow.baml

实验2:查看msbuild 编译时在控制台的输出

执行流程:
SourceInitialized
Activated
Loaded
ContentRendered
Deactivated/Acrivated
Closing
Closed

交互
WindowsFormsHost(将windows control放到wpf form)
ElementHost(将wpf control 放到 windows from)
HwndHost, HwndSource(与Win32和MFC窗体/控件进行交互)

Reference
www.techjie.com

December 4, 2006

Gadget开发入门

Filed under: Windows platform

http://microsoftgadgets.com/Sidebar/DevelopmentOverview.aspx

–Where is the Side bar
C:\Programe Files\Windows SideBar\
SideBar的主程序以及公用的Gadget

“%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Gadgets”
此处保存的是某个特定用户的Gadget.

–Run the Sider bar
Start -> All Programs -> Accessories

在vista的help中,查找 Windows Sidebar: frequently asked questions
How do I open Sidebar?
Click to open Windows Sidebar.对应的link为:
<a class=”shellExecuteLink” href=”shortcut:&quot;%25programfiles%25\windows sidebar\sidebar.exe&quot;”
title=”Click to open Windows Sidebar”>
<img src=”mshelp://help/?id=Microsoft.Windows.Resources.ShellExecuteTopicIcon”>
Click to open <span class=”notLocalizable”>Windows</span> Sidebar.
</a>
href=”shortcut:”%programfiles%\… “”这种写法我还是首次注意到.

–Mechanism of Sidebar and Gadget
Gadget由HTML, JavaScript,CSS,图片,资源组成, 通过调用Sidebar提供的API和系统中的ActiveX对象来完成操作.
常用到的ActiveX:
JScripting.FileSystemObject访问文件系统,
Microsoft.XmlDom分析XML文件,
Microsoft.XMLHTTP调用Web Service

Gadget本身是zip或cab格式,如果使用cab格式,需要进行数字签名, VS2005提供了数字签名工具Signtool.exe.

Gadget在其安全配置上,与普通的Web网页有很多不同点。
1. Gadget可以创建任何已安装的ActiveX对象的实例,因为其被配置为”可以初始化并且脚本访问未被标记为安全的ActiveX”。
2. Gadget也可以访问跨域的数据源,因为只有将不同位置的数据进行相应的集成,Gadget对于开发人员和最终用户才有意义。
3. 重要!!一个在Microsoft Gadget Gallery中发布的Gadget只能使用系统已有的ActiveX,禁止下载任何新的ActiveX控件,
无论这个ActiveX控件是签名或者未签名的。

注意:一个Gadget可以有多个实例同时运行.

–文件组成:
Gadget 所在folder的名称必须以.gadget结尾. 比如HelloWorld.gadget
* 我写了一个gadget,目录命名为为Mailsnatcher.gadget,无法从Gadget Gallery中看到,
改为eMailsnatcher.gadget,就可以看到了,原因不明.

以Clock为例, Clock位于%programfiles%\Windows\Gadgets\Clock.Gadget
主程序位于en-US下,可见各个语言对应的主程序可以不同.
en-US\中的gadget.xml是最关键的部分,定义了整个Gadget的信息以及用到的资源.
.Html用于定义gadget的UI,行为

gadget.xml gadget 的manifest, 只能取gadget.xml这个名字

常用的资源有:
icon, gadget.xml中<icons>中指定,用于在Gadget Gallery中显示.
defaultImage , gadget.xml中<defaultImage> 中指定,用于在拖动时显示.
logo, gadget.xml中<logo >中指定,用于在拖动时显示.用于在Gadget Gallery中显示详细信息.
这3个资源的路径都是相对于.gadget目录的.

–开发要点:
无IDE,不能所见即所得; 无法进行Debug,只能写Log来Trace;

–Sample
在”%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Gadgets”下
生成目录: HelloWorld.gadget

在HelloWorld.gadget下生成文件gadget.xml
<?xml version=”1.0″ encoding=”utf-8″ ?>
<gadget>
<name>First Gadget!</name>
<namespace>Example.You</namespace>
<version>1.0</version>
<author name=”Aloneplayer”>
<info url=”" />
</author>
<copyright>2006</copyright>
<description>My first gadget</description>
<hosts>
<host name=”sidebar”>
<base type=”HTML” apiVersion=”1.0.0″ src=”HelloWorld.html” />
<permissions>full</permissions>
<platform minPlatformVersion=”0.3″ />
</host>
</hosts>
</gadget>

在HelloWorld.gadget下生成文件HelloWorld.html
<html>
<head>
<title>Hello, World!</title>
<style>
body {
width:130;
height:50;
}
</style>
</head>
<body>
<span id=”gadgetContent” style=”font-family: Tahoma; font-size: 10pt;”>Hello, World!</span>
</body>
</html>

此时,就可以点击Sider bar上的”+”呼出Gadget Gallery,可以看到一个以gadget.xml中<name>为命名的
gadget.

修改HelloWorld.html,使用背景:
<style>
body {
width:130;
height:50;
background: url(’Background.png’);
padding-top: 5px;
}
</style>

使用API:
<html>
<head>
<title>Hello, World!</title>
<style>
body{
width:130;
height:50;
background: url(’Background.png’); }
padding-top: 5px;
</style>
<script>
var variableName = “ProgramFiles”;
function setContentText() {
gadgetContent.innerText = System.Environment.getEnvironmentVariable(variableName);
}
</script>
</head>
<body onload=”setContentText()”>
<span id=”gadgetContent” style=”font-family: Tahoma; font-size: 10pt;”>Hello, World!</span>
</body>
</html>

添加Setting,此刻可以看到Gadget上会出现一个扳手状的buttong,同时context menu上也会出现”options”
用于进行setting
<html>
<head>
<style>
body{
width:250;
height:75;
}
</style>
<script>
function init()
{
var currentSetting = System.Gadget.Settings.read(”variableName”);
if (currentSetting != “”)
envVar.innerText = currentSetting;
}

System.Gadget.onSettingsClosing = SettingsClosing;
function SettingsClosing(event)
{
if (event.closeAction == event.Action.commit)
{
variableName = envVar.value;
System.Gadget.Settings.write(”variableName”, variableName);
}

event.cancel = false;
}
</script>
</head>
<body onload=”init()”>
<span id=”mySpan” style=”font-family: Tahoma; font-size: 10pt;”>
Environment Variable:<br>
<input type=”text” id=”envVar” length=”40″>
</span>
</body>
</html>

–发布:
把所有的文件做成一个zip包或cab包,把包的后缀改成.gadget,双击.gadget,就可以安装这个
gadget.

November 29, 2006

My Vista

Filed under: Windows platform

Virtual PC 2007 beta1 + 1G memory

Offiece 2007

Visio 2007

Windows SDK for Windows Vista

现在的问题是,玩点什么好呢?

November 24, 2006

Vista 优化

Filed under: Windows platform

–bcdedit.exe
修改多重启动菜单

–Vista BootPRO
图形UI,修改启动设置

TweakVI for Windows Vista
http://www.totalidea.com/content/tweakvi/tweakvi-index.html

微软新系统Vista服务优化攻略
http://soft.yesky.com/os/435/2087435.shtml

September 5, 2006

MS的WPF站点

Filed under: Windows platform

http://wpf.netfx3.com/






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham