childwindow

Create child window in WM_CREATE, relevance of same thread?

限于喜欢 提交于 2019-12-25 01:39:44
问题 A typical pattern is to create a child window in the message callback ( WndProc ) at message WM_CREATE : LRESULT APIENTRY WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { ... switch (message) { case WM_CREATE: .... hwndChild[i] = CreateWindow (szChildClass[i], NULL, WS_CHILDWINDOW | WS_BORDER ... I perfectly understand this is a good opportunity, but is it a problem to do it any time later? One reason for doing so is that the child window is created within the same thread.

C++ MFC MDI change child window variables on creation

喜夏-厌秋 提交于 2019-12-24 20:28:38
问题 I have an MDI application where a dialog is called when the OnFileNew() function (processed by the theApp object) is called. This dialog allows the user to set values to some variables that then need to be passed on to the CChildFrame object that is created when the ->CreateNewChild() function is called. How do I pass these variables onto the CChildFrame object that is created by the ->CreateNewChild() function? EDIT: In response to an answer I got, here are the results for using ->Create()

ALT+TAB in Vista activates main window instead of previously active child window

蓝咒 提交于 2019-12-24 16:16:11
问题 My app (written in C++) uses Win32 (not MFC) to create a couple of windows with CreateWindowEx. The main window gets the desktop as parent, the child windows get the main window as parent. my problem: my app has an active child window I switch to another app (per click, ALT+TAB or other, doesn't matter) I switch back to my app with ALT+TAB Now the main window of my app is activate, not the child window anymore. If I switch back clicking the taskbar entry, the child window remains active. This

Pass data to Child Window in Silverlight 4 using MVVM

一世执手 提交于 2019-12-22 09:59:55
问题 I have a datagrid with master detail implementation as follows: <data:DataGrid x:Name="dgData" Width="600" ItemsSource="{Binding Path=ItemCollection}" HorizontalScrollBarVisibility="Hidden" CanUserSortColumns="False" RowDetailsVisibilityChanged="dgData_RowDetailsVisibilityChanged"> <data:DataGrid.Columns> <data:DataGridTextColumn Header="Item" Width="*" Binding="{Binding Item,Mode=TwoWay}"/> <data:DataGridTextColumn Header="Company" Width="*" Binding="{Binding Company,Mode=TwoWay}"/> </data

Use response value in child window

和自甴很熟 提交于 2019-12-13 08:58:22
问题 I am having difficulty getting to grips with how Silverlight uses asynchronous responses from a web service. I have declared- public partial class Users : Page { public string PID; and then use- if { WebService.Service1SoapClient client = new WebService.Service1SoapClient(); string profile = System.Convert.ToString(((ListBoxItem)listBox1.SelectedItem).Content); client.pidReturnCompleted += new EventHandler<pidReturnCompletedEventArgs>(client_pidReturnCompleted); client.pidReturnAsync(USERID,

How to close a ChildWindow from an UserControl button loaded inside it?

瘦欲@ 提交于 2019-12-12 19:15:28
问题 this is my ChildWindow xaml code: 1 <Grid x:Name="LayoutRoot"> 2 <Grid x:Name="teste"> 3 <Grid.ColumnDefinitions> 4 <ColumnDefinition Width="*"/> 5 <ColumnDefinition Width="*"/> 6 </Grid.ColumnDefinitions> 7 <Grid.RowDefinitions> 8 <RowDefinition /> 9 <RowDefinition Height="Auto" /> 10 </Grid.RowDefinitions> 11 <local:UserControl1 Grid.Row="0" Grid.ColumnSpan="2"/> 12 </Grid> 13 </Grid> This is my UserControl1 xaml code: 1 <Grid x:Name="LayoutRoot" Background="#FFA34444"> 2 <Button Click=

How to show a child form within a mdi container form which its windowstate= maximized?

放肆的年华 提交于 2019-12-11 13:07:56
问题 How can I show a child form within a mdi container form which its windowstate= maximized ? when I put these below lines of code when my child form is loading (by clicking on a menu Item of my Main form), the child form loses its parent position and does not show within its parent form. private void mnuUnit_Click(object sender, EventArgs e) { frmUnit frm = new frmUnit(); frm.MdiParent = this; frm.WindowState = FormWindowState.Maximized; frm.Show(); } 回答1: Did you forget to paste your code? To

Close previous window from current window

杀马特。学长 韩版系。学妹 提交于 2019-12-11 10:19:01
问题 In Silverlight I am using a profile window, with the option to delete the current profile in a hyperlink button. When the user hits the hyperlink button it takes them to a new form to confirm the deletion. Although the delete function has worked (i.e. the profile has been deleted form the datatbase), how can I get the first window to close when the user confirms? This is what the hyperlink calls- private void deleteProfile(object sender, RoutedEventArgs e) { deleteProfile dProfile = new

Silverlight ChildWindow does not reposition correctly

那年仲夏 提交于 2019-12-11 07:06:34
问题 I am using the ChildWindow (Silverlight) which also contains some expander controls. In one case, when the expander control expands, the bottom of the child window expands down out the screen on the bottom, but still leaves room on the top. How can I re-position a child window in order to center it in the screen, as if I just opened the childwindow? (That would be easy, but I don't think doable) (manual intervention) I've gone through RenderTransform of the the ContentRoot, and I have six

During Silverlight ChildWindow closing animation user can click any button

有些话、适合烂在心里 提交于 2019-12-11 06:45:54
问题 I am developing a rich user interface using Silverlight 5. I have lots of ChildWindows. Child Window has sort of buttons which are bound with Commands. I realized that if Child Window Close method is called, closing animation begins. However during animation user can click any button, which causes unexpected situations. To prevent this I need to unbind all buttons immediately on close request. I don't like to put this logic everywhere. Do you have any better solutions? <Grid x:Name=