realbasic-plugins
[Top] [All Lists]

controlHandleGetter question

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: controlHandleGetter question
From: Suikyo <toruas at axel dot ocn dot ne dot jp>
Date: Fri, 20 Jan 2006 14:47:05 +0900
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <BFF1B677 dot 41548%listmail1 at dsl dot pipex dot com> <6A88C6E6-5DB7-460A-8011-3952CCEBE825 at gmx dot net> <E29A17C6-623B-424D-BFEA-5F0EC3FBD8DA at chaoticbox dot com> <003951F9-5CF2-4D16-B319-D74BA6A7367A at gmx dot net> <120B038C-FC52-432B-A6A6-42DA59B5F4C1 at chaoticbox dot com>
I make REALcontrol.

Because I cannot acquire HWND of control with initFunction of behavior and openFunction, I acquire it with controlHandleGetter.

A source is as follows.

ULONG controlHandleGetter( REALcontrolInstance instance )
{
  ControlData(ListViewExControl,instance,LSTVIEWX,data);
  HWND  hwnd;
  hwnd = REALGetControlHandle( instance );
  if(REALinRuntime()){
    if(hwnd && data->hWnd==NULL)
    {
      data->hWnd = hwnd;

      //CreateWindowEx and set control style
      _lvx_on_create(instance);

      //Fire true Open event
      void (*fp)(REALcontrolInstance instance);
fp = (void (*)(REALcontrolInstance instance)) REALGetEventInstance(instance, &lvxEvents[0]);
      if (fp) fp(instance);

      lvxStateChanged(instance,kBoundsChanged);
      UINT  id;
data->hThread = (HANDLE)_beginthreadex( NULL, 0, &_lvx_threadproc, (LSTVIEWX*)data, 0, &id ); if((LONG)data->hThread==-1L) _DEBUG(L"failed _beginthreadex. (reason=%d)",GetLastError());
    }
  }
  return (ULONG)hwnd;
}

However, I can make control in this way, but the property that I set with IDE is not succeeded to.

What kind of case will you use controlHandleGetter for?


_______________________________________________
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>