Page 1 of 1

Removing Window Icon!

Posted: Wed Jul 30, 2008 2:28 am
by Chirantha
Hi,

How do I remove the icon that appears in the caption bar on the window? I tried using the SETICON but the problem is PureBasic doesn't recognize ICON_SMALL or ICON_LARGE :(

Posted: Wed Jul 30, 2008 2:46 am
by Sparkie
#ICON_SMALL = 0
#ICON_BIG = 1

Posted: Wed Jul 30, 2008 2:52 am
by Chirantha
Ok, I got it to work. But there is a empty space left where the icon was.. Isn't there a way to completely remove it :(

Posted: Wed Jul 30, 2008 4:28 am
by Rook Zimbabwe
You mean you want to HIDE the fact that your program is running from the user? :shock:

Posted: Wed Jul 30, 2008 9:59 am
by Derek
@rook, stop being so paranoid. :wink:

I think he just wants to remove the icon from the topleft of a window, nothing to do with the taskbar icon.

Posted: Wed Jul 30, 2008 10:09 am
by Kaeru Gaman
nopes. just the icon.

@Chirantha

the icon resp the empty space is the place for the Window_SystemMenu,
this little menu that let's you iconfy, close, etc. your window.
to eliminate this, you'll have to leave out the #PB_Window_SystemMenu
Flag when opening the window.

Problem is: you need the SystemMenu to have the Min/Max/Close Buttons.

Code: Select all

OpenWindow(0, #PB_Ignore, #PB_Ignore, 240,120, "No System Menu", #PB_Window_TitleBar)
CreateGadgetList(WindowID(0))
ButtonGadget(0,224,0,16,16,"X")
TextGadget(1,16,32,160,20,"No Control-Buttons either")
Repeat
  EvID = WaitWindowEvent()
  EvGd = EventGadget()
  If EvID = #PB_Event_Gadget
    If EvGd = 0
      Quit = 1
    EndIf
  EndIf
Until Quit = 1

Posted: Wed Jul 30, 2008 10:18 am
by Fluid Byte
Kaeru Gaman wrote:nProblem is: you need the SystemMenu to have the Min/Max/Close Buttons.
Not necessarily :wink:

Code: Select all

OpenWindow(0,0,0,320,240,"No Window Icon", #WS_OVERLAPPEDWINDOW | #WS_VISIBLE | 1)
SetWindowLong_(WindowID(0),#GWL_EXSTYLE,#WS_EX_DLGMODALFRAME)
HideWindow(0,0)

While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend

Posted: Wed Jul 30, 2008 10:25 am
by Kaeru Gaman
Oy! Dah API-Slayer strikes back... :lol:

I knew there should be something like that.
DLGMODALFRAME
is very, very special.

In my opinion, you should avoid such trickery pickery as often as possible.