找回密码
 加入
搜索
查看: 8282|回复: 10

[汉化建议] _WinAPI_FatalExit 去掉返回值; _WinAPI_ExtSelectClipRgn 追加示例

 火.. [复制链接]
发表于 2011-9-21 18:29:06 | 显示全部楼层 |阅读模式
本帖最后由 131738 于 2011-9-21 18:32 编辑

如题!看来仅复制也不行。。。。。。。
发表于 2011-9-21 20:36:34 | 显示全部楼层
除了winhttp,其它还没搞呢..
每天弄得不多.winhttp弄了一个晚上多...
 楼主| 发表于 2011-9-21 21:51:34 | 显示全部楼层
除了winhttp,其它还没搞呢..
每天弄得不多.winhttp弄了一个晚上多...
thesnow 发表于 2011-9-21 20:36


手工麻烦
发表于 2011-9-25 19:07:10 | 显示全部楼层
回复 3# 131738 [au3]#Include <GUITab.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)
Opt('TrayAutoPause', 0)

If Not _WinAPI_DwmIsCompositionEnabled() Then
        MsgBox(16, 'Error', 'Require Windows Vista or later with enabled Aero theme.')
        Exit
EndIf

Global Const $PRF_CLIENT = 0x04

Global $hForm, $hTab, $tMARGINS, $hDll, $pDll, $hProc

OnAutoItExitRegister('OnAutoItExit')

; Create GUI
$hForm = GUICreate('MyGUI', 400, 400)
GUICtrlCreateTab(0, 60, 402, 341, $WS_CLIPCHILDREN)
$hTab = GUICtrlGetHandle(-1)
GUICtrlCreateTabItem('Tab 1')
GUICtrlCreateButton('Button', 150, 167, 100, 26)
_WinAPI_SetParent(GUICtrlGetHandle(-1), $hTab)
GUICtrlCreateTabItem('Tab 2')
GUICtrlCreateEdit('', 14, 34, 372, 292)
_WinAPI_SetParent(GUICtrlGetHandle(-1), $hTab)
GUICtrlCreateTabItem('Tab 3')
GUICtrlCreateTabItem('')
GUISetBkColor(0)

; Register Tab window proc
$hDll = DllCallbackRegister('_WinProc', 'ptr', 'hwnd;uint;wparam;lparam')
$pDll = DllCallbackGetPtr($hDll)
$hProc = _WinAPI_SetWindowLongEx($hTab, $GWL_WNDPROC, $pDll)

; Create the "sheet of glass" effect for the Tab client area. You must call this function whenever DWM composition is toggled.
$tMARGINS = DllStructCreate($tagMARGINS)
DllStructSetData($tMARGINS, 1, 2)
DllStructSetData($tMARGINS, 2, 2)
DllStructSetData($tMARGINS, 3, 82)
DllStructSetData($tMARGINS, 4, 2)
_WinAPI_DwmExtendFrameIntoClientArea($hForm, $tMARGINS)

GUISetState()

Do
Until GUIGetMsg() = -3

Func _WinProc($hWnd, $iMsg, $wParam, $lParam)
        If _WinAPI_IsThemeActive() Then
                Switch $iMsg
                        Case $WM_ERASEBKGND

                                Local $tRECT, $hBrush, $hRgn, $hPrev

                                $hPrev = _WinAPI_GetClipRgn($wParam)
                                $hRgn = _CreateClipRgn($hWnd)
                                _WinAPI_ExtSelectClipRgn($wParam, $hRgn, $RGN_DIFF)
                                $tRECT = _WinAPI_GetClientRect($hWnd)
                                $hBrush = _WinAPI_CreateSolidBrush(0)
                                _WinAPI_FillRect($wParam, DllStructGetPtr($tRECT), $hBrush)
                                _WinAPI_SelectClipRgn($wParam, $hPrev)
                                _WinAPI_DeleteObject($hBrush)
                                _WinAPI_DeleteObject($hRgn)
                                Return 1
                        Case $WM_PAINT

                                Local $tPAINTSTRUCT, $hDC, $hRgn

                                $hDC = _WinAPI_BeginPaint($hWnd, $tPAINTSTRUCT)
                                $hRgn = _CreateClipRgn($hWnd)
                                _WinAPI_ExtSelectClipRgn($hDC, $hRgn, $RGN_AND)
                                _WinAPI_CallWindowProc($hProc, $hWnd, $WM_PRINTCLIENT, $hDC, $PRF_CLIENT)
                                _WinAPI_DeleteObject($hRgn)
                                _WinAPI_EndPaint($hWnd, $tPAINTSTRUCT)
                                Return 0
                EndSwitch
        EndIf
        Return _WinAPI_CallWindowProc($hProc, $hWnd, $iMsg, $wParam, $lParam)
