This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Re: Few minor issues
- From: Biju <bijumaillist at yahoo dot com>
- To: cygwin-xfree at cygwin dot com
- Date: Thu, 29 May 2003 00:12:07 -0700 (PDT)
- Subject: Re: Few minor issues
- Reply-to: cygwin-xfree at cygwin dot com
--- Harold L Hunt II <huntharo@msu.edu> wrote:
> Biju wrote:
> > I dont know whether others noticed these.
> >
> > 1)
> > After we start XWin.exe the mouse pointer will automatically move to center of screen.
>
> I looked for the code that does this (it is general X code, not
> Cygwin/XFree86-specific code) the last time that someone brought this up
> (wasn't it you?).
Not me, And this is only a minor issue. May be XFree people can help us.
So we dont need to wast time on it now.
> > 2)
> > On -multiwindow mode if we press Alt-F4 on any of the X application screen
> > it will popup "Exit Dialog Box" for XWin.exe.
> >
>
> I don't know if there is a better way that this should work. Maybe you
> have a point. I might try to see if I can do anything.
>
> > 3)
> > On normal mode if click "close (X)" button on title bar, or "close" on sysmenu
> > It close XWin.exe with out showing "Exit Dialog Box"
> >
>
> Now you have a point. I was just calling GiveUp () in the WM_CLOSE
> message. I moved the call to GiveUp () to a WM_GIVEUP message.
> WM_CLOSE now opens the dialog box. The dialog box sends WM_GIVEUP if OK
> is pressed. This seems to work well on my system.
>
> > Can we centralize the "Exit Dialog Box" using DS_CENTER flag for STYLE attribute?
> >
>
> Thanks. I never saw any window styles for centering. There doesn't
> seem to be much documentation on the DS_* flags as a search in MSDN only
> turns up a handful of articles. I applied this to my local XWin.rc.
>
I found it at Windows CE page. And I tried on Win XP.
http://msdn.microsoft.com/library/en-us/wceui40/html/cerefdlgtemplate.asp
Searching in Internet is like Searching a needle in hay stack
If u are unable to find something in MSDN or else where,
just send a mail asking somebody to search MSDN for you.
We will be happy to do that. At least we will be able to contribute to project like that
> > To hide from taskbar we may be able to use WS_EX_TOOLWINDOW flag for EXSTYLE attribute.
> > I am attaching an example for this.
> >
>
> Hiding from the taskbar? It isn't shown on my taskbar. I am using
> Windows XP... what version are you using?
Now I use Windows XP Pro.
Only in -multiwindow with "hide root" it hides from Task bar
But all other modes it is there in Taskbar.
Same case in WinXP Home, and Win2k (I tested 2 week back)
> WS_EX_TOOLWINDOW doesn't seem right. I tried it... it creats a window
> that looks like a tool pallette in Photoshop, not a dialog box.
>
Yeah, its for tool bar.
So for -nodecoration and -rootless you may be able to use that.
I am attaching a sample for this case
WS_EX_NOACTIVATE also wont show in task bar.
But I dont know whether we will able to use it.
It may be useful in -multiwindow mode with show root,
to act like a desktop. And u can put wallpaper
and root window click (????) on that.
> I did, however, add the extended style WS_EX_DLGMODALFRAME and the
> normal style WS_DLGFRAME. These didn't change anything for me, but they
> may help for you.
>
> I also noticed that an already existing exit dialog was not being
> brought to the foreground when the user performed another action that
> would display the dialog. The result was that the dialog box seemed to
> be lost and it seemed that you couldn't exit Cygwin/XFree86. I changed
> this to call SetForegroundWindow () for the dialog box when it already
> exists. This brings it to the top in response to such user-generated
> events.
You can also try SetWindowPos()
with Z-Order HWND_TOPMOST and flags SWP_NOSIZE | SWP_NOMOVE
http://msdn.microsoft.com/library/en-us/wceui40/html/cerefSetWindowPos.asp
I dont find any reason why "Exit Dialog" not to be TOPMOST
>
> Any ideas on how to get rid of the Maximize button on the dialog? I can
> do it by removing the WS_SYSMENU style... should we be using WS_SYSMENU
> or not? Not using WS_SYSMENU cause our icon to not be displayed on the
> upper-left hand corner, but I can't seem to find a flag that says "no
> maximize button".
>
Style DS_CENTER | WS_SIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
should show only "Close (X)" button
But if you use WS_MINIMIZEBOX, maxmize button will automaticaly come.
(similary WS_MAXIMIZEBOX cause minimise button to show up)
Additionly if you want to disable "Close (X)" button with SysMenu/Left hand Icon
Use WS_SYSMENU in Style
It will also bring up "Close(X)" button along with SysMenu
(M$ may have done this, to make old Win 3.1 pgm to show "Close (X)" button
If you remember there was no Close(X) in Win 3.1)
and then do
case WM_INITDIALOG:
hMenu = GetSystemMenu(hwnd, FALSE);
EnableMenuItem (hMenu , SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
But again, if you want a "Close" option as menu Item, then add
RemoveMenu(hMenu, SC_CLOSE, MF_BYCOMMAND );
AppendMenu(hMenu, MF_STRING, IDC_MYCLOSE, "&My Close");
> Thanks for your help,
>
> Harold
>
You are welcome. But no mention please ...
As I am doing very less compared you guys...
Cheers
Biju
Links:-
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowstyles.asp
http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/CreateWindowEx.asp
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowfeatures.asp#message_only
http://msdn.microsoft.com/library/en-us/wcesdkr/htm/_tools_style_statement.asp
http://msdn.microsoft.com/library/en-us/wceui40/html/cerefdlgtemplate.asp
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/aboutdialogboxes.asp#templates
http://msdn.microsoft.com/library/en-us/wceui40/html/cerefSetWindowPos.asp
------- example ---
#include "resource.h"
#include <windows.h>
IDD_MAIN DIALOG DISCARDABLE 0, 0, 250, 156
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&OK",IDOK,174,18,50,14
PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14
END
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com