Office中國(guó)論壇/Access中國(guó)論壇

 找回密碼
 注冊(cè)

QQ登錄

只需一步,快速開始

返回列表 發(fā)新帖
樓主: Roadbeg
打印 上一主題 下一主題

[高2]系統(tǒng)托盤區(qū)功能.

[復(fù)制鏈接]

點(diǎn)擊這里給我發(fā)消息

21#
發(fā)表于 2003-4-9 21:13:00 | 只看該作者
給你目標(biāo)你卻不努力,儒子不可教也。
22#
發(fā)表于 2003-4-9 21:42:00 | 只看該作者
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽
23#
發(fā)表于 2003-4-9 21:49:00 | 只看該作者
托盤只需要加入這個(gè)模塊就可以了!
Option Compare Database


'************** Code Start *************
'
'------------------------------
'  Do NOT try to step through
'  this code.  Entering debug mode
'  will cause a GPF if the window
'  is subclassed.
'------------------------------

'//LoadImage flags
Private Const WM_GETICON = &H7F  'message is sent to a window to retrieve a handle _
                                                            to the large or small icon associated with a window
Private Const WM_SETICON = &H80  'message to associate a new large or small icon with a window
Private Const IMAGE_BITMAP = 0      'Loads a bitmap.
Private Const IMAGE_ICON = 1         ' Loads an icon.
Private Const IMAGE_CURSOR = 2   'Loads a cursor.
Private Const LR_LOADFROMFILE = &H10      'Loads the image from the file specified by _
                                                                           the lpszName parameter. If this flag is not _
                                                                           specified, lpszName is the name of the resource.
Private Const ICON_SMALL = 0&    'Retrieve the small icon for the window.
Private Const ICON_BIG = 1&         'Retrieve the large icon for the window.

'loads an icon, cursor, or bitmap.
Private Declare Function apiLoadImage Lib "user32" _
   Alias "LoadImageA" _
   (ByVal hInst As Long, _
   ByVal lpszName As String, _
   ByVal uType As Long, _
   ByVal cxDesired As Long, _
   ByVal cyDesired As Long, _
   ByVal fuLoad As Long) _
   As Long

Private Declare Function apiSendMessageLong Lib "user32" _
   Alias "SendMessageA" _
   (ByVal hWnd As Long, _
   ByVal wMsg As Long, _
   ByVal wParam As Long, _
   ByVal lParam As Long) _
   As Long

'//SHGetFileInfo flags
Private Const SHGFI_ICON = &H100                          '// get icon
Private Const SHGFI_DISPLAYNAME = &H200            '// get display name
Private Const SHGFI_TYPENAME = &H400                  '// get type name
Private Const SHGFI_ATTRIBUTES = &H800               '// get attributes
Private Const SHGFI_ICONLOCATION = &H1000       '// get icon location
Private Const SHGFI_EXETYPE = &H2000                   '// return exe type
Private Const SHGFI_SYSICONINDEX = &H4000         '// get system icon index
Private Const SHGFI_LINKOVERLAY = &H8000           '// put a link overlay on icon
Private Const SHGFI_SELECTED = &H10000               '// show icon in selected state
Private Const SHGFI_ATTR_SPECIFIED = &H20000   '// get only specified attributes
Private Const SHGFI_LARGEICON = &H0                    '// get large icon
Private Const SHGFI_SMALLICON = &H1                    '// get small icon
Private Const SHGFI_OPENICON = &H2                     '// get open icon
Private Const SHGFI_SHELLICONSIZE = &H4             '// get shell size icon
Private Const SHGFI_PIDL = &H8                               '// pszPath is a pidl
Private Const SHGFI_USEFILEATTRIBUTES = &H10  '// use passed dwFileAttribute

Private Const FILE_ATTRIBUTE_NORMAL = &H80
Private Const MAX_PATH = 260

