Please clarify : it seems that this DEFAULT ICON not only for InputBox
TIA
DEFAULT ICON (for example using inputbox)
Moderator: Rathinagiri
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: DEFAULT ICON (for example using inputbox)
Viva INTERNATIONAL HMG
Re: DEFAULT ICON (for example using inputbox)
Correct, when you do not define a icon for a window, this icon is used.
Here the help from HMG MiniGui
The main icon defined by user could be used as default icon to all other windows.
SYNTAX
SET DEFAULT ICON TO <cIconName>
Here the help from HMG MiniGui
The main icon defined by user could be used as default icon to all other windows.
SYNTAX
SET DEFAULT ICON TO <cIconName>
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DEFAULT ICON (for example using inputbox)
I did not tested this upto now.
Thank you Claudio !
I made like this:
SET DEFAULT ICON TO "youtube.ico"
And I got this:
But MsgInfo and C_MsgBox are display other default icon. I guess this is from API ?
Is this normal ?
Thank you Claudio !
I made like this:
SET DEFAULT ICON TO "youtube.ico"
And I got this:
But MsgInfo and C_MsgBox are display other default icon. I guess this is from API ?
Is this normal ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: DEFAULT ICON (for example using inputbox)
+1Pablo César wrote:But MsgInfo and C_MsgBox are display other default icon. I guess this is from API ?
Is this normal ?
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: DEFAULT ICON (for example using inputbox)
Yes, is normal,Pablo César wrote:But MsgInfo and C_MsgBox are display other default icon. I guess this is from API ?
Is this normal ?
but ...
Code: Select all
#include "hmg.ch"
Function main()
SET DEFAULT ICON TO "DefaultIcon.ICO"
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 480 ;
MAIN ;
@ 50 ,100 BUTTON Button_1 ;
CAPTION "Press" ;
ACTION MsgInfo ("Text","Title")
END WINDOW
CREATE EVENT PROCNAME SetDialogBoxIcon() STOREINDEX nIndex
EventProcessAllHookMessage ( nIndex, .T. )
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
FUNCTION SetDialogBoxIcon
STATIC hIcon := 0, Old_hWnd := 0
LOCAL hWnd := EventHWND()
IF Old_hWnd <> hWnd .AND. GetClassName ( hWnd ) == "#32770"
Old_hWnd := hWnd
IF hIcon == 0
hIcon := HMG_LOADICON ( _HMG_DefaultIconName )
ENDIF
IF hIcon <> 0
#define GCLP_HICON (-14)
SetClassLongPtr (hWnd, GCLP_HICON, hIcon)
ENDIF
ENDIF
RETURN NIL
#pragma BEGINDUMP
#include "SET_COMPILE_HMG_UNICODE.ch"
#include "HMG_UNICODE.h"
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( HMG_LOADICON )
{
TCHAR *cIconName = (TCHAR *) HMG_parc (1);
HICON hIcon = NULL;
if ( cIconName != NULL )
{ hIcon = LoadImage (GetModuleHandle (NULL), cIconName, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
if ( hIcon == NULL )
hIcon = LoadImage (NULL, cIconName, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADTRANSPARENT | LR_LOADFROMFILE);
}
HMG_retnl ((LONG_PTR) hIcon);
}
#pragma ENDDUMP
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
DEFAULT ICON (for example using inputbox)
Yeahhh !
Thank you Claudio.
Thank you Claudio.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: DEFAULT ICON (for example using inputbox)
Thanks Grigory and Claudio !
Serge
Serge
There's nothing you can do that can't be done...
Re: DEFAULT ICON (for example using inputbox)
Thank yousrvet_claudio wrote:Yes, is normal,Pablo César wrote:But MsgInfo and C_MsgBox are display other default icon. I guess this is from API ?
Is this normal ?
but ...
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG