針對應用windows ce系統的掌上裝置,在系統進入睡眠狀態前載入並顯示睡眠畫面。通過讀取登錄檔查詢所要載入的bmp格式,並讀取資訊。
對於橫屏裝置,水平放置;
對於豎屏裝置,逆時針旋轉90度放置。
首先讀取登錄檔資訊:
sleeppicerror = regopenkeyex(hkey_local_machine, text("drivers//display//sleeppic"), 0, key_read, &hkeysleeppic);
if( sleeppicerror != error_success )
sleeppicerror = regqueryvalueex( hkeysleeppic, text("sleeppicfilepath"), null, null, (lpbyte)sleeppicnamebuf, &dwdatasizesleeppic );
if( sleeppicerror != error_success )
regclosekey(hkeysleeppic);
然後開啟檔案並讀取檔案資訊:
hfilesleeppic = createfile((lpctstr)sleeppicnamebuf, generic_read, 0, null, open_existing, 0, null);
readfile(hfilesleeppic, (lpstr)&bf, sizeof(bitmapfileheader), &dwbytesreadsleeppic, null);
readfile(hfilesleeppic, (lpstr)&bi, sizeof(bitmapinfoheader), &dwbytesreadsleeppic, null);
通過讀取bi.bibitcount判斷bmp位數,再針對16位、24位分別載入:
//讀取16位位圖資料
case 16:
switch(bi.bicompression) //判斷圖象資料壓縮的型別
setfilepointer(hfilesleeppic, -(4 * picwidth), null, file_current);
}closehandle(hfilesleeppic);
break;
//讀取16位bitfields-位域存放方式位圖資料
case 3:
readfile(hfilesleeppic, sleeppicbuf, 2, &dwbytesreadsleeppic, null);
//判斷是否565格式,如果是則讀取,不是則返回。
if(sleeppicbuf[1] == 248)
closehandle(hfilesleeppic);
}else
break;
default:
closehandle(hfilesleeppic);
return false;
} break;
//讀取24位位圖資料
case 24:
setfilepointer(hfilesleeppic, -(3 * picwidth), null, file_end);
for(a = 0; a < picheight; a++)
setfilepointer(hfilesleeppic, -(6 * picwidth), null, file_current);
}
closehandle(hfilesleeppic);
break;
default:
closehandle(hfilesleeppic);
return false;
生成載入畫面
program splashdemo uses forms,windows,controls,messages,main in main.pas splash in splash.pas 這個窗體是最先彈出的窗體 varhmutex thandle foundwnd thandle modulena...
消除睡眠誤區 提高睡眠質量
睡眠對人體健康非常重要,因此消除睡眠誤區也是非常關鍵的。頭朝南或朝北睡眠是對的 這是地磁對人體的影響,如果人體長期順著地磁的南北向,可使人體經絡循地球磁力線走向一致,會使氣血流通,器官機能得到有效的調整和增進。即使睡眠不好,也不要增加臥床時間是對的 習慣在床上思考事情是錯的 不要在臥房做更多其它的事...
子畫面呼叫父畫面的js方法
這裡有兩種 1 是iframe的形式 就是在乙個畫面下,有多個iframe,形式就是我們日常用的郵箱的形式,在乙個畫面中可以開啟多個tab頁面。此時呼叫父畫面的方法用window.parent var openerwindow window.parent openerwindow.getdataby...