国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

powerbuilder中把圖標放在時間顯示處

2024-07-21 02:10:24
字體:
來源:轉載
供稿:網友

將窗口最小化為時鐘旁的小圖標

編輯整理:panya

建立主窗口“w_main”:

 

窗口定義如下“local external fuctions”:

function long loadlibrary( ref string string ) library "kernel32" alias for loadlibrarya

function long freelibrary( long long ) library "kernel32"

function boolean shell_notifyicon( ulong long, ref s_str str ) library "shell32" alias for "shell_notifyicona"

function long loadicon( long long, long long ) library "user32" alias for loadicona

 

定義結構型變量:

s_str:

size

unsignedlong

hwnd

long

id

unsignedlong

flags

unsignedlong

callbackmessage

unsignedlong

icon

long

tips[64]

character

 

定義實例變量:

private:

s_str istr_icon

 

窗口最小化按鈕click事件寫入如下script:

string ls_resource

long ll_handle

// 下三句為裝入圖標資源,notepad.exe即為寫字板,exe執行時顯示的圖標內定為1

ls_resource = "notepad.exe"

ll_handle = loadlibrary ( ls_resource )

istr_icon.icon = loadicon ( ll_handle, 1 )

// 窗口回調事件號,pbm_custom01即為1024,02為1025,依此類推

istr_icon.callbackmessage = 1024

istr_icon.tips = "應用程序"

istr_icon.hwnd = handle ( parent )

istr_icon.size = 88

istr_icon.id = 1

// 標識值,即為顯示tips 4, 顯示icon 2, 激活窗口對應事件號

istr_icon.flags = 7

// 顯示icon關鍵函數, 0為顯示,1為修改,2為刪除

shell_notifyicon ( 0, istr_icon )

parent.hide ( )

// 釋放資源

freelibrary ( ll_handle )

 

為窗口創建用戶定義事件ue_event,event id為pbm_custom01,為其寫script:

m_popup lm_popup

integer li_x, li_y

choose case lparam

case 513 // lbuttonup

// 刪除圖標

shell_notifyicon( 2, istr_icon )

// 顯示窗口

this.show ( )

case 517 // rbuttonup

li_x = this.x

li_y = this.y

// 移動到屏幕外以免show 時看到,你可關閉此句看什么效果

this.move ( - this.width - 10, - this.height - 10 )

// 加這句才能看到菜單條(菜單條屬于此windows)

this.show ( )

lm_popup = create m_popup

lm_popup.m_item.popmenu ( pointerx ( ), pointery ( ) )

// 恢復設置

this.hide ( )

this.move ( li_x, li_y )

destroy lm_popup

end choose

 

其中,“m_popup”為最小化成trayicon圖標時點擊右鍵時彈出的菜單。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 天峻县| 合川市| 车险| 乌兰县| 长顺县| 个旧市| 日土县| 扶绥县| 宁国市| 肇源县| 金溪县| 三原县| 唐海县| 五指山市| 鄱阳县| 奉化市| 邹平县| 水城县| 武乡县| 太仆寺旗| 萍乡市| 平陆县| 吉林市| 崇文区| 长沙市| 乐山市| 盐津县| 鹿邑县| 深州市| 马龙县| 兖州市| 常宁市| 蓝田县| 新干县| 乐山市| 资兴市| 遂平县| 宁津县| 泗洪县| 商都县| 台南县|