2007.5.26 [明日晴れるかな]

「明日晴れるかな」
作詞&作曲:桑田佳祐
 
熱い涙や恋の叫びも
輝ける日はどこへ消えたの?
明日(あす)もあてなき道を彷徨うなら
これ以上もとには戻れない
耳を澄ませば心の声は
僕に何を語り掛けるだろう?
今は汚れた街の片隅にいて
あの頃の空を想うたびに
神より賜えし孤独やトラブル
泣きたい時は泣きなよ
これが運命(さだめ)でしょうか?
あきらめようか?
季節は巡る魔法のように
Oh,Baby. No,maybe.
「愛」失くして「情」も無い?
嘆くようなフリ
世の中のせいににするだけ
Oh,baby. You’re maybe.
「哀」失くして「楽」は無い
幸せのFeeling
抱きしめて One more time.
或りし日の己れを愛するために
思い出は美しくあるのさ
遠い過去よりまだ見ぬ人生は
夢ひとつ叶えるためにある
奇跡のドアを開けるのは誰?
微笑みよ もう一度だけ
君は気づくでしょうか?
その鍵はもう
君の手のひらの上に
Why,baby? Oh,tell me.
「愛」失くして「憎」も無い?
見て見ないようなフリ
その身を守るため?
Oh,baby. You’re maybe.
もう少しの勝負じゃない!
くじけそうな Feeling
乗り越えて One more chance.
I take to myself
Oh, baby. No,maybe.
「愛」失くして「憎」も無い?
嘆くようなフリ
残るのは後悔だけ!
Oh, baby. Smile baby.
その生命(いのち)は永遠(とわ)じゃない
誰もがひとりひとり胸の中で
そっと囁いているよ
「明日(あした)晴れるかな」
遥か空の下

2007.5.11 [Demo – CreateToolhelp32Snapshot]

Project Properties->Configuration Properties->Linker->Input->Additional Dependencies中添加Toolhelp.lib
 
#include <Tlhelp32.h>
void KillApp()
{
 BOOL lRes;
 //This structure describes an entry from a list
 //that enumerates the processes residing in the system address space when a snapshot was taken.
 PROCESSENTRY32 procEntry;
 //This function takes a snapshot of the processes, heaps, modules,
 //and threads used by the processes.
 //TH32CS_SNAPPROCESS: Includes the process list in the snapshot.
 //2nd Parameter: This parameter is used when TH32CS_SNAPHEAPLIST
 //or TH32CS_SNAPMODULE is specified. Otherwise, it is ignored.
 HANDLE lProcSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
 if(lProcSnapshot!=INVALID_HANDLE_VALUE)
 {
  memset(&procEntry,0,sizeof(PROCESSENTRY32));
  procEntry.dwSize=sizeof(PROCESSENTRY32);
  //This function retrieves information about the first process encountered in a system snapshot.
  lRes=Process32First(lProcSnapshot,&procEntry);
  while(lRes)
  {
   if(wcsstr(_T("DeviceApplication1.exe"),procEntry.szExeFile))
   {
    HANDLE hndl=OpenProcess(PROCESS_TERMINATE,FALSE,procEntry.th32ProcessID);
    if(hndl!=INVALID_HANDLE_VALUE)
    {
     TerminateProcess(hndl,0);
     CloseHandle(hndl);
    }
   }
  }
  lRes=Process32Next(lProcSnapshot,&procEntry);
 }
 CloseToolhelp32Snapshot(lProcSnapshot);
}

2007.5.8 [启用.NET CF v2的进程调试]

 
在默认情况下,将调试器attach到.NET CF v2的应用程序的支持是被禁止的。其目的是为了优化运行时应用程序的性能。当该功能被启用的时候,JIT编译器会产生可调试的代码。可调试的代码为了存放断点调试信息,所以对它没有进行任何优化,并且其编译后的代码量也是相当大的。因此,所造成的结果是,应用程序的执行效率低下。此外,.NET CF v2应用程序的调试本身就是远程进行的,加上数据传输都增加了应用程序的运行负担。
 
调试器对于进程attach的支持的设置是全局性的,这会造成.NET CF v2的应用程序都会在该状态下运行。因此,只有在需要的时候才启用该功能,一旦调试结束就禁止它。
 
通常使用Remote Register Editor来更改启用的设置。修改HKLM\SOFTWARE\Microsoft\.NET Compact Framework\Managed Debugger。1:启用;2:禁用。
 

2007.5.8 [.NET CF中实现ListView多选功能]

First thanks to Tim Wilson (.Net Compact Framework MVP)…
 
Check the following code:
        public Form1()
        {
            InitializeComponent();
            IntPtr hWnd = this.listView1.Handle;
            int style = GetWindowLong(hWnd, GWL_STYLE);
            SetWindowLong(hWnd, GWL_STYLE, (style & ~LVS_SINGLESEL));
        }
       
        private const int GWL_STYLE = -16;
        private const int LVS_SINGLESEL = 0x0004;
       
        [DllImport("coredll")]
        private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
        [DllImport("coredll")]
        private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
 
PS:.NET Compact Framework 2.0还是功能有限,期待Orcas中的.NET Compact Framework 3.5

2007.5.6 [What level are you in?]

Engineering Competencies – Career Development

 
Analytical Problem Solving
– Solving simple and complex problems in both technology and business
 
Confidence
– Belief in one’s own and in the organizations capability; "can do" attitude; persistence
 
Cross-Boundary Collaboration
– Effectively working with individuals and organizations
 
Customer-Focused Innovation
– Understand the market, customer, and product themes
 
Impact and Influence
– Generate support from others to achieve the desired bussiness outcomes
 
Interpersonal Awareness
– The desire to understand other people
 
Passion for Quality
– Tackle quality problems efficiently, diligently, and proactively, and persevere
 
Project Management
– Personally accountable, Accurate and effective schedules and deliverables
 
Strategic Insight
– Understand broad business and competitive issues
 
Technical Excellence
– Continuously learn, embrace, and seek out technical challenges