FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Icon on MDI and MDI Child
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Icon on MDI and MDI Child
Posted: Tue Dec 20, 2005 04:06 PM

To All

I am sure there is a simple solution .. I am not seeing the 'default' icon that is 'burnt' into my executable on the MDI and MDI child windows. All I see is a 'blank' icon in the upper left corner of my application.

In the old 16 bit days .. the icon always appeared on my MDI and MDI childs .. This has not really bothered me until now :D

Just curious what I need to do to to either 'define' or 'redefine' my icon from the resource.

Thanks
Rick Lipkin
SC Dept of Health

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Icon on MDI and MDI Child
Posted: Tue Dec 20, 2005 04:11 PM
Rick,

For the main window you may do:

   DEFINE ICON oIcon RESOURCE "test" 

   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 TITLE "I am the MDI Frame" ;
      MDI ;
      MENU BuildMenu() ;
      ICON oIcon


and add this to your RC:

test ICON "..\icons\fivewin.ico"

and the same for the mdichilds:

   DEFINE ICON oIcon RESOURCE "test"

   DEFINE WINDOW oWndChild MDICHILD OF oWnd ICON oIcon
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Icon on MDI and MDI Child
Posted: Tue Dec 20, 2005 04:23 PM

Antonio

All my icons are in a file called icons.rc which gets compiled to icons.res. I chose Icons.res to link into my executable.

I was hoping to use the icon resource from the executable ( since it is already burnt in ) ant not add it ( as well ) to my external .dll.

Is it possible to "grab" the icon from the executable ?? or would it be best to also import it into my external .dll and redefine it from there ??

Thanks
Rick Lipkin

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Icon on MDI and MDI Child
Posted: Tue Dec 20, 2005 05:24 PM

Rick,

You may use them from the EXE, but first you must do a SET RESOURCES TO. So the EXE becomes the place to look for resources.

SET RESOURCES TO
DEFINE ICON ...
SET RESOURCES TO <yourdll.dll>

After defining them, then do a SET RESOURCES TO <yourdll.dll> to set your resources to the DLL.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Icon on MDI and MDI Child
Posted: Tue Dec 20, 2005 05:53 PM

Antonio

I like the other idea better ... I will import the icons into my external .dll and burn them into the Executable as well because i am already setting the resources to that file anyway ..

I have been playing with the mdi childs and surprisingly some of the mdichilds seem to inherit the icon from the parent without defining the icon in the child .. wierd. It does not happen all the time and where I define the icon .. I use a Local variable object so it should not filter down to the other modules .. not a big deal .. just curious.

Thanks for your quick responce.

Rick Lipkin

Continue the discussion