第三方程序界面样式修改
请问如何修改第三方程序的界面样式,例如将运行的记事本程序样式改为$WS_POPUP样式,已知autoit自己绘制的GUI可以用GUISetStyle()来修改。多谢多谢! 本帖最后由 tubaba 于 2017-3-10 10:07 编辑
回复 1# sellkingfly
#include <WinAPIConstants.au3>
Local $PID = Run('notepad.exe')
Local $Embed_hWnd = _GetHwndFromPID($PID)
Local $sFuncName = "GetWindowLongW"
If @AutoItX64 Then $sFuncName = "GetWindowLongPtrW"
Local $aResult = DllCall("user32.dll", "long_ptr", $sFuncName, "hwnd", $Embed_hWnd, "int", $GWL_STYLE) ;获取窗口样式
Local $hWindowLong = $aResult
Local $sFuncName = "SetWindowLongW"
If @AutoItX64 Then $sFuncName = "SetWindowLongPtrW"
Local $aResult = DllCall("user32.dll", "long_ptr", $sFuncName, "hwnd", $Embed_hWnd, "int", $GWL_STYLE, "LONG", $hWindowLong - 0xC00000) ;在此样式上去掉窗口标题栏
Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2
If $winlist2[$i] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc ;==>_GetHwndFromPID
本帖最后由 sellkingfly 于 2017-3-10 11:28 编辑
回复 2# tubaba
谢谢哈,又学到不少!
不过和$WS_POPUP的边框还有些不一样,对API这块不了解,恕在下愚钝无法举一反三。 没意思,修改了反而不好看
页:
[1]