今日外掛程式的乙個HELLO WORLD

2021-05-22 22:39:57 字數 1584 閱讀 9733

hinstance g_inst;

hwnd g_hwnd;

hwnd g_testwnd;

lresult callback wndproc (hwnd hwnd, uint uimessage, wparam wparam, lparam lparam) ;

bool apientry dllmain( handle hmodule,

dword  ul_reason_for_call,

lpvoid lpreserved)

hwnd apientry initializecustomitem (todaylistitem *ptli, hwnd hwndparent)

lresult callback wndproc (hwnd hwnd, uint uimessage, wparam wparam, lparam lparam)

break;

case wm_paint:

rect rt;

hdc hdc = beginpaint(g_hwnd, &ps);

getclientrect(g_hwnd, &rt);

setbkmode(hdc,transparent);

drawtext(hdc, text("pocket pc rules!"), 16, &rt,

dt_singleline | dt_vcenter | dt_center);

endpaint(g_hwnd, &ps);

break;

return true;

} 然後定義匯出檔案

library    "mytoday"

exports

initializecustomitem        @240    noname

登錄檔的編輯

[hkey_local_machine/software/microsoft/today/items/"mytoday"]

"type"=dword:4 ; 4 == custom

"options"=dword:1 ; set to 0 if you do not want options

"dll"="/windows/mytoday.dll" ; path to the dll

在今日外掛程式中,initializecustomitem 是預設必須的匯出函式,外掛程式的初始化會在此函式中進行

initializecustomitem 函式中要做的和普通win32sdk做介面是一樣的,就是實現乙個窗體,從窗體類的實現到最後updatewindow

在窗體的過程處理函式中,要注意wm_todaycustom_queryrefreshcache訊息

當載入完今日外掛程式時,系統會每2,3秒時間對每個今日外掛程式程序(其實每個訊息的動態庫是附加在shell32.exe當中的)傳送乙個wm_todaycustom_queryrefreshcache訊息。如果是第一次載入,即傳送第一條wm_todaycustom_queryrefreshcache訊息的時候,

todaylistitem* tl = (todaylistitem*)wparam;

tl->cyp == 0 為true

用Scratch製作乙個Hello World程式

網上出現了很多hello world程式,看的小編心裡也癢癢的,為此這次作為南京小碼王scratch培訓機構的小編,就為大家來詳細的了解下scratch製作hello world程式的過程,現在就和小編一起走進hello world程式的程式設計吧!第一步 新建專案並儲存 開啟scratch,點選 ...

第乙個Python指令碼之 Hello World

通過前面一篇文章,可能大家都成功的搭建了python的開發環境了,在這,我們便指導如何建立乙個最基本的python指令碼 hello world。如果你重來沒有接觸過python,那麼,該篇指導你怎麼去直接的認知python 從你人生中的第乙個python指令碼開始。python 指令碼應用的開發有...

02乙個簡單的c語言例項(hello world)

二 結構分析 三 增強程式可讀性 四 程式除錯 include intmain void 乙個簡單的c程式 一 內容分析 include 在c世界中,人們稱出現在檔案頂部的資訊集合為頭,c實現通常都帶有許多標頭檔案。標頭檔案可以定義常量,或者說明函式名以及該函式如何使用。但是函式的實際 被包含在乙個...