With a lot of open windows in a mdi gadget I want to prevent opening windows twice by bringing the allready open window to the front but it seems setactivewindow does not work within a mdi gadget? Selecting the window menu-entry works so there must be a way?
I understand that I cannot steal focus from other applications but I am inside my own application here.
Found that stickywindow also does not work inside a mdi gadget?
anyone ideas?
problem with setactivewindow in mdi gadget
-
- User
- Posts: 16
- Joined: Fri Jul 16, 2010 3:54 pm
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: problem with setactivewindow in mdi gadget
Have you tried something like SetWindowPos_(hWnd, #HWND_TOP,iXposn,iYposn,iWidth,iHeight,#SWP_NOMOVE | #SWP_NOSIZE)?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- User
- Posts: 16
- Joined: Fri Jul 16, 2010 3:54 pm
Re: problem with setactivewindow in mdi gadget
no, but tnx to your remark I tried BringWindowToTop_. That works. Rather use puer PB, but than again .. as long as it gets the job done.
so problem solved.
so problem solved.
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Re: problem with setactivewindow in mdi gadget
It's a message since this a 'system' on the MDIClient windowclass.
WM_MDIACTIVATE
http://msdn.microsoft.com/en-us/library ... S.85).aspx
WM_MDIACTIVATE
http://msdn.microsoft.com/en-us/library ... S.85).aspx
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: problem with setactivewindow in mdi gadget
You're going about it wrong. Purebasic actually comes with a (little-used) manual:
PB doc for SetGadgetState[b] wrote:- MDIGadget(): Change the currently focused childwindow (by giving the related #Window number), or use one of the following values: [/b]
#PB_MDI_Cascade : Cascade the child windows
#PB_MDI_TileVertically : Tile the childwindows vertically
#PB_MDI_TileHorizontally: Tile the childwindows horizontally
#PB_MDI_Next : Give focus to the next childwindow
#PB_MDI_Previous : Give focus to the previous childwindow
#PB_MDI_Arrange : Arrange the iconic (minimized) windows
BERESHEIT
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Re: problem with setactivewindow in mdi gadget
Can be and i went over there but i can't make head or tail about just activating the MDIform.
Next and such comes close but not specific.
Next and such comes close but not specific.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: problem with setactivewindow in mdi gadget
So to set a specific MDIChild to the front and focused you would:
Or, optionally you could use one of the listed parameters to rearrange them all.
Code: Select all
SetGadgetState(#mdigadget, #mdichild_<whichever>)
BERESHEIT
-
- User
- Posts: 16
- Joined: Fri Jul 16, 2010 3:54 pm
Re: problem with setactivewindow in mdi gadget
Far more elegant. Tnxnetmaestro wrote:So to set a specific MDIChild to the front and focused you would:Or, optionally you could use one of the listed parameters to rearrange them all.Code: Select all
SetGadgetState(#mdigadget, #mdichild_<whichever>)