Thread View: comp.os.os2.programmer
2 messages
2 total messages
Started by Nicolai Wadstr|m
Tue, 14 Apr 1992 22:27
Dialog as Mainwindow: Problems, help!!!
Author: Nicolai Wadstr|m
Date: Tue, 14 Apr 1992 22:27
Date: Tue, 14 Apr 1992 22:27
37 lines
1542 bytes
1542 bytes
The system (mailer & bbs) I'm working on right now has given me some
troubles... For convinience I use a Dialog as a main window, but this
causes some problems, I can't (or don't know how) to set the icon for
the window (the windows has a minimize button), and when the application
is started it doesn't get focus! The program windows comes to the foreground
but it does not become the active application!
This is how I call the dialog function:
void cdecl main (void)
{
HAB hab;
HMQ hmq;
hab = WinInitialize(NULL);
hmq = WinCreateMsgQueue(hab, 0);
WinDlgBox( HWND_DESKTOP, HWND_DESKTOP, MainDlgWnd, NULL, ID_MAINWND, NULL );
WinDestroyMsgQueue( hmq );
WinTerminate( hab );
}
I would be greatfull for any help!
Regards,
nicolai, nicolai@lysator.liu.se
--
Nicolai Wadstr|m # Internet: nicolai@lysator.liu.se
#
# BBS: +46-40-124554 (down)
# Voice: +46-40-975535
Re: Dialog as Mainwindow: Problems, help!!!
Author: Michael Harris
Date: Wed, 15 Apr 1992 05:47
Date: Wed, 15 Apr 1992 05:47
23 lines
1815 bytes
1815 bytes
nicolai@lysator.liu.se (Nicolai Wadstr|m) writes:
>The system (mailer & bbs) I'm working on right now has given me some
>troubles... For convinience I use a Dialog as a main window, but this
>causes some problems, I can't (or don't know how) to set the icon for
>the window (the windows has a minimize button), and when the application
>is started it doesn't get focus! The program windows comes to the foreground
>but it does not become the active application!
For the icon... look at WM_SETICON. You should send this message to the
dialog frame. (ie from inside the dialog proc, send the message to yourself.)
For the focus problem, are you returning TRUE from WM_INITDLG in your
dialog proc? Returning TRUE disables the default processing of setting
focus to the first control in your dialog. If you must return TRUE to
WM_INITDLG, use WinSetFocus to change the focus to a control on the dialog.
If you create the dialog invisible and set the position in your code with
WinSetWindowPos are you specifying SWP_ACTIVATE?
______________________________________________________________________________
Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
Vice-President, Computer & Technologies Theme Program, NC State University
(My opinions are my own and do not represent those of NCSU or IBM Corporation)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads