realbasic-plugins
[Top] [All Lists]

Re: Storing global data (was Callbacks and events on Windows)

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Storing global data (was Callbacks and events on Windows)
From: James Milne <james dot milne at mac dot com>
Date: Wed, 26 Apr 2006 15:28:00 +0100
Cc: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>, REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <C0753808 dot 4B4FC%listmail1 at dsl dot pipex dot com> <6709205 dot 1146060872895 dot JavaMail dot james dot milne at mac dot com>
On Wednesday, April 26, 2006, at 03:14PM, James Milne <james dot milne at mac 
dot com> wrote:
>> Here's my
>> dilemma: how do I store these old pointers in a global way such that they
>> may be retrieved by the custom WindowProc? (It could then identify the right
>> one to used based on the window handle passed in.)
>> 
>> If I store them in the HIDManager instance, I have no way to retrieve the
>> instance from within the WindowProc.  Is there anywhere else (within my
>> plugin code) that they could be stored and be globally available?
>
>SetWindowData() is your friend. It allows you to store data against the Window 
>Handle. When you create the window, call SetWindowHandle and stash your 
>REALobject instance reference in there. 
>
>You can use GetWindowData to retrieve your REALobject instance from the HWND 
>passed to the WndProc.

Sorry- the functions I meant where GetWindowLong and SetWindowLong.

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/windowclassreference/windowclassfunctions/setwindowlong.asp>

--
James Milne
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>