Home > Back-end >  Windows 7 system, Delphi environment, a new window will be hidden under the old window avoid how to
Windows 7 system, Delphi environment, a new window will be hidden under the old window avoid how to

Time:09-17

Delphi6 developed software sometimes pop-up window or dialog box hidden under the old window (main interface) leading to the mouse point fixed suspended animation!
Accidental, not often appear!
Bad luck, several times a day,
Good luck, generally does not happen,,
The great god, what is a good way to avoid this problem?

CodePudding user response:

If the code general, can only be upgraded to XE version

CodePudding user response:

MessageBox window handle is not set, such as direct to 0 for a window handle to do such a thing will happen, with MessageDlg generally won't appear, but the button need localization, the specified content is relatively a bit more.

CodePudding user response:

Also come across this problem before, then the great spirit ccrun gave a way to solve the,

Great god said normally the modal window is hidden behind the other Windows, window is the Z - Order problems

You can write

 void __fastcall TForm_Main: : Btn_PosCtrlClick (TObject * Sender) 
{
TFormStyle fs=FormStyle;
FormStyle=fsNormal;

Form_PosCtrl=new TForm_PosCtrl (this);
Form_PosCtrl - & gt; ShowModal ();
The delete Form_PosCtrl;

FormStyle=fs.
}


C + + code, for your reference

CodePudding user response:

reference hongss reply: 3/f
also come across this problem before, then the great spirit ccrun gave a way to solve the,

Great god said normally the modal window is hidden behind the other Windows, window is the Z - Order problems

You can write

 void __fastcall TForm_Main: : Btn_PosCtrlClick (TObject * Sender) 
{
TFormStyle fs=FormStyle;
FormStyle=fsNormal;

Form_PosCtrl=new TForm_PosCtrl (this);
Form_PosCtrl - & gt; ShowModal ();
The delete Form_PosCtrl;

FormStyle=fs.
}


C + + code, reference


XP is no problem for more than 7 will appear this problem I estimate may be is there any place to set up the computer system of the

CodePudding user response:

refer to the second floor yqbaby response:
MessageBox window handle is not set, such as direct to 0 for a window handle, do such a thing will happen, with MessageDlg generally won't appear, but the button need localization, the specified content is relatively more.
, and


There is no such problem under XP only available in the Windows 7 above

CodePudding user response:

refer to the second floor yqbaby response:
MessageBox window handle is not set, such as direct to 0 for a window handle, do such a thing will happen, with MessageDlg generally won't appear, but the button need localization, the specified content is relatively more.


To me a MessageBox did handle to the window handle to the current window or will happen
Code is as follows: a MessageBox (self. Handle 'XXXXXXXXXXXXXXXXXX', 'tip (Tips), MB_OK);

CodePudding user response:

Messagebox try the handle to the application
  • Related