#定义 IDD_DLG1 1000
#定义 IDC_BTN1 1001
#定义 IDC_BTN2 1002
#定义 IDC_BTN3 1003
子程序 X_SetFocus (hWnd 为 HWND)
SetFocus (hWnd)
结束 子程序
类型 kj_Button
变量 hWnd 为 HANDLE
声明 子程序 Init (传值 WinHWND 为 HANDLE, 传值 WinID 为 DWord)
声明 子程序 Click ()
声明 子程序 Refresh ()
声明 子程序 SetFocus ()
声明 子程序 Move (传值 X 为 DWORD , 传值 Y 为 DWORD , 传值 WWidth 为 DWORD , 传值 Height 为 DWORD)
声明 属性 Enabled (NewBol 为 BOOL) '属性 : 是否 可用
声明 属性 Enabled 为 BOOL
声明 属性 Visible (NewBol 为 BOOL) '属性 : 是否 可见
声明 属性 Visible 为 BOOL
声明 属性 Caption (NewStr 为 文本) '属性 : 标题
声明 属性 Caption 为 文本
结束 类型
子程序 kj_Button.Init (传值 WinHWND 为 HANDLE , 传值 WinID 为 DWord)
如果 WinID = 0 则
hWnd = WinHWND
否则
hWnd = GetDlgItem( WinHWND , WinID)
结束 如果
结束 子程序
子程序 kj_Button.Click ()
SendMessage (hWnd , BM_CLICK , 0 , 0)
结束 子程序
子程序 kj_Button.Refresh ()
UpdateWindow (hWnd)
结束 子程序
子程序 kj_Button.SetFocus ()
X_SetFocus (hWnd)
结束 子程序
子程序 kj_Button.Move (传值 X 为 DWORD , 传值 Y 为 DWORD , 传值 W 为 DWORD , 传值 H 为 DWORD)
MoveWindow (hWnd , X , Y , W , H , TRUE)
结束 子程序
属性 kj_Button.Enabled (NewBol 为 BOOL)
EnableWindow (hWnd , NewBol)
结束 属性
属性 kj_Button.Enabled 为 BOOL
Enabled = IsWindowEnabled (hWnd)
结束 属性
属性 kj_Button.Visible (NewBol 为 BOOL)
ShowWindow (hWnd , 选择 (NewBol , SW_SHOW , SW_HIDE))
结束 属性
属性 kj_Button.Visible 为 BOOL
Visible = IsWindowVisible (hWnd)
结束 属性
属性 kj_Button.Caption (NewStr 为 文本)
SetWindowText (hWnd , NewStr)
结束 属性
属性 kj_Button.Caption 为 文本
变量 TL 为 DWORD , TS 为 文本
TL = GetWindowTextLength (hWnd)
TS = 取空白文本 (TL)
GetWindowText (hWnd , TS , TL + 1)
Caption = TS
结束 属性