Removing Window Icon!

Just starting out? Need help? Post your questions and find answers here.
Chirantha
User
User
Posts: 54
Joined: Sat Jul 16, 2005 7:22 pm

Removing Window Icon!

Post 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 :(
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

#ICON_SMALL = 0
#ICON_BIG = 1
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Chirantha
User
User
Posts: 54
Joined: Sat Jul 16, 2005 7:22 pm

Post 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 :(
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

You mean you want to HIDE the fact that your program is running from the user? :shock:
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post 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.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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
oh... and have a nice day.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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.
oh... and have a nice day.
Post Reply