Archive: Remove the icon from dialogs' titlebar?


Remove the icon from dialogs' titlebar?
Hi! This is a little bit strange question, but that's my bosses' requirements - how to remove the icon from the title of the dialogs in MUI? Is there a way to do it from the script or if not - a way to edit some resources and which exactly?


Maybe you can use white bitmap (if your title is white too) without any picture. So it will be invisible to user.

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "bitmap.bmp"
!define MUI_HEADERIMAGE_RIGHT


Another way - find your UI (by default - c:\Program Files\NSIS\Contrib\UIs\modern.exe).
Open it in resource editor, find dialog 105, select icon and set it invisible (uncheck "WS_Visible").
You can rename modified UI (if you want to use both standard and modified) - and in your script you can write
!define MUI_UI "modified_modern.exe"

i think he is talking about the titlebar of the dialog, if that is the case the only options i can think of are:

a: add the toolbarwindow ex style to the window (you will loose the minimize button aswell)

b: extract a transparent icon to the temp dir and call LoadIcon with the system plugin, then use the WM_SETICON message to set as the icon (there will be a 16 px space betweeen the dialog edge and the title)

c: create a plugin that subclasses the dialog and handles the drawing of the titlebar

edit: this also seems to work: sendmessage $hwndparent 0x80 1 1
(put in onGuiInit)


I tested sendmessage yesterday at home on Win98 and now in office on Win2K, very strange, but this not works. Script attached.


Originally posted by Takhir
I tested sendmessage yesterday at home on Win98 and now in office on Win2K, very strange, but this not works. Script attached.
it worked on my xp machine, but i passed 1 as a parameter where u are supposed to use 0 so this is probably not a solution u want to use (the docs say pass 0 as handle to remove icon but that doesnt seem to work)

Yep, just tested, "1 1" in .onGuiInit works on XP (blank space instead of icon). But XP only.


Yes, I mean the icon which is in the title bar of the dialogs. So I think that the first suggestion of Dkom is not useful as it would rather work with the big pictures located over the main dialog area. The second suggestion of Dkom seems to be rather useful, but when I open mothern.exe with resource hacker or with visual studio, there is no icon in the title bar of none of the dialogs. So that's why I think he again meant the pictures in the main dialog area.
From the suggestions given by Anders, I like the last one, since I can't seem to understand the a. suggestion, b. suggestion seems to give not very good result and c. suggestion seems rather difficult.
So i want to try with
sendmessage $hwndparent 0x80 1 1
but when I put .onGuiInit in my script, the compiler says that this function is already defined in the script, although I cannot find another copy of it. So I experimented moving it up and down in the code and found that the problem is with the MUI_LANGUAGE macro - if I remove it, the scripts is compiled, but then it gives some warning about the language and the setup is not working at all..
So why does it say that .onGuiInit is already defined?


Modern UI Readme http://nsis.sourceforge.net/Contrib/...ustomFunctions


!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit

Function myGUIInit
...your own code...
FunctionEnd

Thanks, Takhir!
SendMessage $hwndparent 0x80 1 1 (which means actually sendmessage $hwndparent WM_SETICON 1 1) works only with winXP - it doesn't work with 98 and 2000. So I tried to make a plug-in which call the same sendmessage but to load a transparent icon, as suggested by Anders. It worked on all windows versions but unfortunately there is an unpleasant side effect - the icon on the taskbar dissapears too. So I really don't know what else to try..?


why is this icon such a big deal?

I know delphi/c++ builder apps has a hidden window(well its hidden at -32000x-32000, visible, just not on screen) that acts as the parent of the real dialog windows, u could try something like that (Should allow you to keep the alt+tab & taskbar icon)