Private Type SHFILEINFO
   hIcon As Long                                      'Handle to the icon that represents the file.
   iIcon As Long                                        'Index of the icon image within the _
                                                                 system image list.
   dwAttributes As Long                            'Array of values that indicates the _
                                                                  attributes of the file object.
   szDisplayName As String * MAX_PATH  'String that contains the name of the _
                                                                  file as it appears in the Windows shell
   szTypeName As String * 80                   'String that describes the type of file.
End Type

'Retrieves information about an object in the file system,
'such as a file, a folder, a directory, or a drive root.
Private Declare Function apiSHGetFileInfo Lib "shell32.dll" _
   Alias "SHGetFileInfo
24#
發(fā)表于 2003-4-9 22:58:00 | 只看該作者
to harsonliao : 我沒做過,不過應(yīng)該是用movesize了,movesize 完全能達(dá)到要求,而且簡(jiǎn)單
25#
發(fā)表于 2003-4-9 23:04:00 | 只看該作者
to 吳天明 ,菜單用一個(gè)非模式的彈出窗體代替,只要把窗體的邊匡,放大縮小按鈕,記錄瀏覽等等全部去掉就 ok了,里面要好看就加點(diǎn)圖片進(jìn)去,要做換膚都可以,如果喜歡,加一個(gè)異型函數(shù)進(jìn)取,做個(gè)異型菜單出來也不是難事。

我把思路全說了,代碼,本站的舊貼中全部都有。

不過我這樣說得容易,codeing卻要挺長(zhǎng)時(shí)間,就看誰有這個(gè)耐心了,我是已經(jīng)沒興趣了。

另外,有興趣的去 www.access-web.com 或者 www.access911.com 這兩個(gè)外國(guó)網(wǎng)站去看看,里面大多效果都有了,就看你是否有那個(gè)耐心了

如果wtm1得代碼看不懂,可以去天極網(wǎng)找一片中文的,里面有詳細(xì)說明。

[此貼子已經(jīng)被作者于2003-4-9 15:08:56編輯過]

26#
發(fā)表于 2003-4-9 23:14:00 | 只看該作者
還是不明白!一塌糊涂!給個(gè)例子看看!當(dāng)程序成為系統(tǒng)托盤后,在系統(tǒng)托盤點(diǎn)擊右鍵出現(xiàn)菜單,靠!!我越想越暈!幫幫嗎??
27#
 樓主| 發(fā)表于 2003-4-10 00:00:00 | 只看該作者
需要這些 api,感興趣的網(wǎng)友把這些 api 的說明看了,應(yīng)該就明白了.
sendmessage
setwindowlong
shell_notifyicon
callwindowproc


[此貼子已經(jīng)被作者于2003-4-9 16:00:40編輯過]

28#
發(fā)表于 2003-4-10 00:33:00 | 只看該作者
奧!不明白!

點(diǎn)擊這里給我發(fā)消息

29#
發(fā)表于 2003-4-10 03:27:00 | 只看該作者
確認(rèn)點(diǎn)擊點(diǎn)可使用
Public Declare Function apiGetCursorPos Lib "user32" _
  Alias "GetCursorPos" _
  (lpPoint As POINTAPI) _
  As Long

使用 CreatePopupMenu創(chuàng)建真正的菜單

點(diǎn)擊這里給我發(fā)消息

30#
發(fā)表于 2003-4-10 06:56:00 | 只看該作者
已經(jīng)實(shí)現(xiàn)了真正的菜單功能,不過還需測(cè)試一下,只是不能參加比賽啦,沒能有zhengjialon的好效果:)還是充作下一期勝出者獎(jiǎng)品啦
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則

QQ|站長(zhǎng)郵箱|小黑屋|手機(jī)版|Office中國(guó)/Access中國(guó) ( 粵ICP備10043721號(hào)-1 )  

GMT+8, 2024-10-23 06:20 , Processed in 0.095493 second(s), 32 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回復(fù) 返回頂部 返回列表