Home » Windows API

DrawMenuBar

說明:
DrawMenuBar 函式可重繪指定視窗代碼(Handle)的選單


引用函式庫:
User32


適用系統:
Windows NT 3.1 或 Windows 95以上


函式原型:

Declare Function DrawMenuBar Lib "user32" Alias "DrawMenuBar" ( _
    ByVal hwnd As Long _
    ) As Long



參數型態及說明:
hwndLong 要重繪選單的視窗代碼(Handle)

回傳值:
Long 呼叫成功的話,將會回傳非零的數值;若呼叫失敗的話,則回傳 0

.NET Framework API:


VB範例:

檢視原始碼 Visual Basic
1
2
3
4
5
6
7
8
9
'VB的宣告
Private Declare Function DrawMenuBar Lib "user32" ( _
	ByVal hwnd As Long _
	) As Long
 
Dim rtvl As Long
 
'重繪目前執行視窗的選單
rtvl = DrawMenuBar(Form1.hwnd)

RB範例:

檢視原始碼 REALBasic
1
2
3
4
5
6
7
8
9
'RB的宣告
Declare Function DrawMenuBar Lib "user32" ( _
	hwnd As Integer _
	) As Boolean
 
Dim rtvl As Boolean
 
'重繪目前執行視窗的選單
rtvl = DrawMenuBar(Window1.WinHWND)

VB.NET範例:

1
2
3
4
5
6
7
8
9
10
11
'VB.NET的宣告
<DllImport("user32.dll")> _
Shared Function DrawMenuBar( _
	ByVal hwnd As IntPtr _
	) As Boolean
End Function
 
Dim rtvl As Boolean
 
'重繪目前執行視窗的選單
rtvl = DrawMenuBar(Me.Handle)

C#範例:

1
2
3
4
5
6
7
8
9
10
//C#的宣告
[DllImport("user32")]
public static extern bool DrawMenuBar(
	IntPtr hwnd
	);
 
bool rtvl;
 
//重繪目前執行視窗的選單
rtvl = DrawMenuBar(this.Handle);

也許您對這些文章也有興趣

  • IsPwrShutdownAllowed
  • GetClientRect
  • PolylineTo
  • InternetGetConnectedState
  • Pie
  • LineTo

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>