Installed 6.10 beta 6 today, and my app crashes with this line now:
Code: Select all
Gadget_Num = GetDlgCtrlID_(Gadget_hWnd)Code: Select all
Gadget_Num = GetProp_(hWnd,"PB_ID")Thanks.
Code: Select all
Gadget_Num = GetDlgCtrlID_(Gadget_hWnd)Code: Select all
Gadget_Num = GetProp_(hWnd,"PB_ID")Code: Select all
If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
h = CreateWindowEx_(0, "BUTTON", "test", #BS_RIGHT | #WS_VISIBLE | #WS_CHILD, 10, 10, 100, 30, WindowID(0), $1234567890ABCDEF, 0, 0)
If h
Debug Hex(GetDlgCtrlID_(h))
Debug Hex(GetWindowLongPtr_(h, #GWLP_ID))
DestroyWindow_(h)
EndIf
CloseWindow(0)
EndIf
90ABCDEF
1234567890ABCDEF
Ah, okay. That explains why my source works in 6.04 but not 6.10 now. Thanks! I'll use the prop version from now on.breeze4me wrote: Sat Mar 02, 2024 9:38 amin 6.10 something changed and high numbers are assigned more often
Code: Select all
;-TOP
Procedure UpdateWindow()
Protected dx, dy
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
; Resize Gadgets
EndProcedure
Procedure Main()
Protected dx, dy
#WinStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "Test Window", #WinStyle)
; MenuBar
CreateMenu(0, WindowID(0))
MenuTitle("File")
; StatusBar
CreateStatusBar(0, WindowID(0))
AddStatusBarField(#PB_Ignore)
; Gadgets
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
btn = ButtonGadget(#PB_Any, 10, 10, 120, 25, "Ok")
btn2 = ButtonGadget(2, 140, 10, 120, 25, "Ok 2")
Debug "Button Any 0x" + RSet(Hex(btn), 16, "0")
Debug "CtrlID Any 0x" + RSet(Hex(GetWindowLongPtr_(GadgetID(btn), #GWLP_ID)), 16, "0")
Debug "Button Array 0x" + RSet(Hex(2), 16, "0")
Debug "CtrlID Array 0x" + RSet(Hex(GetWindowLongPtr_(btn2, #GWLP_ID)), 16, "0")
; Bind Events
BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
; Main Loop
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case 0
Break
EndSelect
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ForEver
EndIf
EndProcedure : Main()

Glad to see you back !BarryG wrote: Sat Mar 02, 2024 4:19 am Hi all. Back after an extended break to relax and find myself