How get a resource name ?

How get a resource name ?

Postby toninhofwi » Tue May 13, 2008 7:51 pm

Hi ppl.

How I do to get a resource name please? For example: in workshop I have a "Listbox" resource. I need know that the control name is "listbox" when I redefine it.

Thanks and regards,

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Postby Antonio Linares » Tue May 13, 2008 10:24 pm

Toninho,

From your PRG you can DEFINE DIALOG oDlg RESOURCE ... and don't redefine any of its controls. Then, once you have the oDlg:hWnd, you can step through its child controls and check the GetClassName( hWndControl ) of each control:
Code: Select all  Expand view  RUN
#define GW_CHILD      5
#define GW_HWNDNEXT   2

DEFINE DIALOG oDlg RESOURCE "Test"

ACTIVATE DIALOG oDlg ON INIT CheckControls( oDlg:hWnd )

...

function CheckControls( hWnd )

   local hCtrl := GetWindow( hWnd, GW_CHILD )

   while hCtrl != 0
      MsgInfo( GetClassName( hCtrl )
      hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
   end

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 61 guests