(bind-func set_window_wndproc
(lambda (window:HWND proc:i8*) ;; proc must be native [LRESULT,HWND,UINT,WPARAM,LPARAM]*
(let (;; (res (SetClassLongPtrA window GCLP_WNDPROC (ptrtoi64 proc)))
;; (oldproc (i64toptr (GetWindowLongPtrW window GWL_WNDPROC)))
;; (res (SetWindowLongPtrW window GWL_WNDPROC (ptrtoi64 proc))))
(oldproc (i64toptr (GetWindowLongPtrA window GWL_WNDPROC)))
(res (SetWindowLongPtrA window GWL_WNDPROC (ptrtoi64 proc))))
(if (null? oldproc)
(println "Error retrieving OLDPROC")
(println "Success retrieving OLDPROC"))
(set! OLD_WINDOWS_WNDPROC oldproc)
(if (= res 0)
(println "Error setting wndproc: err(" (GetLastError) ")")
(println "Sucessess setting wndproc!")))
void))