呼叫API函式設計ABOUT視窗

2021-04-17 08:44:57 字數 3391 閱讀 8497

呼叫api

函式設計

about

視窗about 窗 口, 它 向 用 戶 反 映 了 當 前 系 統 的 一 些 基 本 信 息, 其 中 顯 示 有 關windows 及 其 應 用 軟 件 的 版 本、 版 權 和 系 統 的 工 作 狀 態 等 信 息。 筆 者 用vb 6.0 通 過 調 用

api 函 數 設 計 應 用 系 統 的

about 窗 口。 效 果 如 圖1。( 略)

1 . 建 立 含 有 如 下 控 件 的 窗 體:

控 件 name caption

窗 體 form1 用vb6.0 設 計

about 窗 口

命 令 按 鈕 command1 關 於 銷 售 管 理 系 統

2 . 程 序 清 單:

---- private declare function getwindowword lib "user32" (byval hwnd as long, byval nindex as long) as integer

---- private declare function shell

about lib "shell32.dll" alias "shell

---- private declare function extracticon lib "shell32.dll" alias "extracticona" (byval hinst as long, byval lpszexefilename as string, byval niconindex as long) as long private declare function getdiskfreespace lib "kernel32" alias "getdiskfreespacea" (byval lprootpathname as string, lpsectorspercluster as long, lpbytespersector as long, lpnumberoffreeclusters as long, lptotalnumberofclusters as long) as long private declare function getdrivetype lib "kernel32" alias "getdrivetypea" (byval ndrive as string) as long

---- private declare sub getsysteminfo lib "kernel32" (lpsysteminfo as system_info) private declare function getsystemmetrics lib "user32" (byval nindex as long) as long

private const gwl_exstyle = (-20)

private const gwl_style = (-16)

private const gwl_wndproc = (-4)

private const gwl_hinstance = (-6)

private type system_info

dwoemid as long

dwpagesize as long

dwactiveprocessormask as long

dwnumberorfprocessors as long

dwprocessortype as long

dwallocationgranularity as long

dwreserved as long

end type

private const **_cxscreen = 0

private const **_cyscreen = 1

private sub command1_click()

dim hinst as long

dim icons as long

dim

abouts as long

dim dispx as string

dim dispy as string

dim cps as string

dim space1 as string

dim space2 as string

hinst = getwindowword(me.hwnd, gwl_hinstance)

icons = extracticon(hinst, "d:fpw26foxprow.exe", 0)

dim sysinfo as system_info

dim cls1 as long

dim cls2 as long

dim secs as long

dim bytes as long

dim buffs as string

buff = "c:"

x = getdrivetype(buffs)

x = getdiskfreespace(buffs, secs, bytes, cls1, cls2)

cls1 = cls1 * secs * bytes

cls2 = cls2 * secs * bytes

space1 = "c驅動器總共容量:

" + format$(cls2/1024, "#, #") + "千位元組"

space2 = "c驅動器可用容量:

" + format$(cls1/1024, "#, #") + "千位元組"

x = getsystemmetrics(**_cxscreen)

dispx = "顯示器解析度:" + str$(x)

x = getsystemmetrics(**_cyscreen)

dispy = str$(x)

call getsysteminfo(sysinfo)

select case sysinfo.dwprocessortype

case 386

cpus = "處理器型別:386"

case 486

cpus = "處理器型別:486"

case 586

cpus = "處理器型別:586"

end select

abouts = shell

about(me.hwnd, "演示程式",

& chr$(13) & chr$(10) & space1 & chr$(13) & chr$(10)

& space2 & chr$(13) & chr$(10) & cpus + " " + dispx +

"*" + dispy , icons)

end sub

---- 以 上 程 序 在windows98,visual basic 6.0 for windows 環 境 下 運 行 通 過. 用 戶 可 以 將 其 加 入 應 用 系 統 的

about 菜 單 項, 通 過 菜 單 項 調 用 它, 效 果 更 好。

APP呼叫伺服器API設計

2 傳送其他請求時將引數按約定排序 加上timestamp 用來判斷token是否超時 token引數 加上secret進行md5加密sign簽名,這樣別人無法偽造修改url 和web系統的區別?瀏覽器請求每次都會帶上cookie,效率低 資料報被監聽重放攻擊?關於防止重放攻擊,目前主流做法,要求通...

用API函式在DELPHI中實現「非典型」窗體

1.異形窗體 窗體只能是方的嗎?不是,還可以有其他形狀。這要用到兩個win32 api函式。首先用createroundrectrgn 函式在窗體內界定乙個橢圓形區域。這裡所指的區域 region 是乙個特殊的api物件,我們可以在區域內部進行填充和剪裁等操作,從而定義窗體的外部特徵。然後呼叫set...

反射呼叫android系統級API函式

try object store con.newinstance this method methods mclass.getdeclaredmethods method method null for method m methods if method.isaccessible object a...