Lisp HUG Maillist Archive

how to get a window reference

Lots of Windows API functions take a window reference parameter (HWND). 
I inspected an interface and came up with this

(defmethod window-reference ((self interface))
   #+win32
   (slot-value (capi-internals:representation self) 'win32:hwnd))

It works except at high delivery levels (4) where it crashes:

Error: An error of type CONDITIONS::SLOT-MISSING-ERROR....

I tried adding the representation class (win32:r-top-level-interface) 
to the :classes-to-keep-effective-slots delivery keyword, but still the 
same error.

Is there a better way to get the window HWND reference that works at 
all delivery levels?

BTW, the reason I need this is because I want to create an interface 
that is the height of the screen minus the task bar height. I don't see 
any way to do that in capi.

Thanks,

John DeSoi, Ph.D.


Re: how to get a window reference

Hello John,

| Lots of Windows API functions take a window reference parameter (HWND).
| I inspected an interface and came up with this
| 
| (defmethod window-reference ((self interface))
|    #+win32
|    (slot-value (capi-internals:representation self) 'win32:hwnd))
| 
| It works except at high delivery levels (4) where it crashes:
| 
| Error: An error of type CONDITIONS::SLOT-MISSING-ERROR....
| 
| I tried adding the representation class (win32:r-top-level-interface) 
| to the :classes-to-keep-effective-slots delivery keyword, but still the
| same error.
| 
| Is there a better way to get the window HWND reference that works at 
| all delivery levels?
| 
| BTW, the reason I need this is because I want to create an interface 
| that is the height of the screen minus the task bar height. I don't see
| any way to do that in capi.

CAPI:SIMPLE-PANE-HANDLE
--
Sincerely,
Dmitri Ivanov
lisp.ystok.ru


Re: how to get a window reference

At 9:00 AM +0400 10/27/04, Dmitri Ivanov wrote:
>Hello John,
>
>| Lots of Windows API functions take a window reference parameter (HWND).
>| I inspected an interface and came up with this
>|
>| (defmethod window-reference ((self interface))
>|    #+win32
>|    (slot-value (capi-internals:representation self) 'win32:hwnd))
>|
>| It works except at high delivery levels (4) where it crashes:
>|
>| Error: An error of type CONDITIONS::SLOT-MISSING-ERROR....
>|
>| I tried adding the representation class (win32:r-top-level-interface)
>| to the :classes-to-keep-effective-slots delivery keyword, but still the
>| same error.
>|
>| Is there a better way to get the window HWND reference that works at
>| all delivery levels?
>|
>| BTW, the reason I need this is because I want to create an interface
>| that is the height of the screen minus the task bar height. I don't see
>| any way to do that in capi.
>
>CAPI:SIMPLE-PANE-HANDLE

Also, check with Xanalys.  They gave me a private patch that returns 
the geometry of the screen, taking the task bar height into account. 
(It also works on the Mac w.r.t. the Dock)

   - Gary


Updated at: 2020-12-10 08:54 UTC