EndFunc   ;==>_WinProc

Func _CreateClipRgn($hWnd)

        Local $tRECT, $hTmp, $hRgn, $Ht, $Count, $Sel

        $Count = _GUICtrlTab_GetItemCount($hWnd)
        $Sel = _GUICtrlTab_GetCurSel($hWnd)
        $hRgn = _WinAPI_CreateNullRgn()
        For $i = 0 To $Count - 1
                $tRECT = _GUICtrlTab_GetItemRectEx($hWnd, $i)
                If $i = $Sel Then
                        $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRECT, 1) - 2, DllStructGetData($tRECT, 2) - 2, DllStructGetData($tRECT, 3) + 2, DllStructGetData($tRECT, 4))
                        $Ht = DllStructGetData($tRECT, 4) - DllStructGetData($tRECT, 2) + 2
                Else
                        If $i = $Count - 1 Then
                                $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRECT, 1), DllStructGetData($tRECT, 2), DllStructGetData($tRECT, 3) - 2, DllStructGetData($tRECT, 4))
                        Else
                                $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRECT, 1), DllStructGetData($tRECT, 2), DllStructGetData($tRECT, 3), DllStructGetData($tRECT, 4))
                        EndIf
                EndIf
                _WinAPI_CombineRgn($hRgn, $hRgn, $hTmp, $RGN_OR)
                _WinAPI_DeleteObject($hTmp)
        Next
        $tRECT = _WinAPI_GetClientRect($hWnd)
        $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRECT, 1), DllStructGetData($tRECT, 2) + $Ht, DllStructGetData($tRECT, 3) - 2, DllStructGetData($tRECT, 4) - 1)
        _WinAPI_CombineRgn($hRgn, $hRgn, $hTmp, $RGN_OR)
        _WinAPI_DeleteObject($hTmp)
        Return $hRgn
EndFunc   ;==>_CreateClipRgn

Func OnAutoItExit()
        _WinAPI_SetWindowLongEx($hTab, $GWL_WNDPROC, $hProc)
        DllCallbackFree($hDll)
EndFunc   ;==>OnAutoItExit
[/au3]
 楼主| 发表于 2011-9-25 21:04:18 | 显示全部楼层
本帖最后由 131738 于 2011-9-25 21:10 编辑

回复 4# netegg

WinAPIEx 3.4  函数,除添加 3.4 版本的库文件外,脚本添加:
    #Include <APIConstants.au3>


看来 帅版3.3.7.15.1 还没有添加新库文件,估计帅是不会再看这里了

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-9-25 23:29:48 | 显示全部楼层
回复 5# 131738

那个常量库我知道,我给放到apiex里了,所以只有一个文件了:)
 楼主| 发表于 2011-9-26 00:48:01 | 显示全部楼层
回复 6# netegg

3.4 有 3 个库文件,丢了再去下。。。
发表于 2011-9-26 01:33:30 | 显示全部楼层
回复 7# 131738
三个?一个主函数,一个常量,还一个error,,我给合并成一个了
发表于 2011-9-26 10:02:08 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2011-9-26 13:19:56 | 显示全部楼层
回复 9# thesnow

3.3.7.15.1 有些函数示例的包含文件名没改。。。。
发表于 2011-9-26 21:50:31 | 显示全部楼层
一群高人讨论的高深的东东把我搞得云里雾里,4楼代码编译出错了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-20 21:57 , Processed in 0.075910 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表