Code: Select all
ahkThread("Gui := GuiCreate()`nFakeLink := Gui.Add(`"Text`", `"cRed`", 111)`nGui.Show()")
Code: Select all
ahkThread("Gui := GuiCreate()`nFakeLink := Gui.Add(`"Text`", `"cRed`", 111)`nGui.Show()")
Code: Select all
Gui := GuiCreate()
f:=Gui.AddText("x10 y10 w100 h100")
WS_CHILD:=1073741824,WS_VISIBLE:=268435456,SS_CENTER:=1
static_win := CreateWindowEx(0, "static","test",WS_CHILD|WS_VISIBLE|SS_CENTER,5,5,50,50,f.hwnd,0,A_ModuleHandle,0)
;static_win.Opt("Backgroundffffff")
; b:=Gui.AddText("x60 y60 w10 h10 Parent" f.hwnd)
f.Opt("Backgroundffffff")
Gui.Show("w300 h300")
return
Of course it is invalid, this was a question to to see if I understood you correct.arcticir wrote:Thanks. But this is invalid: text:=Gui.AddText({c:"Red"}, 111)
Obviously CreateWindowEx does not return an object, you need to use Custom Control, see https://lexikos.github.io/v2/docs/comma ... htm#CustomI have two new questions:
1, how to set the parent window of the AHK control? 2 how to set the background color of the WINAPI control?
Code: Select all
Gui := GuiCreate() f:=Gui.AddText("x10 y10 w100 h100") WS_CHILD:=1073741824,WS_VISIBLE:=268435456,SS_CENTER:=1 static_win := CreateWindowEx(0, "static","test",WS_CHILD|WS_VISIBLE|SS_CENTER,5,5,50,50,f.hwnd,0,A_ModuleHandle,0) ;static_win.Opt("Backgroundffffff") ; b:=Gui.AddText("x60 y60 w10 h10 Parent" f.hwnd) f.Opt("Backgroundffffff") Gui.Show("w300 h300") return
I can't imagine how this would be more flexible.arcticir wrote:What i want to say is that you do not think passing the object as an option parameter, more flexible and reasonable?
You can simply use SetParent() to change or set the parent.Yes, but obviously "GUI.ADD ()" is using CreateWindowEx,
I want to know how to specify its "hWndParent" parameter.
In other words, I need more definition of the option. Let the GUI API and WINAPI mixed use.
Otherwise, I will abandon the use of the new GUI API, and use the pure WINAPI GUI.
I recently analyzed the H version of the function "SplashImage.ahk", harvest rich.
What's important is that I can define the GUI as I like.
But unfortunately, its example is still too little, can you write a more complex example? Contains more controls, and control the operation method (eg control transparent).
thank you very much.
Code: Select all
SetControlDelay(-1)
SetWinDelay(-1)
gui:=GuiCreate()
t1:=gui.addtext("w200 h200 x5 y5")
t1.Opt("Backgroundffffff")
t2:=gui.addtext("w50 h50 x2 y2","test")
SetParent(t2.hwnd,t1.hwnd)
t2.Opt("BackgroundTrans") ; invalid. or t2.Opt("Backgroundeeeeee")
gui.show("w444 h434")
MsgBox
Users browsing this forum: No registered users and 12 guests